diff --git a/CHANGELOG.md b/CHANGELOG.md index b665e8841..4efcabec2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,10 @@ ### Breaking changes -* All Dart enums have been migrated from mixed cases to lower camelcase +* All Dart enums have been migrated from mixed cases to lower camelcase according to the `camel_case_types` lint rule. +* Move `MaplibreStyles` to the main `maplibre_gl` package. You can now use the + demo style without adding `maplibre_gl_platform_interface` as a dependency. * Updated maplibre-native for ios to v6.4.2. This introduces the new iOS Metal renderer and the OpenGL ES renderer now uses OpenGL ES 3.0. Only iOS Devices with an Apple A7 GPU or later are supported onwards. See the diff --git a/example/lib/map_ui.dart b/example/lib/map_ui.dart index 3d8686543..cfabc6ec4 100644 --- a/example/lib/map_ui.dart +++ b/example/lib/map_ui.dart @@ -50,10 +50,7 @@ class MapUiBodyState extends State { // Style string can a reference to a local or remote resources. // On Android the raw JSON can also be passed via a styleString, on iOS this is not supported. - final List _styleStrings = [ - "https://demotiles.maplibre.org/style.json", - "assets/style.json" - ]; + final List _styleStrings = [MaplibreStyles.demo, "assets/style.json"]; final List _styleStringLabels = [ "Maplibre demo style", "Local style file" diff --git a/example/lib/offline_regions.dart b/example/lib/offline_regions.dart index 772a68e71..b9e4573e0 100644 --- a/example/lib/offline_regions.dart +++ b/example/lib/offline_regions.dart @@ -25,19 +25,19 @@ final List regionDefinitions = [ bounds: hawaiiBounds, minZoom: 3.0, maxZoom: 8.0, - mapStyleUrl: "https://demotiles.maplibre.org/style.json", + mapStyleUrl: MaplibreStyles.demo, ), OfflineRegionDefinition( bounds: santiagoBounds, minZoom: 10.0, maxZoom: 16.0, - mapStyleUrl: "https://demotiles.maplibre.org/style.json", + mapStyleUrl: MaplibreStyles.demo, ), OfflineRegionDefinition( bounds: aucklandBounds, minZoom: 13.0, maxZoom: 16.0, - mapStyleUrl: "https://demotiles.maplibre.org/style.json", + mapStyleUrl: MaplibreStyles.demo, ), ]; diff --git a/example/lib/sources.dart b/example/lib/sources.dart index 10aa3b2f7..e2538d4dd 100644 --- a/example/lib/sources.dart +++ b/example/lib/sources.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; import 'package:maplibre_gl/maplibre_gl.dart'; import 'page.dart'; -import 'package:maplibre_gl_platform_interface/maplibre_gl_platform_interface.dart'; class StyleInfo { final String name; @@ -104,7 +103,7 @@ class FullMapState extends State { await controller.addSource( "terrain", const VectorSourceProperties( - url: "https://demotiles.maplibre.org/tiles/tiles.json", + url: MaplibreStyles.demo, )); await controller.addLayer( diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 0d15783b4..00bd849e1 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -14,7 +14,6 @@ dependencies: sdk: flutter maplibre_gl: ^0.19.0 - maplibre_gl_platform_interface: ^0.19.0 location: ^5.0.3 path_provider: ^2.0.15 http: ^1.1.0 diff --git a/lib/maplibre_gl.dart b/lib/maplibre_gl.dart index fe0a7748d..63c1de339 100644 --- a/lib/maplibre_gl.dart +++ b/lib/maplibre_gl.dart @@ -101,3 +101,5 @@ part 'src/color_tools.dart'; part 'src/annotation_manager.dart'; part 'src/util.dart'; + +part 'src/maplibre_styles.dart'; diff --git a/lib/src/maplibre_map.dart b/lib/src/maplibre_map.dart index d4495bccf..dfa3bf96b 100644 --- a/lib/src/maplibre_map.dart +++ b/lib/src/maplibre_map.dart @@ -14,7 +14,7 @@ class MaplibreMap extends StatefulWidget { const MaplibreMap({ super.key, required this.initialCameraPosition, - this.styleString = "https://demotiles.maplibre.org/style.json", + this.styleString = MaplibreStyles.demo, this.onMapCreated, this.onStyleLoadedCallback, this.gestureRecognizers, diff --git a/lib/src/maplibre_styles.dart b/lib/src/maplibre_styles.dart new file mode 100644 index 000000000..950058fba --- /dev/null +++ b/lib/src/maplibre_styles.dart @@ -0,0 +1,8 @@ +part of '../maplibre_gl.dart'; + +/// MapLibre styles used mostly for demonstration. +abstract class MaplibreStyles { + /// A very simple MapLibre demo style that shows only countries with their + /// boundaries. + static const String demo = "https://demotiles.maplibre.org/style.json"; +} diff --git a/maplibre_gl_platform_interface/lib/src/ui.dart b/maplibre_gl_platform_interface/lib/src/ui.dart index ce7f10586..81d0e0691 100644 --- a/maplibre_gl_platform_interface/lib/src/ui.dart +++ b/maplibre_gl_platform_interface/lib/src/ui.dart @@ -4,11 +4,6 @@ part of '../maplibre_gl_platform_interface.dart'; -class MaplibreStyles { - /// A very simple MapLibre demo style - static const String demo = "https://demotiles.maplibre.org/style.json"; -} - /// The camera mode, which determines how the map camera will track the rendered location. enum MyLocationTrackingMode { none,