Skip to content

BaseMap

A component to display a Leaflet-map with multiple locations

Props

Prop nameDescriptionTypeValuesDefault
attributiondefine map attributionstring-'Source: <a href="https://openstreetmap.org/">OpenStreetMap contributors</a>'
attributionPositiondefine position of map attributionstringtopright, bottomleft, bottomright'bottomright'
centerMarkerset array index of marker to center map from outsidenumber-null
clusterSizesdefine number of items for cluster sizes
structure: { medium: 5, large: 20, xlarge: 100 }
Note: properties medium, large, xlarge are mandatory
object-{
medium: 5,
large: 20,
xlarge: 100
}
copyrightdefine map copyrightstring-'<a href=http://creativecommons.org/licenses/by-sa/3.0/>CC BY-SA 3.0</a>'
highlightMarkerset array index of marker to highlight it from outsidenumber-null
icondefine html code for a custom iconstring-'<svg viewBox="0 0 70.866 70.866" xmlns="http://www.w3.org/2000/svg"><path d="m35.433 0a22.731 22.731 0 0 0-22.731 22.82 24.125 24.125 0 0 0 1.872 9.1814l19.611 38.063a1.3718 1.3718 0 0 0 2.496 0l19.611-38.063a22.249 22.249 0 0 0 1.872-9.1814 22.731 22.731 0 0 0-22.731-22.82zm0 32.858a10.216 10.216 0 1 1 10.216-10.216 10.241 10.241 0 0 1-10.216 10.216z" fill="#010101"/></svg>'
iconSizedefine icon sizenumber-32
optionsdefine custom options for map data
e.g. {
style: 'normal',
subdomains: ['mapsneu'],
tileMatrixSet: 'google3857',
type: 'geolandbasemap'
}

usage custom keys in url property:
https://{s}.wien.gv.at/basemap/{type}/{style}/{tileMatrixSet}/{z}/{y}/{x}.png

for more information refer to the Leaflet TileLayer documentation
object-{}
markerdefine marker
structure: [{
coordinates: [16.382782, 48.208309],
latLng: [48.208309, 16.382782],
data: [ 'University of Applied Arts', 'Oskar Kokoschka-Platz 2',
'1010 Vienna', 'Austria']
}]
Note: either GeoJSON coordinates or latLng is mandatory
array-[]
markerPopupsshow popups for markerboolean-true
maxZoomdefine max zoom factornumber-18
urldefine url to tileLayer servicestring-''
tileLayerServicespecify service for the tileLayerstringWMTS, TMS, WMS''WMTS'
zoomdefine initial zoom factornumber-16

Events

Event namePropertiesDescription
highlightedundefined number - array index or nullEvent emitted on mouseenter, mouseleave of a map marker
mouseenter: index of the marker object in component property 'marker' array
mouseleave: null

Cluster colors might be set via following css variables:

--map-cluster-bg: rgba(103, 58, 183, .4);

--map-cluster-bg-inner: rgba(103, 58, 183, .85);

--map-cluster-bg-hover: rgba(176, 133, 245, .4);

--map-cluster-bg-inner-hover: rgba(176, 133, 245, .85);

Demo