diff --git a/example/lib/animated_route_example.dart b/example/lib/animated_route_example.dart index f973b29d..f285304b 100644 --- a/example/lib/animated_route_example.dart +++ b/example/lib/animated_route_example.dart @@ -61,6 +61,7 @@ class AnimatedRouteExampleState extends State setLocationComponent(); refreshTrackLocation(); refreshCarAnnotations(); + mapboxMap.style.setStyleImportConfigProperty("basemap", "theme", "monochrome"); } @override @@ -102,7 +103,7 @@ class AnimatedRouteExampleState extends State body: MapWidget( key: const ValueKey("mapWidget"), cameraOptions: CameraOptions(zoom: 3.0), - styleUri: MapboxStyles.LIGHT, + styleUri: MapboxStyles.STANDARD, textureView: true, onMapCreated: _onMapCreated, onStyleLoadedListener: _onStyleLoadedCallback, diff --git a/example/lib/full_map_example.dart b/example/lib/full_map_example.dart index a09176fa..099b6137 100644 --- a/example/lib/full_map_example.dart +++ b/example/lib/full_map_example.dart @@ -20,7 +20,7 @@ class FullMapExampleState extends State { _onMapCreated(MapboxMap mapboxMap) { this.mapboxMap = mapboxMap; - mapboxMap.style; + mapboxMap.style.setStyleImportConfigProperty("basemap", "theme", "monochrome"); } _onStyleLoadedCallback(StyleLoadedEventData data) { @@ -99,9 +99,9 @@ class FullMapExampleState extends State { () => isLight = !isLight, ); if (isLight) { - mapboxMap?.loadStyleURI(MapboxStyles.LIGHT); + mapboxMap?.style.setStyleImportConfigProperty("basemap", "lightPreset", "day"); } else { - mapboxMap?.loadStyleURI(MapboxStyles.DARK); + mapboxMap?.style.setStyleImportConfigProperty("basemap", "lightPreset", "night"); } }), SizedBox(height: 10), @@ -117,7 +117,7 @@ class FullMapExampleState extends State { 43.70908256335716, )), zoom: 3.0), - styleUri: MapboxStyles.LIGHT, + styleUri: MapboxStyles.STANDARD, textureView: true, onMapCreated: _onMapCreated, onStyleLoadedListener: _onStyleLoadedCallback, diff --git a/example/lib/geojson_line_example.dart b/example/lib/geojson_line_example.dart index 8155befc..faa24905 100644 --- a/example/lib/geojson_line_example.dart +++ b/example/lib/geojson_line_example.dart @@ -58,7 +58,7 @@ class DrawGeoJsonLineExampleState extends State { return new Scaffold( body: MapWidget( key: ValueKey("mapWidget"), - styleUri: MapboxStyles.MAPBOX_STREETS, + styleUri: MapboxStyles.STANDARD, cameraOptions: CameraOptions( center: Point(coordinates: Position(-122.486052, 37.830348)), zoom: 14.0), diff --git a/example/lib/image_source_example.dart b/example/lib/image_source_example.dart index 345592f2..d67382fa 100644 --- a/example/lib/image_source_example.dart +++ b/example/lib/image_source_example.dart @@ -20,10 +20,11 @@ class ImageSourceExample extends StatefulWidget implements Example { class ImageSourceExampleState extends State { MapboxMap? mapboxMap; - var isLight = true; _onMapCreated(MapboxMap mapboxMap) async { this.mapboxMap = mapboxMap; + mapboxMap.style.setStyleImportConfigProperty("basemap", "lightPreset", "night"); + mapboxMap.style.setStyleImportConfigProperty("basemap", "theme", "monochrome"); } _onStyleLoaded(StyleLoadedEventData data) async { @@ -37,6 +38,9 @@ class ImageSourceExampleState extends State { await mapboxMap?.style.addLayer(RasterLayer( id: "image_layer-id", sourceId: "image_source-id", + // `LightPreset`s are applied to all layers of the map. + // As `night` is applied we need to set `rasterEmissiveStrength` to color the image + rasterEmissiveStrength: 1.0, )); var imageSource = await mapboxMap?.style.getSource("image_source-id") as ImageSource; @@ -50,7 +54,7 @@ class ImageSourceExampleState extends State { return new Scaffold( body: MapWidget( key: ValueKey("mapWidget"), - styleUri: MapboxStyles.DARK, + styleUri: MapboxStyles.STANDARD, cameraOptions: CameraOptions( center: Point(coordinates: Position(-80.1263, 25.7845)), zoom: 12.0), onMapCreated: _onMapCreated, diff --git a/example/lib/offline_map_example.dart b/example/lib/offline_map_example.dart index 7500752b..bf7f9afc 100644 --- a/example/lib/offline_map_example.dart +++ b/example/lib/offline_map_example.dart @@ -55,7 +55,7 @@ class OfflineMapExampleState extends State { // Note this will not remove the downloaded style pack, instead, it will // just mark the resources as not a part of the existing style pack. The // resources still exists in the disk cache. - await _offlineManager?.removeStylePack(MapboxStyles.SATELLITE_STREETS); + await _offlineManager?.removeStylePack(MapboxStyles.STANDARD_SATELLITE); } _downloadStylePack() async { @@ -65,7 +65,7 @@ class OfflineMapExampleState extends State { metadata: {"tag": "test"}, acceptExpired: false); _offlineManager?.loadStylePack( - MapboxStyles.SATELLITE_STREETS, stylePackLoadOptions, (progress) { + MapboxStyles.STANDARD_SATELLITE, stylePackLoadOptions, (progress) { final percentage = progress.completedResourceCount / progress.requiredResourceCount; if (!_stylePackProgress.isClosed) { @@ -84,7 +84,7 @@ class OfflineMapExampleState extends State { // If you are using a raster tileset you may need to set a different pixelRatio. // The default is UIScreen.main.scale on iOS and displayMetrics's density on Android. TilesetDescriptorOptions( - styleURI: MapboxStyles.SATELLITE_STREETS, minZoom: 0, maxZoom: 16) + styleURI: MapboxStyles.STANDARD_SATELLITE, minZoom: 0, maxZoom: 16) ], acceptExpired: true, networkRestriction: NetworkRestriction.NONE); @@ -129,7 +129,7 @@ class OfflineMapExampleState extends State { if (snapshot.hasData) { return MapWidget( key: ValueKey("mapWidget"), - styleUri: MapboxStyles.SATELLITE_STREETS, + styleUri: MapboxStyles.STANDARD_SATELLITE, cameraOptions: CameraOptions(center: City.helsinki, zoom: 12.0), ); diff --git a/example/lib/snapshotter_example.dart b/example/lib/snapshotter_example.dart index 6f79afbe..785c7149 100644 --- a/example/lib/snapshotter_example.dart +++ b/example/lib/snapshotter_example.dart @@ -39,7 +39,9 @@ class SnapshotterExampleState extends State { size: Size(width: 400, height: 400), pixelRatio: MediaQuery.of(context).devicePixelRatio), ); - await _snapshotter?.style.setStyleURI(MapboxStyles.OUTDOORS); + await _snapshotter?.style.setStyleURI(MapboxStyles.STANDARD); + await _snapshotter?.style.setStyleImportConfigProperty("basemap", "theme", "faded"); + await _snapshotter?.style.setStyleImportConfigProperty("basemap", "lightPreset", "night"); } _onMapIdle(MapIdleEventData data) async { diff --git a/example/lib/vector_tile_source_example.dart b/example/lib/vector_tile_source_example.dart index c0be7a3d..19b3c355 100644 --- a/example/lib/vector_tile_source_example.dart +++ b/example/lib/vector_tile_source_example.dart @@ -20,12 +20,14 @@ class VectorTileSourceExampleState extends State { _onMapCreated(MapboxMap mapboxMap) async { this.mapboxMap = mapboxMap; + mapboxMap.style.setStyleImportConfigProperty("basemap", "lightPreset", "day"); + mapboxMap.style.setStyleImportConfigProperty("basemap", "theme", "monochrome"); } _onStyleLoadedCallback(StyleLoadedEventData data) async { await mapboxMap?.style.addSource(VectorSource( id: "terrain-data", url: "mapbox://mapbox.mapbox-terrain-v2")); - await mapboxMap?.style.addLayerAt( + await mapboxMap?.style.addLayer( LineLayer( id: "terrain-data", sourceId: "terrain-data", @@ -33,8 +35,7 @@ class VectorTileSourceExampleState extends State { lineJoin: LineJoin.ROUND, lineCap: LineCap.ROUND, lineColor: Colors.red.value, - lineWidth: 1.9), - LayerPosition(above: "country-label")); + lineWidth: 1.9)); } @override @@ -42,7 +43,7 @@ class VectorTileSourceExampleState extends State { return new Scaffold( body: MapWidget( key: ValueKey("mapWidget"), - styleUri: MapboxStyles.LIGHT, + styleUri: MapboxStyles.STANDARD, cameraOptions: CameraOptions( center: Point(coordinates: Position(-122.447303, 37.753574)), zoom: 13.0),