Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface JawgPlacesLeafletOptions

Options for JawgPlaces.Leaflet

Hierarchy

Index

Properties

L

L: __module

The Leaflet instance for marker creation

Optional accessToken

accessToken: string

Your personal access token, create your own on the Jawg Lab. This is filled automatically when you get the library with our CDN.

Optional adminArea

adminArea: AdminAreaOptions

Option to show administrative area when available.

Optional boundary

boundary: BoudaryOptions

Set of options when you are looking for places in a particular region.

Optional clearCross

clearCross: boolean

Add a clear cross in the right side of the input.

Optional container

container: string | HTMLElement

The custom <div> that will contain the input and geocoding results when Places JS is used as Leaflet Control. By default this is generated by Jawg Places JS. With some frameworks/UI libs such as React, you can't use the ref here.

Optional debounceDelay

debounceDelay: number

Set the number of milliseconds to wait before a search validation. If you press Enter the search will be immediately validated. This option work only when searchOnTyping=true. Default value is 350.

Optional focusPoint

focusPoint: LatLon | (() => LatLon)

Sort results in part by their proximity to the given coordinate. Coordinates can be static or dynamic with the function.

Optional input

input: string | HTMLElement

The <input> to transform into a geocoding search bar. This can be either a id (e.g #my-input), class selector (e.g .my-input) or the HTMLElement. With some frameworks/UI libs such as React, you can't use the ref here.

Optional inputClasses

inputClasses: string | string[]

Class to add to the input when it's generated by the library.

Optional language

language: string | (() => string)

Return results in a specific language using BCP47 standard (e.g 'en', 'fr', 'de', ...). By default, we use HTTP Header set by the browser and English when not present. Language can be static or dynamic with the function.

Optional layers

layers: string | string[] | (() => string) | (() => string[])

Filter the kind of place you want to find. Layers can be static or dynamic with the function.

Optional marker

Option to configure result markers on the map.

Optional minLength

minLength: number

Set the minimum number of characters to trigger a geocoding request. If you press Enter the search will be validated even if the length is not reached. This option work only when searchOnTyping=true. Default value is 0.

Optional noResultsMessage

noResultsMessage: string | false

Set a custom message when no results are found. This can be disabled.

Optional placeholder

placeholder: string

Placeholder text to add when the input in generated by the library.

Optional position

position: "topleft" | "topright" | "bottomleft" | "bottomright"

Position of the input on the map.

Optional resultContainer

resultContainer: string | HTMLElement

The custom <div> that will contain the geocoding results. By default the container is created by Jawg Places JS. With some frameworks/UI libs such as React, you can't use the ref here.

Optional reverse

Option to activate reverse geocoding withing the input. You can paste coordinates in the form {lat}/{lon} in the input. The separation can be either / (slash), , (comma) or (space).

Optional searchOnTyping

searchOnTyping: boolean

Set this to true to activate search on typing, this will also use autocomplete search. Default value is false, you will need to press Enter to validate your search.

Optional showResultIcons

showResultIcons: boolean

Show icon at the left each results.

Optional size

size: number

Set the default number of results. Default value is 10.

Optional sources

sources: string | string[] | (() => string[]) | (() => string)

Filter the originating source of the data. Sources can be static or dynamic with the function.

Optional transition

Option to configure transition on result selection.

Methods

Optional onClear

  • onClear(): void

Optional onClick

Optional onClose

  • onClose(): void

Optional onError

  • onError(error: any): void

Optional onFeatures

  • onFeatures(features: Feature[]): void

Generated using TypeDoc