react-native-mapbox-gl icon indicating copy to clipboard operation
react-native-mapbox-gl copied to clipboard

ShapeSource images doesn't seems to update after the creation

Open KevinHu2014 opened this issue 6 years ago • 8 comments

By using shapesource and symbol layer to dynamically load markers with remote image icons (an http url). Things works fine for the initialize shapesource with an icon object. (with the format : { uri : 'http...'} in iconImages object) But when adding dynamically. The icons doesn't appear on the map. Seems like it's not updating after the creation. Any ideas?

KevinHu2014 avatar May 19 '18 04:05 KevinHu2014

Here is an example app and trying to reproduce it https://github.com/KevinHu2014/testMapbox

KevinHu2014 avatar May 19 '18 04:05 KevinHu2014

@nitaliano Any update on this ?
Thanks.

KevinHu2014 avatar Jun 19 '18 14:06 KevinHu2014

I just tried using the same code as you and don't see any issue. Do you still have the issue ? I'm using @mapbox/react-native-mapbox-gl 6.1.0

Gp2mv3 avatar Jul 05 '18 12:07 Gp2mv3

@Gp2mv3 Yes , I still encounter the issue. I still can't dynamically update the markers. Is it possible to share your code ?

KevinHu2014 avatar Jul 08 '18 22:07 KevinHu2014

Same issue. Any solutions? @KevinHu2014 😣

yqz0203 avatar Sep 05 '18 01:09 yqz0203

@KevinHu2014 I try to add key property on the ShapeSource component, then increase it while the shape or images updates, it works.

But i think it's a hack way, is there an official solution?

yqz0203 avatar Sep 05 '18 02:09 yqz0203

@KevinHu2014 I try to add key property on the ShapeSource component, then increase it while the shape or images updates, it works.

But i think it's a hack way, is there an official solution?

I'm facing the same issue and your method works for me. Seems to be hacky but at least it works for now. I think this is a limitation and has got to do with the library itself.

seeya avatar Oct 23 '18 09:10 seeya

@KevinHu2014 I try to add key property on the ShapeSource component, then increase it while the shape or images updates, it works.

But i think it's a hack way, is there an official solution?

@yqz0203 I tried with the key update on ShapeSource but it won't work either, the only way I found until now is to put a key on the MapView, but it is really a bad user experience because the whole map reloads... can you share your working piece of code ?

arnaudambro avatar Jul 22 '19 15:07 arnaudambro