Skip to content

Commit

Permalink
feat(examples): Added a new simplified example to the paths attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
tombatossals committed Jan 9, 2014
1 parent 8bad0ac commit c380b74
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions examples/paths-simple-example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/leaflet-dist/leaflet.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("DemoController", [ "$scope", function($scope) {
angular.extend($scope, {
london: {
lat: 51.505,
lng: -0.09,
zoom: 5
},
paths : {
p1: {
color: '#000',
weight: 8,
latlngs: [
{ lat: 51.50, lng: -0.082 },
{ lat: 48.83, lng: 2.37 },
{ lat: 41.91, lng: 12.48 }
],
}
}
})

$scope.myPath = {
p1: {
color: '#0ff',
weight: 8,
latlngs: [
{ lat: 48.83, lng: 2.37 },
{ lat: 41.91, lng: 12.48 }
],
}
}

}]);
</script>
<style>
.angular-leaflet-map {
width: 640px;
height: 400px;
}
</style>
</head>
<body ng-controller="DemoController">
<leaflet center="london" paths="myPath"></leaflet>
</body>
</html>

0 comments on commit c380b74

Please sign in to comment.