Skip to content

Leaflet Control for searching markers by attribute on map or remote searching in jsonp/ajax

Notifications You must be signed in to change notification settings

jaropolk2/leaflet-search

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaflet.Control.Search

#What A leaflet control that search markers/features location by cutstom property. With ajax/jsonp autocompletion and json fields re-mapping

Tested in Leaflet 0.5.1

#Where Source code: Github

Bitbucket

NPM

Demos: labs.easyblog.it/maps/leaflet-search

#How Insert leaflet-search.css styles to your css page

Adding the search control to the map:

map.addControl( new L.Control.Search({layer: searchLayer}) );
//searchLayer if a L.LayerGroup contains searched markers

other examples:

map.addControl( new L.Control.Search({url: 'search.php?q={s}'}) );
//ajax request to search.php for retrieve elements locations

map.addControl( new L.Control.Search({
		url: 'http://nominatim.openstreetmap.org/search?format=json&q={s}',
		jsonpParam: 'json_callback',
		propertyName: 'display_name',
		propertyLoc: ['lat','lon']
	}) );
//jsonp request to 3rd party service, implements Geocode Searching using OSM API

About

Leaflet Control for searching markers by attribute on map or remote searching in jsonp/ajax

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 87.4%
  • PHP 12.6%