-
I've been wrecking my brain with this for the past 3 hours. I just want to access the
If I change What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@NDobricic pls note that using an url as Pls use Images and onImageMissing. This is pseudo code, but somthing like this should work: const features = [
{
type: 'Feature',
id: 'a-feature',
properties: {
icon: 'V1REv35.jpeg',
},
geometry: {
type: 'Point',
coordinates: [45, 45],
},
}
]
const [images,setImages] = useState({});
...
<MapView>
<Images onImageMissing={(imageKey) => {
setImages({...images,imageKey: `https://i.imgur.com/${imageKey}`})
}} images={images} />
<ShapeSource id="markers" shape={{type: 'FeatureCollection', features}} >
<SymbolLayer
id="markerSymbols"
style={{
iconImage: ['get', 'icon'],
iconSize: 0.1
}}
/>
</ShapeSource>
</MapView>
|
Beta Was this translation helpful? Give feedback.
@NDobricic pls note that using an url as
iconImage
should be (deprecated in v10)[https://github.com/rnmapbox/maps/wiki/Deprecated-URLInIconImages].Pls use Images and onImageMissing.
This is pseudo code, but somthing like this should work: