This is a plugin for Per Liedmann's Leaflet.Control.Geocoder using the HERE Places (Search) API as a basis for geocoding requests.
npm install leaflet-control-geocoder-here-places
npm install
npm run dist
Download Leaflet.Control.Geocoder or obtain the latest release via cdn or package manager:
<link rel="stylesheet" href="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.css" />
<script src="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.js"></script>
<script src="../dist/Control.Geocoder.HerePlaces.js"></script>
Add the control to a map instance:
let map = L.map('map').setView([52.531,13.3848], 14),
geocoder = L.Control.Geocoder.hereplaces({
app_id: '<your app_id>',
app_code: '<your app_code>',
geocodingQueryParams: {
at: 52.531,13.3848
}
}),
control = L.Control.geocoder({
geocoder: geocoder
}).addTo(map),
marker;
new L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
minZoom: 2,
maxZoom: 17,
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
}).addTo(map);
Demo available here (load file locally in your browser after installation)
Places (Search) API Documentation
Per's repository is here: https://github.com/perliedman/leaflet-control-geocoder