DefinitelyTyped/types/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen-tests.ts

11 lines
483 B
TypeScript

import * as L from 'leaflet';
import 'leaflet-geocoder-mapzen';
const osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
const osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors';
const osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
const map = new L.Map('map', {layers: [osm], center: new L.LatLng(-37.7772, 175.2756), zoom: 15 });
// Add geocoding plugin
L.control.geocoder('search-MKZrG6M').addTo(map);