React-native-mapbox-gl: ShapeSource images doesn't seems to update after the creation

Created on 19 May 2018  路  8Comments  路  Source: nitaliano/react-native-mapbox-gl

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?

Most helpful comment

@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?

All 8 comments

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

@nitaliano
Any update on this ?
Thanks.

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 Yes , I still encounter the issue. I still can't dynamically update the markers. Is it possible to share your code ?

Same issue. Any solutions? @KevinHu2014 馃槪

@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?

@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.

@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 ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lucasbento picture lucasbento  路  3Comments

Gp2mv3 picture Gp2mv3  路  3Comments

digitaldavenyc picture digitaldavenyc  路  4Comments

EugenePisotsky picture EugenePisotsky  路  4Comments

lernerbot picture lernerbot  路  3Comments