GeoJson class

Inheritance
Annotations
  • @JS('L.geoJSON')

Constructors

GeoJson([dynamic geojson, GeoJsonOptions? options])

Properties

geojson ↔ dynamic
Optional object in GeoJSON format to display on the map.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
options GeoJsonOptions
GeoJson options.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addData(dynamic data) GeoJson
Methods
addEventParent(Evented obj) Evented
Adds an event parent - an Evented that will receive propagated events
inherited
addTo(LeafletMap map) Layer
Adds the layer to the given map or layer group.
inherited
beforeAdd(LeafletMap map) Layer
Optional method. Called on map.addLayer(layer), before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.
inherited
bindPopup(Popup content) Layer
Binds a popup to the layer with the passed content and sets up the necessary event listeners. If a Function is passed it will receive the layer as the first argument and should return a String or HTMLElement
inherited
bindTooltip(String content, [TooltipOptions? options]) Tooltip
Binds a tooltip to the layer with the passed content and sets up the options>options?) necessary event listeners. If a Function is passed it will receive the layer as the first argument and should return a String or HTMLElement.
inherited
closePopup() Layer
Closes the popup bound to this layer if it is open.
inherited
closeTooltip() Layer
Closes the tooltip bound to this layer if it is open.
inherited
fire(String type, [dynamic data, bool? propagate]) Evented
Fires an event of the specified type. You can optionally provide an data object — the first argument of the listener function will contain its properties. The event can optionally be propagated to event parents.
inherited
getAttribution() String
Used by the attribution control, returns the attribution option.
inherited
getPane([String? name]) Element
Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer
inherited
getPopup() Popup
Returns the popup bound to this layer.
inherited
getTooltip() Tooltip
Returns the tooltip bound to this layer.
inherited
isPopupOpen() bool
Returns true if the popup bound to this layer is currently open.
inherited
isTooltipOpen() bool
Returns true if the tooltip bound to this layer is currently open.
inherited
listens(String type) bool
Returns true if a particular event type has any listeners attached to it.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
off(String type, [Function? fn, dynamic context]) Evented
Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
inherited
on(String type, Function fn, [dynamic context]) Evented
Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
inherited
onAdd(LeafletMap map) Layer
Should contain code that creates DOM elements for the layer, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer).
inherited
once(String type, Function fn, [dynamic context]) Evented
Behaves as on(…), except the listener will only get fired once and then removed.
inherited
onRemove(LeafletMap map) Layer
Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).
inherited
openPopup([LatLng? latlng]) Layer
Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.
inherited
openTooltip([LatLng? latlng]) Layer
Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
inherited
remove() Layer
Removes the layer from the map it is currently active on.
inherited
removeEventParent(Evented obj) Evented
Removes an event parent, so it will stop receiving propagated events
inherited
removeFrom(LeafletMap map) Layer
Removes the layer from the given map
inherited
resetStyle([Layer? layer]) GeoJson
Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events. If layer is omitted, the style of all features in the current layer is reset.
setPopupContent(Popup content) Layer
Sets the content of the popup bound to this layer.
inherited
setStyle(Function style) GeoJson
Changes styles of GeoJSON vector layers with the given style function.
setTooltipContent(String content) Layer
Sets the content of the tooltip bound to this layer.
inherited
togglePopup() Layer
Opens or closes the popup bound to this layer depending on its current state
inherited
toggleTooltip() Layer
Opens or closes the tooltip bound to this layer depending on its current state.
inherited
toString() String
A string representation of this object.
inherited
unbindPopup() Layer
Removes the popup previously bound with bindPopup.
inherited
unbindTooltip() Layer
Removes the tooltip previously bound with bindTooltip.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

asFeature(dynamic geojson) → dynamic
Normalize GeoJSON geometries/features into GeoJSON features.
coordsToLatLng(List coords) LatLng
Creates a LatLng object from an array of 2 numbers (longitude, latitude) or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
coordsToLatLngs(List coords, [int? levelsDeep, Function? coordsToLatLng]) List
Creates a multidimensional array of LatLngs from a GeoJSON coordinates array.
geometryToLayer(dynamic featureData, GeoJson options) Layer
Static methods
latLngsToCoords(List latlngs, [int? levelsDeep, bool closed = false]) List
Reverse of coordsToLatLngs.
latLngToCoords(LatLng latlng, num precision) List
Reverse of coordsToLatLng