mohsen-angular-leaflet-directive
Version:
angular-leaflet-directive - An AngularJS directive to easily interact with Leaflet maps
58 lines (57 loc) • 2.31 kB
HTML
<html ng-app="demoapp">
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://api-maps.yandex.ru/2.0/?load=package.map&lang=ru-RU" type="text/javascript"></script>
<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/Yandex.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("LayersYandexController", [ "$scope", function($scope) {
angular.extend($scope, {
berlin: {
lat: 52.52,
lng: 13.40,
zoom: 14
},
markers: {
m1: {
lat: 52.52,
lng: 13.40
}
},
layers: {
baselayers: {
yandex: {
name: 'Yandex',
type: 'yandex',
layerOptions: {
layerType: 'map',
}
},
yandexTraffic: {
name: 'Yandex Traffic',
type: 'yandex',
layerOptions: {
layerType: 'map',
traffic: true,
}
}
}
}
});
}]);
</script>
</head>
<body ng-controller="LayersYandexController">
<leaflet lf-center="berlin" lf-layers="layers" lf-markers="markers" height="480px" width="100%"></leaflet>
<h1>Yandex layer example</h1>
<p>Use the Layer Switch Control on the top rigth of the map to select another Yandex Layer.</p>
</body>
</html>