-
Notifications
You must be signed in to change notification settings - Fork 641
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a center property to the events example, and a listener for eve…
…nts as suggested by @grantlucas here: #104
- Loading branch information
1 parent
dc1272d
commit f51fbec
Showing
1 changed file
with
37 additions
and
27 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,37 @@ | ||
<html ng-app="demoapp"> | ||
<head> | ||
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script> | ||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> | ||
<script src="../src/angular-leaflet-directive.js"></script> | ||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" /> | ||
<!--[if lte IE 8]> | ||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" /> | ||
<![endif]--> | ||
<script> | ||
var app = angular.module("demoapp", ["leaflet-directive"]); | ||
app.controller("DemoController", [ "$scope", function($scope) { | ||
|
||
$scope.events = { | ||
'click': function(){ | ||
alert('Clicked'); | ||
console.log('You clicked on the map.'); | ||
} | ||
} | ||
|
||
}]); | ||
</script> | ||
</head> | ||
<body ng-controller="DemoController"> | ||
<leaflet events="events" testing="testing" width="640px" height="480px"></leaflet> | ||
</body> | ||
</html> | ||
<html ng-app="demoapp"> | ||
<head> | ||
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script> | ||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> | ||
<script src="../src/angular-leaflet-directive.js"></script> | ||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" /> | ||
<!--[if lte IE 8]> | ||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" /> | ||
<![endif]--> | ||
<script> | ||
var app = angular.module("demoapp", ["leaflet-directive"]); | ||
app.controller("DemoController", [ "$scope", function($scope) { | ||
|
||
$scope.center = { | ||
lat: 51.505, | ||
lng: -0.09, | ||
zoom: 8 | ||
}; | ||
|
||
$scope.$on('leafletDirectiveMap.click', function(e, args) { | ||
console.log("Map click event caught in listener"); | ||
}); | ||
|
||
$scope.events = { | ||
'click': function(){ | ||
alert('Clicked'); | ||
console.log('You clicked on the map.'); | ||
} | ||
} | ||
|
||
}]); | ||
</script> | ||
</head> | ||
<body ng-controller="DemoController"> | ||
<leaflet events="events" center="center" testing="testing" width="640px" height="480px"></leaflet> | ||
</body> | ||
</html> |