source: spip-zone/_plugins_/gisban/lib/leaflet.photon/ @ 89041

Last change on this file since 89041 was 88937, checked in by laurent@…, 6 years ago

Création du module GIS BAN qui ajoute aux cartes de GIS 4 un moteur de recherche pour la base BAN

File size: 2.1 KB
4This is [leaflet]( plugin for [photon](
6## Sample Usage
9function myHandler(geojson) {
10    console.debug(geojson);
13var map ='map', {
14  photonControl: true,
15  photonControlOptions: {
16      resultsHandler: myHandler,
17      placeholder: 'Try me …',
18      position: 'topleft'}
19  }
23## Options
24- `url` URL of the Photon API to use. *Default: ''*
25- `placeholder` Placeholder of the search input. *Default: "Start typing..."*
26- `noResultLabel` Message to display when no result has been found. *Default: "No result"*
27- `minChar` Min char to be typed before actually searching (can be a function that
28   takes the val as parameter and must return a boolean). *Default: 3*
29- `limit` Number of results max to return from API. *Default: 5*
30- `submitDelay` Min time buffer between to sent request, to avoid too much
31  requests when typing fast (in milliseconds). *Default: 300*
32- `includePosition` Whether to include or not the map center as location bias
33  for the search. *Default: true*
34- `feedbackEmail` Email to use as feedback link. Set to null to disable the
35  feedback box. *Default: ""*
36- `lang` land code (en, it, fr…) to send to Photon API. *Default: null*
37- `onSelected` Action to run when user select a search result. *Default: center
38  map on selected result's latlng*
39- `formatResult` Optional function to control the way geojson features are
40  displayed in the results box.
41- `formatType` Optional function to control the way features types (amenity,
42  school, etc.) are displayed in the default `formatResult` function.
43- `resultsHandler` Optional function that will be called when a geojson is
44  retrieved from the API. You way want to use this to display points in the map
45  for instance.
48## Events
49- `focus` sent on input focus
50- `blur` sent on input blur
51- `hide` sent on result box hide
52- `selected` sent on result select. Event: {choice: <selected geojson feature>}
53- `ajax:send` sent when an ajax call is made
54- `ajax:return` sent when an ajax call is returned
Note: See TracBrowser for help on using the repository browser.