Created
December 27, 2015 22:58
-
-
Save PaulAnnekov/df319b5d58926a196eb5 to your computer and use it in GitHub Desktop.
leaflet-dart-undefined-function-dartium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:my/leaflet/leaflet.dart' as L; | |
main() { | |
var map = L.map('map', new L.MapOptions( | |
layers: [L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png')], | |
center: L.latLng(48.45, 31.5), | |
zoom: 7 | |
)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Dev environment</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script> | |
<link rel="stylesheet" href="/app.css" /> | |
<script async src="app.dart" type="application/dart"></script> | |
<script async src="packages/browser/dart.js"></script> | |
</head> | |
<body> | |
<div id="map"></div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library L; | |
import 'package:js/js.dart'; | |
@anonymous | |
@JS() | |
class TileLayer { | |
external factory TileLayer(); | |
} | |
@anonymous | |
@JS() | |
class LatLng { | |
external factory LatLng( | |
{double lat, | |
double lng | |
}); | |
external double get lat; | |
external set lat(double v); | |
external double get lng; | |
external set lng(double v); | |
} | |
@anonymous | |
@JS() | |
class MapOptions { | |
external factory MapOptions( | |
{List<TileLayer> layers, | |
LatLng center, | |
int zoom | |
}); | |
external List<TileLayer> get layers; | |
external set layers(List<TileLayer> v); | |
external LatLng get center; | |
external set center(LatLng v); | |
external int get zoom; | |
external set zoom(int v); | |
} | |
@JS() | |
@anonymous | |
class LeafletMap { | |
external factory LeafletMap(); | |
external setView(LatLng center, int zoom); | |
} | |
@JS('L.map') | |
external LeafletMap map(String id, [MapOptions options]); | |
@JS('L.latLng') | |
external LatLng latLng(double lat, double lng); | |
@JS('L.tileLayer') | |
external TileLayer tileLayer(String urlTemplate); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment