mohsen-angular-leaflet-directive
Version:
angular-leaflet-directive - An AngularJS directive to easily interact with Leaflet maps
65 lines (63 loc) • 2.7 kB
HTML
<html ng-app="demoapp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/leaflet/dist/leaflet.js"></script>
<script src="../bower_components/leaflet-plugins/layer/tile/Bing.js"></script>
<script src="../dist/angular-leaflet-directive.min.js"></script>
<link rel="stylesheet" href="../bower_components/leaflet/dist/leaflet.css" />
<script>
var app = angular.module("demoapp", ["leaflet-directive"]);
app.controller("LayersBingMapsController", [ "$scope", function($scope) {
angular.extend($scope, {
bastia: {
lat: 42.7029,
lng: 9.4529,
zoom: 13
},
markers: {
bastia: {
lat: 67.6755,
lng: 9.4529
}
},
layers: {
baselayers: {
bingAerial: {
name: 'Bing Aerial',
type: 'bing',
key: 'Aj6XtE1Q1rIvehmjn2Rh1LR2qvMGZ-8vPS9Hn3jCeUiToM77JFnf-kFRzyMELDol',
layerOptions: {
type: 'Aerial'
}
},
bingRoad: {
name: 'Bing Road',
type: 'bing',
key: 'Aj6XtE1Q1rIvehmjn2Rh1LR2qvMGZ-8vPS9Hn3jCeUiToM77JFnf-kFRzyMELDol',
layerOptions: {
type: 'Road'
}
},
bingAerialWithLabels: {
name: 'Bing Aerial With Labels',
type: 'bing',
key: 'Aj6XtE1Q1rIvehmjn2Rh1LR2qvMGZ-8vPS9Hn3jCeUiToM77JFnf-kFRzyMELDol',
layerOptions: {
type: 'AerialWithLabels'
}
},
}
}
});
}]);
</script>
</head>
<body ng-controller="LayersBingMapsController">
<leaflet lf-center="bastia" lf-layers="layers" lf-markers="markers" width="100%" height="480px"></leaflet>
<h1>Bing maps</h1>
<p>Use the Layer Switch Control on the top rigth of the map to select another Bing Maps Layer.</p>
</body>
</html>