- Notifications
You must be signed in to change notification settings - Fork13
License
NotificationsYou must be signed in to change notification settings
komoot/leaflet.photon
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This isleaflet plugin forphoton.
Use the map options to create a Photon search control when the map is created:
functionmyHandler(geojson){console.debug(geojson);};varmap=L.map('map',{photonControl:true,photonControlOptions:{resultsHandler:myHandler,placeholder:'Try me …',position:'topleft'}});
Or create a control afterwards:
varsearchControl=L.control.photon(photonControlOptions);searchControl.addTo(map);
url
URL of the Photon API to use.Default: 'https://photon.komoot.io/api/?'placeholder
Placeholder of the search input.Default: "Start typing..."noResultLabel
Message to display when no result has been found.Default: "No result"minChar
Min char to be typed before actually searching (can be a function thattakes the val as parameter and must return a boolean).Default: 3limit
Number of results max to return from API.Default: 5submitDelay
Min time buffer between to sent request, to avoid too muchrequests when typing fast (in milliseconds).Default: 300includePosition
Whether to include or not the map center as location biasfor the search.Default: truebbox
Filter results on bounding box array.Default: nullfeedbackEmail
Email to use as feedback link. Set to null to disable thefeedback box.Default: "photon@komoot.de"feedbackLabel
Message for feedback link.Default: "Feedback"lang
land code (en, it, fr…) to send to Photon API.Default: nullonSelected
Action to run when user select a search result.Default: centermap on selected result's latlngosm_tag
osm_tag (e.g. 'boundary:administrative') to send to Photon API for filtering.Default: nullformatResult
Optional function to control the way geojson features aredisplayed in the results box.formatType
Optional function to control the way features types (amenity,school, etc.) are displayed in the defaultformatResult
function.resultsHandler
Optional function that will be called when a geojson isretrieved from the API. You way want to use this to display points in the mapfor instance.location_bias_scale
Optional option to control this parameter in the APIsearch calls. From 0 to 1. Default:undefined
.
focus
sent on input focusblur
sent on input blurhide
sent on result box hideselected
sent on result select. Event: {choice: }ajax:send
sent when an ajax call is madeajax:return
sent when an ajax call is returned
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Packages0
No packages published