MapComponent
A map widget that can show a pannable/zoomable map with markers
Installation
Properties
mapUrl
string
The url of the tile server that will serve up map tiles. This url should have the following placeholders in them: {x}
, {y}
and {z}
{z}
represents the current zoom level
staticImage
A static image to use instead of a map layout. If you are using a static image, specify mapUrl
as an empty string. The static image consists of a url for the image and a width and height of the image. Note that the width and height values be relative - just that the ratio should be accurate.
center
{ position: IMarker, renderMarker?: boolean }
Where the map is centered.
markers
IMarker[]
A list of markers to render. Each marker has a latitude
longitude
and data
field. The data
field can store arbitrary data.
onMarkerClick
(el: any, data: any) => void
This handler gets called whenever a marker is clicked on. The first parameter represents the marker element that was clicked on. The second parameter represents the data associated with the marker
regions
IRegion[]
regions to show on map
onRegionClick
(event: any, data: any) => void
this handler will get called when a region is clicked
heatmap
If you want to overlay a heatmap - assign this object with some valid value
zoom
number
The default zoom level to show on the map
maxZoom
number
max zoom level. optional. default is 19
minZoom
number
min zoom level. optional. default is -19
zoomOnScroll
boolean
zoom on scroll default is false
onClick
(event: LeafletMouseEvent) => void
this handler will get called when the map is clicked
onZoomEnd
(event: LeafletEvent) => void
onDragEnd
(event: DragEndEvent) => void
mapUrl
The url of the tile server that will serve up map tiles. This url should have the following placeholders in them: {x}
, {y}
and {z}
{z}
represents the current zoom level
string
staticImage
A static image to use instead of a map layout. If you are using a static image, specify mapUrl
as an empty string.
The static image consists of a url for the image and a width and height of the image. Note that the width and height values be relative - just that the ratio should be accurate.
center
Where the map is centered.
{ position: IMarker, renderMarker?: boolean }
markers
A list of markers to render. Each marker has a latitude
longitude
and data
field. The data
field can store arbitrary data.
IMarker[]
onMarkerClick
This handler gets called whenever a marker is clicked on. The first parameter represents the marker element that was clicked on. The second parameter represents the data associated with the marker
(el: any, data: any) => void
regions
regions to show on map
IRegion[]
onRegionClick
this handler will get called when a region is clicked
(event: any, data: any) => void
heatmap
If you want to overlay a heatmap - assign this object with some valid value
zoom
The default zoom level to show on the map
number
maxZoom
max zoom level. optional. default is 19
number
minZoom
min zoom level. optional. default is -19
number
zoomOnScroll
zoom on scroll default is false
boolean
onClick
this handler will get called when the map is clicked
(event: LeafletMouseEvent) => void
onZoomEnd
(event: LeafletEvent) => void
onDragEnd
(event: DragEndEvent) => void
Last updated