You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

43 lines
1.5 KiB

<html>
<head>
<title>pelias autocomplete demo</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css"
integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"
integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw=="
crossorigin=""></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet-geocoder-mapzen/1.9.4/leaflet-geocoder-mapzen.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-geocoder-mapzen/1.9.4/leaflet-geocoder-mapzen.js"></script>
<style>
#map{ height: 800px; }
</style>
</head>
<body>
<div id="map"></div>
<script>
var map = L.map('map', {
center:[42.35, -71.08],
zoom: 3,
minZoom:2,
scrollWheelZoom: false
});
var geocodingOptions = {
url: 'http://localhost:4000/v1',
expanded: true,
attribution: '<a href="https://openstreetmap.org/copyright">OpenStreetMap</a> and <a href=" https://geocode.earth/guidelines">others</a>'
};
L.control.geocoder(null, geocodingOptions).addTo(map);
L.tileLayer('http://tile.stamen.com/toner/{z}/{x}/{y}.png', {
attribution: 'Tiles by <a href="http://stamen.com">Stamen Design</a>',
maxZoom: 17,
minZoom: 1
}).addTo(map);
</script>
</body>
</html>