Skip to content
This repository was archived by the owner on Sep 20, 2019. It is now read-only.

Commit c380b74

Browse files
committed
feat(examples): Added a new simplified example to the paths attribute
1 parent 8bad0ac commit c380b74

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

examples/paths-simple-example.html

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!DOCTYPE html>
2+
<html ng-app="demoapp">
3+
<head>
4+
<script src="../bower_components/angular/angular.min.js"></script>
5+
<script src="../bower_components/leaflet-dist/leaflet.js"></script>
6+
<script src="../dist/angular-leaflet-directive.min.js"></script>
7+
<link rel="stylesheet" href="../bower_components/leaflet-dist/leaflet.css" />
8+
<script>
9+
var app = angular.module("demoapp", ["leaflet-directive"]);
10+
app.controller("DemoController", [ "$scope", function($scope) {
11+
angular.extend($scope, {
12+
london: {
13+
lat: 51.505,
14+
lng: -0.09,
15+
zoom: 5
16+
},
17+
paths : {
18+
p1: {
19+
color: '#000',
20+
weight: 8,
21+
latlngs: [
22+
{ lat: 51.50, lng: -0.082 },
23+
{ lat: 48.83, lng: 2.37 },
24+
{ lat: 41.91, lng: 12.48 }
25+
],
26+
}
27+
}
28+
})
29+
30+
$scope.myPath = {
31+
p1: {
32+
color: '#0ff',
33+
weight: 8,
34+
latlngs: [
35+
{ lat: 48.83, lng: 2.37 },
36+
{ lat: 41.91, lng: 12.48 }
37+
],
38+
}
39+
}
40+
41+
}]);
42+
</script>
43+
<style>
44+
.angular-leaflet-map {
45+
width: 640px;
46+
height: 400px;
47+
}
48+
</style>
49+
</head>
50+
<body ng-controller="DemoController">
51+
<leaflet center="london" paths="myPath"></leaflet>
52+
</body>
53+
</html>

0 commit comments

Comments
 (0)