Prevent exception SymbolLocationLayerRenderer with new style (#3369)
This commit is contained in:
@@ -319,6 +319,11 @@ final class SymbolLocationLayerRenderer implements LocationLayerRenderer {
|
||||
}
|
||||
|
||||
private void refreshSource() {
|
||||
// prevents exception when other style has been set with an update in flight
|
||||
// https://github.com/maplibre/maplibre-native/issues/3348
|
||||
if (!style.isFullyLoaded()) {
|
||||
return;
|
||||
}
|
||||
GeoJsonSource source = style.getSourceAs(LOCATION_SOURCE);
|
||||
if (source != null) {
|
||||
locationSource.setGeoJson(locationFeature);
|
||||
|
||||
@@ -966,6 +966,7 @@ class LocationLayerControllerTest {
|
||||
val locationSource = Mockito.mock(GeoJsonSource::class.java)
|
||||
Mockito.`when`<Any?>(style.getSourceAs(LocationComponentConstants.LOCATION_SOURCE))
|
||||
.thenReturn(locationSource)
|
||||
Mockito.`when`(style.isFullyLoaded).thenReturn(true)
|
||||
val sourceProvider = buildLayerProvider()
|
||||
Mockito.`when`(
|
||||
sourceProvider.generateSource(
|
||||
|
||||
Reference in New Issue
Block a user