Open perruche opened 3 years ago
Add a section on the documentation on "how to load a custom marker image for the StoreLocator component"
Add the important details:
icon-size
icon-image
addImage
Code:
<template> <store-locator :items="items" :mapbox-cluster="{ 'unclustered-point-layer-type': 'circle', 'unclustered-point-layer-type': 'symbol', 'unclustered-point-layout': { 'icon-image': 'pin', 'icon-size': 1 }, 'unclustered-point-paint': {}, }" access-token="..." :mapbox-map="{ mapStyle: '...', center: [ 2.0, 48.0 ], zoom: 1, }" @map-created="onMapCreated"> <!-- template --> </store-locator> </template> <script> export default { props: { items: { type: Array, required: true, }, }, methods: { onMapCreated(map) { const imgPath = 'imag.png'; map.loadImage(imagePath, (error, image) => { if (error) { throw error; } map.addImage('pin', image); }); }, }, }; </script>
Please add this to the docs! We thought it wasn't supported until we saw this issue!
Add a section on the documentation on "how to load a custom marker image for the StoreLocator component"
Add the important details:
icon-size
param if you load a png in size 2x or 3xicon-image
param must use the same name as inaddImage
fnCode: