fix: route WeatherColor opacity through typed API
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
This commit is contained in:
@@ -1176,6 +1176,17 @@ jni::jboolean NativeMapView::setStyleLayerFloatProperty(JNIEnv& env,
|
||||
return true;
|
||||
}
|
||||
|
||||
jni::jboolean NativeMapView::setWeatherColorOpacity(JNIEnv& env,
|
||||
const jni::String& layerId,
|
||||
const jni::jfloat opacity) {
|
||||
if (!std::isfinite(opacity)) return false;
|
||||
auto* layer = dynamic_cast<mbgl::style::WeatherColorLayer*>(
|
||||
map->getStyle().getLayer(jni::Make<std::string>(env, layerId)));
|
||||
if (!layer) return false;
|
||||
layer->setOpacity(opacity);
|
||||
return true;
|
||||
}
|
||||
|
||||
jni::jboolean NativeMapView::setStyleLayerVisibility(JNIEnv& env, const jni::String& layerId, const jni::jboolean visible) {
|
||||
auto* layer = map->getStyle().getLayer(jni::Make<std::string>(env, layerId));
|
||||
if (!layer) return false;
|
||||
@@ -1738,6 +1749,7 @@ void NativeMapView::registerNative(jni::JNIEnv& env) {
|
||||
METHOD(&NativeMapView::getLayer, "nativeGetLayer"),
|
||||
METHOD(&NativeMapView::hasStyleLayer, "nativeHasStyleLayer"),
|
||||
METHOD(&NativeMapView::setStyleLayerFloatProperty, "nativeSetStyleLayerFloatProperty"),
|
||||
METHOD(&NativeMapView::setWeatherColorOpacity, "nativeSetWeatherColorOpacity"),
|
||||
METHOD(&NativeMapView::setStyleLayerVisibility, "nativeSetStyleLayerVisibility"),
|
||||
METHOD(&NativeMapView::setRasterParticleColors, "nativeSetRasterParticleColors"),
|
||||
METHOD(&NativeMapView::setRasterParticleColor, "nativeSetRasterParticleColor"),
|
||||
|
||||
Reference in New Issue
Block a user