Adding Search Option using Leaflet

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s