diff --git a/android/build.gradle b/android/build.gradle
index 4dfbe73f9..e6b13d711 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -37,11 +37,12 @@ rootProject.allprojects {
apply plugin: 'com.android.library'
android {
- compileSdkVersion 28
+ compileSdkVersion 29
defaultConfig {
minSdkVersion 20
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ multiDexEnabled true
}
lintOptions {
disable 'InvalidPackage'
diff --git a/android/src/main/java/com/mapbox/mapboxgl/MapboxMapController.java b/android/src/main/java/com/mapbox/mapboxgl/MapboxMapController.java
index d8bcce666..62b3cbd75 100644
--- a/android/src/main/java/com/mapbox/mapboxgl/MapboxMapController.java
+++ b/android/src/main/java/com/mapbox/mapboxgl/MapboxMapController.java
@@ -37,6 +37,7 @@
import com.mapbox.mapboxsdk.Mapbox;
import com.mapbox.mapboxsdk.camera.CameraPosition;
import com.mapbox.mapboxsdk.camera.CameraUpdate;
+import com.mapbox.mapboxsdk.constants.MapboxConstants;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.geometry.LatLngBounds;
import com.mapbox.mapboxsdk.geometry.LatLngQuad;
@@ -1235,13 +1236,8 @@ public void setTiltGesturesEnabled(boolean tiltGesturesEnabled) {
@Override
public void setMinMaxZoomPreference(Float min, Float max) {
- //mapboxMap.resetMinMaxZoomPreference();
- if (min != null) {
- mapboxMap.setMinZoomPreference(min);
- }
- if (max != null) {
- mapboxMap.setMaxZoomPreference(max);
- }
+ mapboxMap.setMinZoomPreference(min != null ? min : MapboxConstants.MINIMUM_ZOOM);
+ mapboxMap.setMaxZoomPreference(max != null ? max : MapboxConstants.MAXIMUM_ZOOM);
}
@Override
diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle
index 0ab29be2d..6d6819d3d 100644
--- a/example/android/app/build.gradle
+++ b/example/android/app/build.gradle
@@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
- compileSdkVersion 28
+ compileSdkVersion 29
lintOptions {
disable 'InvalidPackage'
@@ -39,6 +39,7 @@ android {
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ multiDexEnabled true
}
buildTypes {
diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj
index f6dde2836..4de76e90b 100644
--- a/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -247,31 +247,21 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
- "${PODS_ROOT}/../Flutter/Flutter.framework",
"${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework",
- "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/Mapbox.framework.dSYM",
- "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/4794199C-B164-3A2D-A3B4-553B7D49EDD5.bcsymbolmap",
- "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/097AD13C-9FDA-310F-8B76-64CB67B06A27.bcsymbolmap",
- "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/491A77E9-7DBC-3309-A93C-BADAE0DDBC6E.bcsymbolmap",
- "${PODS_ROOT}/Mapbox-iOS-SDK/dynamic/3F114CA8-302D-327F-87C3-670E0EC63C9A.bcsymbolmap",
"${BUILT_PRODUCTS_DIR}/MapboxAnnotationExtension/MapboxAnnotationExtension.framework",
"${BUILT_PRODUCTS_DIR}/MapboxMobileEvents/MapboxMobileEvents.framework",
"${BUILT_PRODUCTS_DIR}/location/location.framework",
"${BUILT_PRODUCTS_DIR}/mapbox_gl/mapbox_gl.framework",
+ "${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mapbox.framework",
- "${DWARF_DSYM_FOLDER_PATH}/Mapbox.framework.dSYM",
- "${BUILT_PRODUCTS_DIR}/4794199C-B164-3A2D-A3B4-553B7D49EDD5.bcsymbolmap",
- "${BUILT_PRODUCTS_DIR}/097AD13C-9FDA-310F-8B76-64CB67B06A27.bcsymbolmap",
- "${BUILT_PRODUCTS_DIR}/491A77E9-7DBC-3309-A93C-BADAE0DDBC6E.bcsymbolmap",
- "${BUILT_PRODUCTS_DIR}/3F114CA8-302D-327F-87C3-670E0EC63C9A.bcsymbolmap",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxAnnotationExtension.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxMobileEvents.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/location.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/mapbox_gl.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
index 1d526a16e..919434a62 100644
--- a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -2,6 +2,6 @@
+ location = "self:">
diff --git a/example/lib/animate_camera.dart b/example/lib/animate_camera.dart
index e8e234118..36f6a9c41 100644
--- a/example/lib/animate_camera.dart
+++ b/example/lib/animate_camera.dart
@@ -25,7 +25,7 @@ class AnimateCamera extends StatefulWidget {
}
class AnimateCameraState extends State {
- MapboxMapController mapController;
+ late MapboxMapController mapController;
void _onMapCreated(MapboxMapController controller) {
mapController = controller;
diff --git a/example/lib/annotation_order_maps.dart b/example/lib/annotation_order_maps.dart
index 03263ad1d..d0f66e4ab 100644
--- a/example/lib/annotation_order_maps.dart
+++ b/example/lib/annotation_order_maps.dart
@@ -21,8 +21,8 @@ class AnnotationOrderBody extends StatefulWidget {
}
class _AnnotationOrderBodyState extends State {
- MapboxMapController controllerOne;
- MapboxMapController controllerTwo;
+ late MapboxMapController controllerOne;
+ late MapboxMapController controllerTwo;
final LatLng center = const LatLng(36.580664, 32.5563837);
diff --git a/example/lib/custom_marker.dart b/example/lib/custom_marker.dart
index b1f4b5052..f2fb48e95 100644
--- a/example/lib/custom_marker.dart
+++ b/example/lib/custom_marker.dart
@@ -30,7 +30,7 @@ class CustomMarker extends StatefulWidget {
class CustomMarkerState extends State {
final Random _rnd = new Random();
- MapboxMapController _mapController;
+ late MapboxMapController _mapController;
List _markers = [];
List<_MarkerState> _markerStates = [];
@@ -116,7 +116,7 @@ class CustomMarkerState extends State {
_mapController.toScreenLocationBatch(param).then((value) {
for (var i = 0; i < randomMarkerNum; i++) {
- var point = Point(value[i].x, value[i].y);
+ var point = Point(value[i].x as double, value[i].y as double);
_addMarker(point, param[i]);
}
});
@@ -151,7 +151,7 @@ class CustomMarkerState extends State {
}
Future.wait(list);
sw.stop();
- results[batch][0] += sw.elapsedMilliseconds;
+ results[batch]![0] += sw.elapsedMilliseconds;
sw.reset();
}
@@ -166,11 +166,11 @@ class CustomMarkerState extends State {
}
Future.wait([_mapController.toScreenLocationBatch(param)]);
sw.stop();
- results[batch][1] += sw.elapsedMilliseconds;
+ results[batch]![1] += sw.elapsedMilliseconds;
sw.reset();
}
- print('batch=$batch,primitive=${results[batch][0] / trial}ms, batch=${results[batch][1] / trial}ms');
+ print('batch=$batch,primitive=${results[batch]![0] / trial}ms, batch=${results[batch]![1] / trial}ms');
}
}
@@ -196,8 +196,8 @@ class _MarkerState extends State with TickerProviderStateMixin {
Point _position;
- AnimationController _controller;
- Animation _animation;
+ late AnimationController _controller;
+ late Animation _animation;
_MarkerState(this._position);
diff --git a/example/lib/full_map.dart b/example/lib/full_map.dart
index b6a10c89d..5b6bdcdb7 100644
--- a/example/lib/full_map.dart
+++ b/example/lib/full_map.dart
@@ -21,7 +21,7 @@ class FullMap extends StatefulWidget {
}
class FullMapState extends State {
- MapboxMapController mapController;
+ MapboxMapController? mapController;
void _onMapCreated(MapboxMapController controller) {
mapController = controller;
diff --git a/example/lib/generated_plugin_registrant.dart b/example/lib/generated_plugin_registrant.dart
index 152fbf187..9338cdbe8 100644
--- a/example/lib/generated_plugin_registrant.dart
+++ b/example/lib/generated_plugin_registrant.dart
@@ -4,12 +4,14 @@
// ignore_for_file: lines_longer_than_80_chars
+import 'package:location_web/location_web.dart';
import 'package:mapbox_gl_web/mapbox_gl_web.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
// ignore: public_member_api_docs
void registerPlugins(Registrar registrar) {
+ LocationWebPlugin.registerWith(registrar);
MapboxMapPlugin.registerWith(registrar);
registrar.registerMessageHandler();
}
diff --git a/example/lib/line.dart b/example/lib/line.dart
index 49b32eeee..7ea958734 100644
--- a/example/lib/line.dart
+++ b/example/lib/line.dart
@@ -31,9 +31,9 @@ class LineBodyState extends State {
static final LatLng center = const LatLng(-33.86711, 151.1947171);
- MapboxMapController controller;
+ MapboxMapController? controller;
int _lineCount = 0;
- Line _selectedLine;
+ Line? _selectedLine;
void _onMapCreated(MapboxMapController controller) {
this.controller = controller;
@@ -42,7 +42,7 @@ class LineBodyState extends State {
@override
void dispose() {
- controller?.onLineTapped?.remove(_onLineTapped);
+ controller?.onLineTapped.remove(_onLineTapped);
super.dispose();
}
@@ -65,11 +65,11 @@ class LineBodyState extends State {
}
void _updateSelectedLine(LineOptions changes) {
- controller.updateLine(_selectedLine, changes);
+ controller!.updateLine(_selectedLine!, changes);
}
void _add() {
- controller.addLine(
+ controller!.addLine(
LineOptions(
geometry: [
LatLng(-33.86711, 151.1947171),
@@ -88,7 +88,7 @@ class LineBodyState extends State {
}
void _remove() {
- controller.removeLine(_selectedLine);
+ controller!.removeLine(_selectedLine!);
setState(() {
_selectedLine = null;
_lineCount -= 1;
@@ -96,7 +96,7 @@ class LineBodyState extends State {
}
Future _changeAlpha() async {
- double current = _selectedLine.options.lineOpacity;
+ double? current = _selectedLine!.options.lineOpacity;
if (current == null) {
// default value
current = 1.0;
@@ -108,7 +108,7 @@ class LineBodyState extends State {
}
Future _toggleVisible() async {
- double current = _selectedLine.options.lineOpacity;
+ double? current = _selectedLine!.options.lineOpacity;
if (current == null) {
// default value
current = 1.0;
@@ -119,7 +119,7 @@ class LineBodyState extends State {
}
void onStyleLoadedCallback() {
- controller.addLine(
+ controller!.addLine(
LineOptions(
geometry: [LatLng(37.4220, -122.0841), LatLng(37.4240, -122.0941)],
lineColor: "#ff0000",
@@ -186,8 +186,8 @@ class LineBodyState extends State {
onPressed: (_selectedLine == null)
? null
: () async {
- var latLngs = await controller
- .getLineLatLngs(_selectedLine);
+ var latLngs = await controller!
+ .getLineLatLngs(_selectedLine!);
for (var latLng in latLngs) {
print(latLng.toString());
}
diff --git a/example/lib/local_style.dart b/example/lib/local_style.dart
index 9918b6675..c851b94a7 100644
--- a/example/lib/local_style.dart
+++ b/example/lib/local_style.dart
@@ -25,8 +25,8 @@ class LocalStyle extends StatefulWidget {
}
class LocalStyleState extends State {
- MapboxMapController mapController;
- String styleAbsoluteFilePath;
+ MapboxMapController? mapController;
+ String? styleAbsoluteFilePath;
@override
initState() {
diff --git a/example/lib/main.dart b/example/lib/main.dart
index ef5385dbd..de06ee3ee 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -50,7 +50,7 @@ class MapsDemo extends StatelessWidget {
if (!kIsWeb) {
final location = Location();
final hasPermissions = await location.hasPermission();
- if (hasPermissions != PermissionStatus.GRANTED) {
+ if (hasPermissions != PermissionStatus.granted) {
await location.requestPermission();
}
}
diff --git a/example/lib/map_ui.dart b/example/lib/map_ui.dart
index 68a1acfdc..9db427f34 100644
--- a/example/lib/map_ui.dart
+++ b/example/lib/map_ui.dart
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-import 'dart:convert';
import 'dart:math';
import 'package:flutter/material.dart';
@@ -40,8 +39,8 @@ class MapUiBodyState extends State {
zoom: 11.0,
);
- MapboxMapController mapController;
- CameraPosition _position = _kInitialPosition;
+ MapboxMapController? mapController;
+ CameraPosition? _position = _kInitialPosition;
bool _isMoving = false;
bool _compassEnabled = true;
CameraTargetBounds _cameraTargetBounds = CameraTargetBounds.unbounded;
@@ -66,8 +65,8 @@ class MapUiBodyState extends State {
bool _myLocationEnabled = true;
bool _telemetryEnabled = true;
MyLocationTrackingMode _myLocationTrackingMode = MyLocationTrackingMode.None;
- List