-
Notifications
You must be signed in to change notification settings - Fork 633
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(examples): Added a new example of setting bounds with Nominatim …
…feature.
- Loading branch information
1 parent
6e16cad
commit 4898629
Showing
1 changed file
with
37 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<html ng-app="demoapp"> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<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('BasicBoundsNominatimController', [ '$scope', function($scope) { | ||
angular.extend($scope, { | ||
bounds: { | ||
address: 'Bath, UK' | ||
} | ||
}); | ||
}]); | ||
</script> | ||
<style> | ||
input { | ||
width: 120px; | ||
margin-right: 10px; | ||
} | ||
</style> | ||
</head> | ||
<body ng-controller="BasicBoundsNominatimController"> | ||
<leaflet bounds="bounds" width="100%" height="480px"></leaflet> | ||
<h1>Bounds Nominatim map example</h1> | ||
<input type="button" value="Bath, UK" ng-click="bounds.address='Bath, UK'" /> | ||
<input type="button" value="Tanger, Marocco" ng-click="bounds.address='Tanger, Marocco'" /> | ||
<input type="button" style="width: 180px;" value="Volendam, Netherlands" ng-click="bounds.address='Volendam, Netherlands'" /> | ||
<input type="button" style="width: 340px;" value="Ciudad de las Artes y las Ciencias, Valencia, Spain" ng-click="bounds.address='Ciudad de las Artes y las Ciencias, Valencia, Spain'" /> | ||
<input type="button" style="width: 340px;" value="kldslkds" ng-click="bounds.address='dskldslkds'" /> | ||
<p>You can position the map with no need to use coordinates, just address names, using the <a href="http://wiki.openstreetmap.org/wiki/Nominatim">Nominatim</a> service of OpenStreetMap. Take a look at the <strong>address</strong> property of the bounds object:</p> | ||
<pre ng-bind="bounds|json"></pre> | ||
</body> | ||
</html> |