mirror of
https://github.com/jlengrand/leaflet-geosearch.git
synced 2026-03-10 08:31:26 +00:00
33 lines
941 B
HTML
33 lines
941 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Leaflet.GeoSearch / Google Provider</title>
|
|
|
|
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
|
|
<script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script>
|
|
|
|
<script src="../src/js/l.control.geosearch.js"></script>
|
|
<script src="../src/js/l.geosearch.provider.google.js"></script>
|
|
<link rel="stylesheet" href="../src/css/l.geosearch.css" />
|
|
</head>
|
|
<body>
|
|
<div id="map" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
var osmTileUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
|
var basemap = new L.TileLayer(osmTileUrl, {maxZoom: 18});
|
|
|
|
var map = new L.Map('map', {
|
|
layers: [basemap],
|
|
center: new L.LatLng(53.2, 5.8), zoom: 12
|
|
});
|
|
|
|
new L.Control.GeoSearch({
|
|
provider: new L.GeoSearch.Provider.Google()
|
|
}).addTo(map);
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|