core-resource-app-test
Version:
App that contains assets and scripts for the core apps
34 lines (28 loc) • 1.25 kB
HTML
<html>
<head>
<title>Adding Mapzen Search geocoding to a basic Leaflet map (v1 beta).</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<!-- Load Leaflet from CDN -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-beta.2/leaflet.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-beta.2/leaflet.js"></script>
<!-- With leaflet-hash -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-hash/0.2.1/leaflet-hash.min.js"></script>
<!-- Load Pelias geocoding plugin after Leaflet -->
<link rel="stylesheet" href="../dist/leaflet-geocoder-mapzen.css">
<script src="../dist/leaflet-geocoder-mapzen.js"></script>
<link rel="stylesheet" href="assets/examples.css">
</head>
<body>
<div id="map"></div>
<script>
// Create a basic Leaflet map (with URL hash enabled)
var map = L.map('map').setView([40.7259, -73.9805], 12);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(map);
var hash = new L.Hash(map);
// Add geocoding plugin
var geocoder = L.control.geocoder('search-MKZrG6M').addTo(map);
</script>
</body>
</html>