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 and go to examples and edit two-geocoders.html file. The following line will set your view:

var 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.


vist to view my map.


Leave a Reply

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

You are commenting using your 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