Polygon class

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

Constructors

Polygon(List latlngs, [PolylineOptions? options])
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addEventParent(Evented obj) Evented
Adds an event parent - an Evented that will receive propagated events
inherited
addLatLng(LatLng latlng) Polyline
Adds a given point to the polyline. By default, adds to the first ring of the polyline in case of a multi-polyline, can be overridden by passing a specific ring as a LatLng array (that you can earlier access with getLatLngs
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
bringToBack() Path
Brings the layer to the bottom of all path layers.
inherited
bringToFront() Path
Brings the layer to the top of all path layers.
inherited
closePopup() Layer
Closes the popup bound to this layer if it is open.
inherited
closestLayerPoint(Point p) Point
Returns the point closest to p on the Polyline.
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
getBounds() LatLngBounds
Returns the LatLngBounds of the path.
inherited
getCenter() LatLng
Returns the center (centroid) of the polyline.
inherited
getLatLngs() List<LatLng>
Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.
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
isEmpty() bool
Returns true if the Polyline has no LatLngs.
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
redraw() Path
Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.
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
setLatLngs(List latlngs) Polyline
Replaces all the points in the polyline with the given array of geographical points.
inherited
setPopupContent(Popup content) Layer
Sets the content of the popup bound to this layer.
inherited
setStyle(PathOptions stle) Path
Changes the appearance of a Path based on the options in the Path options object.
inherited
setTooltipContent(String content) Layer
Sets the content of the tooltip bound to this layer.
inherited
toGeoJSON([double? precision]) GeoJson
precision is the number of decimal places for coordinates The default value is 6 places. Returns a GeoJSON representation of the polyline (as a GeoJSON LineString or MultiLineString Feature).
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