Skip to content

Commit

Permalink
Merge branch 'main' into feature/android-maplibre-11
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed Jun 3, 2024
2 parents 9202acf + 074bd50 commit 08da679
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 17 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions example/lib/map_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ class MapUiBodyState extends State<MapUiBody> {

// 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<String> _styleStrings = [
"https://demotiles.maplibre.org/style.json",
"assets/style.json"
];
final List<String> _styleStrings = [MaplibreStyles.demo, "assets/style.json"];
final List<String> _styleStringLabels = [
"Maplibre demo style",
"Local style file"
Expand Down
6 changes: 3 additions & 3 deletions example/lib/offline_regions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ final List<OfflineRegionDefinition> 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,
),
];

Expand Down
3 changes: 1 addition & 2 deletions example/lib/sources.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -104,7 +103,7 @@ class FullMapState extends State<FullMap> {
await controller.addSource(
"terrain",
const VectorSourceProperties(
url: "https://demotiles.maplibre.org/tiles/tiles.json",
url: MaplibreStyles.demo,
));

await controller.addLayer(
Expand Down
1 change: 0 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/maplibre_gl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,5 @@ part 'src/color_tools.dart';
part 'src/annotation_manager.dart';

part 'src/util.dart';

part 'src/maplibre_styles.dart';
2 changes: 1 addition & 1 deletion lib/src/maplibre_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions lib/src/maplibre_styles.dart
Original file line number Diff line number Diff line change
@@ -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";
}
5 changes: 0 additions & 5 deletions maplibre_gl_platform_interface/lib/src/ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 08da679

Please sign in to comment.