Skip to content

Commit

Permalink
Merge tobrun 0.12 (#8)
Browse files Browse the repository at this point in the history
* Change iOS dependencies to Maplibre

* Update MapLibre dependency

* Set iOS deployment target to 9.0

* fix Podfile syntax

* Podfile: comment out platform key

* set MinimumOSVersion: 9.0; uncomment Podfile:platform key

* CI: verbose iOS build

* Update IPHONEOS_DEPLOYMENT_TARGET to 9.0

* [web] Fix Mapbox GL JS CSS embedding (#551)

Fixes #514

* iOS: update Podfile to fix CI (#565)

* Update deprecated patterns to fix CI static analysis  (#568)

* [offline][android] Add setOffline method (#537)

* Add batch mode of screen location (#554)

* Change SDK version of example

* Add toScreenLocationBatch

* Add custom marker example

* Define which annotations consume tap events (Multiple annotations on click area management) (#575)

* AnnotationClickOrder working (not order but activation/desactivation)

* Switch to annotationConsumeTapEvents method

* Remove failed offline pack downloads (#583)

When a download error occurs, the app is informed through the channel so
that it can display an appropriate error. However, on subsequent calls
to list the available downloaded packs it is surprising to see that the
failed region download is present as if it had been downloaded.

There is no way for the app to repair this incomplete pack. Therefore,
it seems much better to clean up the failed download as soon as it's
detected. If any tiles were downloaded they will be at least temporarily
in the cache and available to a future re-download attempt. This follows
the same logic as failures caused by hitting the tile limit.

* [docs] update changelog for v0.11.0 release (#584)

* [release] update pubspec for v0.11.0 (#585)

* add annotationOrder to web (#588)

* emits onTap only for the feature above the others (#589)

* [web] update image dependency to ^3.0.2 (#598)

* [android] bumpn release to v9.6.0 and use SDK registry distribution mechanism (#489)

* [iOS][Android] Batch creation/removal for circles, fills and lines (#576)

* added batch mode

* added circle support

* added remove features

* removed test code

* inital android implementation

* added documentation

* removed unused code

* add batch example

* fix feature mamager on release build (#593)

* Improve description to enable location features (#596)

* Update to Mapbox-iOS-SDK 6.3.0 (#513)

* Update to Mapbox-iOS-SDK 6.3.0

The 6.0.0 upgrade had no breaking changes:

> This major release does not include any breaking changes to public
> APIs. We are treating this release as a SEMVER major change because
> our installation instructions have changed.
https://github.com/mapbox/mapbox-gl-native-ios/releases/tag/ios-v6.0.0

I did however need to cast the `accessToken` as a `String` to satisfy
the compiler after this upgrade.

Prior to the upgrade I was seeing crashes from this bug, which was fixed
in 6.2: mapbox/mapbox-gl-native-ios#485

So far I don't see any issues at all after the upgrade.

Developers will need to configure their access token in order to fetch
the mapbox sdk for this an future versions, described here:
https://docs.mapbox.com/ios/maps/guides/install/

* Setup .netrc for iOS mapbox sdk download

Writes a `~/.netrc` file containing the credentials needed to download
the iOS mapbox sdk. I'm not experienced with github workflow so I'm just
hoping that I can write to the home directory of whatever container it
runs in. This should allow curl to find and use the given credentials.

Co-authored-by: tobrun <tobrun.van.nuland@gmail.com>

* [docs] update changeog for v0.12.0 (#602)

* [release] v0.12.0 (#603)

* fix: update MapLibre dependencies and imports.

* fix: update String cast

* Fix maplibre dependency (org.maplibre.gl has migrated to maven central)

* Update iOS MapLibre to 5.12.0

* Bump MapLibreAnnotationExtension to 0.0.1-beta.3

* Update maplibre_gl.podspec

* [iOS] - Fix compilation issue with maplibre 5.12.0

* Update CHANGELOG.md

Co-authored-by: m0nac0 <58807793+m0nac0@users.noreply.github.com>
Co-authored-by: shroff <ashroff6@gmail.com>
Co-authored-by: Yoshikage Ochi <yoshikage.ochi@mapbox.com>
Co-authored-by: Stephane Trepier <stephane.trepier@gmail.com>
Co-authored-by: Nathan <nathan@transit.app>
Co-authored-by: Tobrun <tobrun.van.nuland@gmail.com>
Co-authored-by: Andrea Valenzano <andr3a689@gmail.com>
Co-authored-by: Ahmed <ahm322@hotmail.com>
Co-authored-by: Felix Horvat <felix.horvat@ocell.aero>
Co-authored-by: Ettore Atalan <atalanttore@googlemail.com>
Co-authored-by: Konrad Koeppe <konrad.koeppe@bareways.com>
Co-authored-by: Vincent Berthet <vincent@web-74.com>
  • Loading branch information
13 people authored Oct 5, 2021
1 parent e404e4d commit 3f94c6e
Show file tree
Hide file tree
Showing 40 changed files with 1,461 additions and 308 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
## 0.12.0, Oct 5, 2021
* Update to Maplibre-Android-SDK 9.4.2
* Update to MapLibre-iOS-SDK 5.12.0

### Changes cherry-picked/ported from tobrun/flutter-mapbox-gl:0.12.0
* Batch creation/removal for circles, fills and lines [#576](https://github.com/tobrun/flutter-mapbox-gl/pull/576)
* Dependencies: updated image package [#598](https://github.com/tobrun/flutter-mapbox-gl/pull/598)
* Improve description to enable location features [#596](https://github.com/tobrun/flutter-mapbox-gl/pull/596)
* Fix feature manager on release build [#593](https://github.com/tobrun/flutter-mapbox-gl/pull/593)
* Emit onTap only for the feature above the others [#589](https://github.com/tobrun/flutter-mapbox-gl/pull/589)
* Add annotationOrder to web [#588](https://github.com/tobrun/flutter-mapbox-gl/pull/588)

## Below is the original changelog of the tobrun/flutter-mapbox-gl project, before the fork.

## 0.11.0, March 30, 2020
* Fixed issues caused by new android API [#544](https://github.com/tobrun/flutter-mapbox-gl/pull/544)
* Add option to set maximum offline tile count [#549](https://github.com/tobrun/flutter-mapbox-gl/pull/549)
* Fixed web build failure due to http package upgrade [#550](https://github.com/tobrun/flutter-mapbox-gl/pull/550)
* Update OfflineRegion/OfflineRegionDefinition interfaces, synchronize with iOS and Android [#545](https://github.com/tobrun/flutter-mapbox-gl/pull/545)
* Fix Mapbox GL JS CSS embedding on web [#551](https://github.com/tobrun/flutter-mapbox-gl/pull/551)
* Update Podfile to fix iOS CI [#565](https://github.com/tobrun/flutter-mapbox-gl/pull/565)
* Update deprecated patterns to fix CI static analysis [#568](https://github.com/tobrun/flutter-mapbox-gl/pull/568)
* Add setOffline method on Android [#537](https://github.com/tobrun/flutter-mapbox-gl/pull/537)
* Add batch mode of screen locations [#554](https://github.com/tobrun/flutter-mapbox-gl/pull/554)
* Define which annotations consume the tap events [#575](https://github.com/tobrun/flutter-mapbox-gl/pull/575)
* Remove failed offline region downloads [#583](https://github.com/tobrun/flutter-mapbox-gl/pull/583)

## 0.10.0, February 12, 2020
* Merge offline regions [#532](https://github.com/tobrun/flutter-mapbox-gl/pull/532)
* Update offline region metadata [#530](https://github.com/tobrun/flutter-mapbox-gl/pull/530)
Expand Down
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,25 @@ Map styles can be supplied by setting the `styleString` in the `MapOptions`. The


## Location features
#### To enable location features in an **Android** application:
### Android
Add the `ACCESS_COARSE_LOCATION` or `ACCESS_FINE_LOCATION` permission in the application manifest `android/app/src/main/AndroidManifest.xml` to enable location features in an **Android** application:
```
<manifest ...
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
```

You need to declare the `ACCESS_COARSE_LOCATION` or `ACCESS_FINE_LOCATION` permission in the AndroidManifest.xml and starting from Android API level 23 also request it at runtime. The plugin does not handle this for you. The example app uses the flutter ['location' plugin](https://pub.dev/packages/location) for this.
Starting from Android API level 23 you also need to request it at runtime. This plugin does not handle this for you. The example app uses the flutter ['location' plugin](https://pub.dev/packages/location) for this.

#### To enable location features in an **iOS** application:
### iOS
To enable location features in an **iOS** application:

If you access your users' location, you should also add the following key to your Info.plist to explain why you need access to their location data:
If you access your users' location, you should also add the following key to `ios/Runner/Info.plist` to explain why you need access to their location data:

```xml
<key>NSLocationWhenInUseUsageDescription</key>
<string>[Your explanation here]</string>
```
xml ...
<key>NSLocationWhenInUseUsageDescription</key>
<string>[Your explanation here]</string>
```

A possible explanation could be: "Shows your location on the map".
Expand Down
18 changes: 4 additions & 14 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ rootProject.allprojects {
google()
jcenter()
mavenCentral()
maven {
url = "https://dl.bintray.com/maplibre/maplibre-gl-native"
}
}
}

Expand All @@ -40,17 +37,10 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}
dependencies {
implementation 'org.maplibre.gl:android-sdk:9.2.1'
//implementation "com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0"
implementation ("com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0") {
exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-android-sdk'
}
implementation ("com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v9:0.12.0") {
exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-android-sdk'
}
implementation ("com.mapbox.mapboxsdk:mapbox-android-plugin-offline-v9:0.7.0") {
exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-android-sdk'
}
implementation 'org.maplibre.gl:android-sdk:9.4.2'
implementation 'org.maplibre.gl:android-plugin-annotation-v9:1.0.0'
implementation 'org.maplibre.gl:android-plugin-localization-v9:1.0.0'
implementation 'org.maplibre.gl:android-plugin-offline-v9:1.0.0'
}
compileOptions {
sourceCompatibility 1.8
Expand Down
4 changes: 4 additions & 0 deletions android/src/main/java/com/mapbox/mapboxgl/CircleBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ class CircleBuilder implements CircleOptionsSink {
this.circleOptions = new CircleOptions();
}

public CircleOptions getCircleOptions(){
return this.circleOptions;
}

Circle build() {
return circleManager.create(circleOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class CircleController implements CircleOptionsSink {
this.onTappedListener = onTappedListener;
}

public Circle getCircle(){
return this.circle;
}

boolean onTap() {
if (onTappedListener != null) {
onTappedListener.onCircleTapped(circle);
Expand Down
4 changes: 4 additions & 0 deletions android/src/main/java/com/mapbox/mapboxgl/Convert.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ static List<String> toAnnotationOrder(Object o) {
return annotations;
}

static List<String> toAnnotationConsumeTapEvents(Object o) {
return toAnnotationOrder(o);
}

static boolean isScrollByCameraUpdate(Object o) {
return toString(toList(o).get(0)).equals("scrollBy");
}
Expand Down
4 changes: 4 additions & 0 deletions android/src/main/java/com/mapbox/mapboxgl/FillBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class FillBuilder implements FillOptionsSink {
this.fillOptions = new FillOptions();
}

public FillOptions getFillOptions(){
return this.fillOptions;
}

Fill build() {
return fillManager.create(fillOptions);
}
Expand Down
4 changes: 4 additions & 0 deletions android/src/main/java/com/mapbox/mapboxgl/FillController.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class FillController implements FillOptionsSink {
this.onTappedListener = onTappedListener;
}

public Fill getFill(){
return this.fill;
}

boolean onTap() {
if (onTappedListener != null) {
onTappedListener.onFillTapped(fill);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import android.content.Context;
import com.mapbox.mapboxsdk.net.ConnectivityReceiver;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -64,14 +64,17 @@ public void onMethodCall(MethodCall methodCall, MethodChannel.Result result) {
installOfflineMapTiles(tilesDb);
result.success(null);
break;
case "setOffline":
boolean offline = methodCall.argument("offline");
ConnectivityReceiver.instance(context).setConnected(offline ? false : null);
result.success(null);
break;
case "mergeOfflineRegions":
OfflineManagerUtils.mergeRegions(result, context, methodCall.argument("path"));
break;

case "setOfflineTileCountLimit":
OfflineManagerUtils.setOfflineTileCountLimit(result, context, methodCall.<Number>argument("limit").longValue());
break;

case "downloadOfflineRegion":
// Get args from caller
Map<String, Object> definitionMap = (Map<String, Object>) methodCall.argument("definition");
Expand Down
4 changes: 4 additions & 0 deletions android/src/main/java/com/mapbox/mapboxgl/LineBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class LineBuilder implements LineOptionsSink {
this.lineOptions = new LineOptions();
}

public LineOptions getLineOptions(){
return this.lineOptions;
}

Line build() {
return lineManager.create(lineOptions);
}
Expand Down
4 changes: 4 additions & 0 deletions android/src/main/java/com/mapbox/mapboxgl/LineController.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class LineController implements LineOptionsSink {
this.onTappedListener = onTappedListener;
}

public Line getLine(){
return this.line;
}

boolean onTap() {
if (onTappedListener != null) {
onTappedListener.onLineTapped(line);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ class MapboxMapBuilder implements MapboxMapOptionsSink {
private int myLocationRenderMode = 0;
private String styleString = Style.MAPBOX_STREETS;
private List<String> annotationOrder = new ArrayList();
private List<String> annotationConsumeTapEvents = new ArrayList();


MapboxMapController build(
int id, Context context, BinaryMessenger messenger, MapboxMapsPlugin.LifecycleProvider lifecycleProvider, String accessToken) {
final MapboxMapController controller =
new MapboxMapController(id, context, messenger, lifecycleProvider, options, accessToken, styleString, annotationOrder);
new MapboxMapController(id, context, messenger, lifecycleProvider, options, accessToken, styleString, annotationOrder, annotationConsumeTapEvents);
controller.init();
controller.setMyLocationEnabled(myLocationEnabled);
controller.setMyLocationTrackingMode(myLocationTrackingMode);
Expand Down Expand Up @@ -178,4 +180,9 @@ public void setAttributionButtonMargins(int x, int y) {
public void setAnnotationOrder(List<String> annotations) {
this.annotationOrder = annotations;
}

public void setAnnotationConsumeTapEvents(List<String> annotations) {
this.annotationConsumeTapEvents = annotations;
}

}
Loading

0 comments on commit 3f94c6e

Please sign in to comment.