mapbox-unity-sdk
mapbox-unity-sdk copied to clipboard
Switching TileProvider at runtime will cause NullReference for Transform or Camera Providers
We want to switch TileProvider at runtime which is generally working fine. But ....
- Configure RangeAroundCenter Provider intially via AbstractMap Editor GUI
- Switch to transformtileprovider or cameratileprovider at runtime via script WITHOUT setting any references in the gui editor before
CameraBoundsTileProviderOptions options = new CameraBoundsTileProviderOptions();
options.camera = MyCamera;
Map.SetExtent(MapExtentType.CameraBounds,options);
RangeAroundTransformTileProviderOptions options = new RangeAroundTransformTileProviderOptions();
options.SetOptions(MyTransform);
Map.SetExtent(MapExtentType.RangeAroundTransform,options);
this will result in a NullReferenceException based on an empty field for the camera/transform reference in the provideroptions. It seems like mapbox is switching the provider without taking respect to the passed options and try's to render the next map update already which results in crashing.
My workaround:
preconfigure the tileprovider in the editor with dummy transform/camera. The field is not empty so everything is fine until the new options will be set. But that should be fixed in the framework.
to
I think this is using performance
branch, right?
I believe only Camera Bounds
tile provider is working in that branch and others are broken at the moment. I might have fixed the errors in RangeAroundCenter
I guess but only that and it's probably not in the best shape.
I'll try to look into this soon but can't give an ETA at the moment I'm afraid.
It's still the case on performance branch but i discovered this issue already on the latest stable release.