setLayerProperties method

  1. @override
Future<void> setLayerProperties(
  1. String layerId,
  2. Map<String, dynamic> properties
)
override

Implementation

@override
Future<void> setLayerProperties(
    String layerId, Map<String, dynamic> properties) async {
  for (final entry in properties.entries) {
    // Very hacky: because we don't know if the property is a layout
    // or paint property, we try to set it as both.
    try {
      _map.setLayoutProperty(layerId, entry.key, entry.value);
    } catch (e) {
      print('Caught exception (usually safe to ignore): $e');
    }
    try {
      _map.setPaintProperty(layerId, entry.key, entry.value);
    } catch (e) {
      print('Caught exception (usually safe to ignore): $e');
    }
  }
}