Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge tobrun 0.12 #8

Merged
merged 40 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0961470
Change iOS dependencies to Maplibre
m0nac0 Mar 11, 2021
4e617e5
Update MapLibre dependency
m0nac0 Mar 11, 2021
a718175
Set iOS deployment target to 9.0
m0nac0 Mar 11, 2021
2798195
fix Podfile syntax
m0nac0 Mar 11, 2021
c6c284e
Podfile: comment out platform key
m0nac0 Mar 11, 2021
3f0e9e8
set MinimumOSVersion: 9.0; uncomment Podfile:platform key
m0nac0 Mar 11, 2021
71118f9
CI: verbose iOS build
m0nac0 Mar 11, 2021
67dbc75
Update IPHONEOS_DEPLOYMENT_TARGET to 9.0
m0nac0 Mar 11, 2021
bf9c075
[web] Fix Mapbox GL JS CSS embedding (#551)
shroff Mar 14, 2021
ec7145e
iOS: update Podfile to fix CI (#565)
m0nac0 Mar 15, 2021
108d6bb
Update deprecated patterns to fix CI static analysis (#568)
shroff Mar 15, 2021
74c656a
[offline][android] Add setOffline method (#537)
shroff Mar 30, 2021
489bbd8
Add batch mode of screen location (#554)
OttyLab Mar 30, 2021
11c4d5b
Define which annotations consume tap events (Multiple annotations on …
strepier Mar 30, 2021
28ef8f7
Remove failed offline pack downloads (#583)
n8han Mar 30, 2021
7ca6a45
[docs] update changelog for v0.11.0 release (#584)
tobrun Mar 30, 2021
9082f61
[release] update pubspec for v0.11.0 (#585)
tobrun Mar 30, 2021
fe1d641
add annotationOrder to web (#588)
andrea689 Mar 31, 2021
74eb62c
emits onTap only for the feature above the others (#589)
andrea689 Mar 31, 2021
237505d
[web] update image dependency to ^3.0.2 (#598)
ahm322 Apr 12, 2021
83354c7
[android] bumpn release to v9.6.0 and use SDK registry distribution m…
tobrun Apr 12, 2021
9ee6d31
[iOS][Android] Batch creation/removal for circles, fills and lines (#…
felix-ht Apr 12, 2021
16bf53b
fix feature mamager on release build (#593)
andrea689 Apr 12, 2021
2259e76
Improve description to enable location features (#596)
Atalanttore Apr 12, 2021
cc0bbe9
Update to Mapbox-iOS-SDK 6.3.0 (#513)
n8han Apr 12, 2021
1f7f664
[docs] update changeog for v0.12.0 (#602)
tobrun Apr 12, 2021
3399fc4
[release] v0.12.0 (#603)
tobrun Apr 12, 2021
fe4e8c0
fix: update MapLibre dependencies and imports.
May 20, 2021
ce3d43c
fix: update String cast
May 20, 2021
d5c57f5
Merge remote-tracking branch 'origin/main' into m0-ios-extension
May 20, 2021
6b884dc
Merge tag '0.11.0' of github.com:tobrun/flutter-mapbox-gl into merge-…
Jun 23, 2021
044c30f
Fix maplibre dependency (org.maplibre.gl has migrated to maven central)
Jun 23, 2021
cb8d7f7
Merge tag '0.12.0' of github.com:tobrun/flutter-mapbox-gl into merge-…
Jun 23, 2021
6a756e9
Update iOS MapLibre to 5.12.0
vberthet Jul 7, 2021
5575a9d
Bump MapLibreAnnotationExtension to 0.0.1-beta.3
vberthet Jul 7, 2021
b8d48db
Merge branch 'main' of github.com:MdnAgency/flutter-maplibre-gl into …
Jul 7, 2021
57a3b94
Update maplibre_gl.podspec
Jul 7, 2021
4d42b40
[iOS] - Fix compilation issue with maplibre 5.12.0
Jul 7, 2021
f5a6c33
Merge branch 'main' of github.com:m0nac0/flutter-maplibre-gl into mer…
Oct 5, 2021
104f960
Update CHANGELOG.md
Oct 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/flutter_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: build iOS package
run: |
cd ./example
flutter build ios --release --no-codesign
flutter build ios --release --no-codesign --verbose

build-web:
name: "Build web"
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
## Below is the original changelog of the tobrun/flutter-mapbox-gl project, before the fork.

## 0.12.0, April 12, 2020
m0nac0 marked this conversation as resolved.
Show resolved Hide resolved
* Update to Mapbox-Android-SDK 9.6.0 [#489](https://github.com/tobrun/flutter-mapbox-gl/pull/489)
* Update to Mapbox-iOS-SDK 6.3.0 [#513](https://github.com/tobrun/flutter-mapbox-gl/pull/513)
* 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)

## 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
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,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.

### 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>
```

Mapbox [recommends](https://docs.mapbox.com/help/tutorials/first-steps-ios-sdk/#display-the-users-location) the explanation "Shows your location on the map and helps improve the map".
Expand Down
20 changes: 5 additions & 15 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:4.1.1'
}
}

Expand All @@ -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