ReplaceFeature issue with custom prefab
Hi there, I have a problem with the prefab modifier of some buildings, I was able to correctly change a custom building added in mapbox studio with a custom prefab. I followed the ReplaceFeatures example and now I can correctly change what I want.
The only issue is that when I change zoom or pan the map, since the tiles gets repositioned, I sometime lose my prefab, it's not visible anymore even when going down to ground level with the zoom so it's not related to the zoom being too low.
To be able to see my prefab again I have to reinitialize the mapVisualizer and tileProvider but I can't do these operations every time I pan or zoom, is there something I'm missing?
Unity 2018.1.5f1 Mapbox v1.4.5
@AzeExMachina stability issues with replace feature modifier is something we're looking into. Meanwhile I can suggest trying something slightly different. If I understand correct, you just want to spawn a building prefab at a certain location.
So it might be an easier option to create it as a point in Mapbox Studio, then create a new Points feature layer in the SDK. Then you can add a prefab modifier into game object modifiers list (which will put prefabs at given points) like this; (data layer will be your layer of course, not poi_label as seen in image)

Now if you double click that PrefabModifier field, you'll get settings for it;

I believe this might be more reliable solution in your case.
@brnkhy Thanks for your suggestion, this is in fact more reliable and it seems I'm not incurring in strange issues related to the prefabs.
I have another question which is not an issue but it's related to this. If I understand correctly the prefab modifier simply replaces all the points in my dataset with the given prefab. So, if I want different prefabs for each point with just one dataset, should I create a new feature for each one, filtering out the others?
Thanks for your help!
@AzeExMachina That's the way that I would approach. I'd create a feature for each point that used another prefab. There might be some more elegant or performant solutions with custom modifiers, but this is a straight forward way to do it.
@AzeExMachina I think it depends on some details and usecase.
Creating a new feature layer might get annoying if you're planning to have too many different types.
i.e. if you're planning to have 3 types (prefabs) and 20+ entries for each, having a separate layer would make sense
if you're planning to have 20+ types and just 1-2 of each, I think creating a custom gameobject modifier with a Dictionary<string, GameObject> (so you'll keep type&prefab tuples) and creating them all in one layer would be easier.
Great, in the end I was able to address both of those issue and now I'm not experiencing any problem in my use of the SDK. Thanks for your support!