ShapeSource and SymbolLayer as PointAnnotation.
See original GitHub issueProblem: As the docs say PointAnnotation is deprecated and shouldn’t be used so I’m trying to switch to ShapeLayer and SymbolLayer. What I’m trying to do is something like this: And the number should change dynamically, according to props. Any tips? I managed to make the chat icon appear but I have no idea how to add the number. What I have so far:
const feature = {
type: 'Feature',
id: marker.id,
geometry: {
type: 'Point',
coordinates: [marker.lat, marker.lng],
},
};
return (
<MapboxGL.MapView style={sheet.matchParent}>
<MapboxGL.Camera
zoomLevel={17}
centerCoordinate={[loc.lat, loc.lng]}
/>
<MapboxGL.ShapeSource
id="exampleShapeSource"
shape={feature}
>
<MapboxGL.SymbolLayer id={markerOne + 1} style={{ iconImage: image, iconSize: 1 }} />
</MapboxGL.ShapeSource>
</MapboxGL.MapView>);
Thanks in advance.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:24 (6 by maintainers)
Top Results From Across the Web
ShapeSource and SymbolLayer as PointAnnotation. #266
Problem: As the docs say PointAnnotation is deprecated and shouldn't be used so I'm trying to switch to ShapeLayer and SymbolLayer.
Read more >rnmapbox/Lobby - Gitter
@mertozylmz I found that Annotation is a wrapper for a symbol layer tha accepts coordinates, ... But I think ShapeSource better than PointAnnotation....
Read more >Can not able to customise Pin(Marker) and it's info window in ...
ShapeSource Result:- Nothing display. MapboxGL.PointAnnotation with Image view Result:- Display Pin but only work local image. MapboxGL.
Read more >react native mapbox dynamically added PointAnnotations are ...
[Solved]-react native mapbox dynamically added PointAnnotations are misplaced-React Native ... ShapeSource shape={makeMapBoxGeoJson(props.datum, props.
Read more >MapxusSdk.MapxusPointAnnotationView
Prop Type Default Required
buildingId string none false
floor string none false
id string none true
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here is full example we can include to repository.
Usage looks like this - count is updated on icon press
@arnaudambro @tomasamado97
Are there any docs or examples for adding custom component children (Views) to SymbolLayers? This is a revelation for me but I can’t get it working (maybe because of the same Android issue…)