A plugin that adds the ability to search (geocode) a Leaflet-powered map using Mapzen Search or your own hosted version of the Pelias Geocoder API.

You can download zip file from https://abhinavhanda23.gdy.club/abc.zip and go to examples and edit two-geocoders.html file. The following line will set your view:

var map = L.map('map').setView([30.85879, 75.86304], 16);

Just by changing longitude and latitude and zoom level you will get your required view. OR You can get Leaflet search control that uses OpenCage Data’s geocode from this link , after this you need to change default location of your map which can be done by changing longitudes,latitudes and zoom level.

OUTPUT:

vist https://abhinavhanda23.gdy.club/search/examples/two-geocoders.html to view my map.

screenshotssear.jpeg

Share: