ShapeSource onpress call 2 times
See original GitHub issueDescribe the bug The onpress function of ShapeSource is called 2 times
To Reproduce
async function onPress(e, coleta, setDados) {
console.log(11);
}
function Point({
features, coleta, setDados
}) {
return (
<MapboxGL.ShapeSource
cluster
clusterRadius={35}
clusterMaxZoom={14}
id="postes"
shape={{ type: 'FeatureCollection', features }}
onPress={e => console.log(11)}
>
<MapboxGL.SymbolLayer
id="pointCount"
style={styles.clusterCount}
/>
Screenshots
Versions (please complete the following information):
- Platfrom: [Android]
- SDK Version [28]
- React Native Version [0.59.5]
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (12 by maintainers)
Top Results From Across the Web
ShapeSource onpress call 2 times · Issue #97 · rnmapbox/maps
Describe the bug The onpress function of ShapeSource is called 2 times To Reproduce async function onPress(e, coleta, ...
Read more >react native how to call multiple functions when onPress is ...
There are a few ways to achieve this. One option would be to define a function that calls functionOne and functionTwo , and...
Read more >rnmapbox/Lobby - Gitter
I'm trying to use rnmapbox/maps library with the latest React Native (0.70.x) and it doesn't seem to work. Is this expected/has anyone been...
Read more >How to update MapboxGL.ShapeSource dynamically?-Reactjs
To make it short : I wanted to use dynamics SVGs as SymbolLayer (so that I can change the colour for instance), but...
Read more >How do you center the map on a clicked symbol using MapBox and ...
Spent a long time trying to do this: Mapbox show how to do it here, ... I'm using ShapeSource and SymboLayer, getting my...
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
@mfazekas Thanks for pointing it out. Yes it was caused by the same problem, just added a commit to the PR that fixes the problem for these map related events.
Hmmm I’m trying to get a
ShapeSource
’sonPress
to work, but it’s not running the function at all! Any advice?Some important packages I’m using:
Platfrom: [Android] SDK Version [28]
I’ve been using very similar code to this example but including
onPress={(e) => console.log("shapesource press", e)}
prop in theShapeSource
component.I am not getting any errors or anything, and no console log messages either. Is anyone else running into a similar issue with the above packages?