Skip to content

Commit

Permalink
Version 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yunikkk committed Nov 22, 2022
1 parent 2adc420 commit 6af4dc3
Show file tree
Hide file tree
Showing 136 changed files with 2,207 additions and 9,168 deletions.
82 changes: 58 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,43 @@ commands:
command: |
echo "machine api.mapbox.com login mapbox password ${SDK_REGISTRY_TOKEN}" >> ~/.netrc
chmod 0600 ~/.netrc
install-gcloud:
# Link for gcloud versions: https://cloud.google.com/sdk/docs/downloads-versioned-archives#installation_instructions
parameters:
version:
type: string
default: "google-cloud-cli-405.0.0-darwin-x86_64.tar.gz"
checksum:
type: string
default: "504852f8ab0c7df62f80d9d687d74c80da68f1e17ad53055fbdb37cf9bbeebc7"
description: "Install gcloud"
steps:
- run:
name: Install gcloud
command: |
mkdir /tmp/gcloud && cd /tmp/gcloud
curl -OL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/<< parameters.version >>
echo '<< parameters.checksum >> *<< parameters.version >>' >> checksumfile
shasum -a 256 -c checksumfile
tar zxvf << parameters.version >>
./google-cloud-sdk/install.sh -q --install-python false
echo "source /tmp/gcloud/google-cloud-sdk/path.bash.inc" >> $BASH_ENV
echo "source /tmp/gcloud/google-cloud-sdk/completion.bash.inc" >> $BASH_ENV
login-gcloud:
steps:
- run:
name: Log in to Google Cloud Platform
command: |
if [[ -n "${GCLOUD_SERVICE_ACCOUNT_JSON}" ]]; then
echo "${GCLOUD_SERVICE_ACCOUNT_JSON}" > secret.json
gcloud auth activate-service-account --key-file secret.json --project mapbox-maps-flutter
rm secret.json
fi
jobs:
build-android:
Expand All @@ -34,10 +71,6 @@ jobs:
steps:
- checkout
- checkout-submodules
- android/create-avd:
avd-name: flutter
install: true
system-image: system-images;android-29;default;x86
- flutter/install_sdk_and_pub:
flutter_version: 3.3.2
- run:
Expand All @@ -50,26 +83,32 @@ jobs:
- run:
name: unit test
command: flutter test test
- android/start-emulator:
avd-name: flutter
post-emulator-launch-assemble-command: ''
restore-gradle-cache-post-emulator-launch: false
- install-gcloud
- login-gcloud
- run:
name: "Build flutter wrapper for android"
working_directory: example
command: flutter build apk
name: "Build Android integration tests"
working_directory: example/android
command: |
flutter build apk
./gradlew app:assembleAndroidTest
./gradlew app:assembleDebug -Ptarget=integration_test/all_test.dart -Pdart-defines="${MAPBOX_ACCESS_TOKEN_BASE64}"
- run:
name: "Run integration tests for android"
name: "Run Android integration tests on Firebase"
working_directory: example
command: flutter test integration_test/all_test.dart -r expanded --dart-define=ACCESS_TOKEN=${MAPBOX_ACCESS_TOKEN}
command: |
gcloud firebase test android run --type instrumentation \
--app build/app/outputs/apk/debug/app-debug.apk \
--test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
--timeout 5m \
--results-dir=result_dir \
--use-orchestrator \
--num-flaky-test-attempts 3
build-ios:
executor: macos-xcode-latest
steps:
- checkout
- checkout-submodules
# - macos/preboot-simulator:
# device: iPhone 13
# version: "15.4"
- inject-netrc-credentials
- flutter/install_sdk_and_pub:
flutter_version: 3.3.2
Expand All @@ -79,21 +118,16 @@ jobs:
name: swiftlint
working_directory: ios
command: brew install swiftlint; swiftlint lint --strict
- run:
name: "Flutter doctor"
working_directory: example
command: flutter doctor -v
- run:
name: "Build flutter wrapper for iOS"
working_directory: example
command: flutter build ios --simulator --no-codesign
- run:
name: unit test
command: flutter test test
# - run:
# name: "Run integration tests on the iOS simulator"
# working_directory: example
# command: flutter test integration_test/all_test.dart -r expanded --dart-define=ACCESS_TOKEN=${MAPBOX_ACCESS_TOKEN}
# - install-gcloud
# - login-gcloud
# - run-firebase-benchmark-ios

workflows:
build:
Expand Down
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Mark files as generated in Github PRs
## pigeon
lib/src/pigeons/* linguist-generated=true
android/src/main/java/com/mapbox/maps/pigeons/* linguist-generated=true
ios/Classes/*h linguist-generated=true
ios/Classes/*m linguist-generated=true

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ unlinked_spec.ds
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*
.fastlane/README.md
.fastlane/report.xml

# macOS
**/macos/Flutter/GeneratedPluginRegistrant.swift
Expand Down
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 0.0.1
## 0.2.0

* TODO: Describe initial release.
* Rename `MapView` to `MapWidget`.
* Remove `RenderCacheOptions`.
* Rename `MapboxMap.cameraForCoordinates2` to `MapboxMap.cameraForCoordinatesCameraOptions`.
* Rename `styles.dart` to `mapbox_styles.dart`.
* Rename `fill-extrusion_layer.dart` to `fill_extrusion_layer.dart`,
`location-indicator_layer.dart` to `location_indicator_layer.dart`.
* Fix exception thrown by `MapboxMap.coordinatesForPixels`.
* Fix camera example `_coordinateForPixel`.
* Add gesture listeners `MapWidget.onTapListener`, `MapWidget.onLongTapListener`, `MapWidget.onScrollListener`.

## 0.1.1

* Decrease min flutter version to 2.10.5.

## 0.1.0

* Initial release.
57 changes: 0 additions & 57 deletions DEVELOPING.md

This file was deleted.

34 changes: 0 additions & 34 deletions Makefile

This file was deleted.

40 changes: 25 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,22 @@ To run the Maps Flutter Plugin you will need to configure the Mapbox Access Toke
Read more about access tokens and public/secret scopes at the platform [Android](https://docs.mapbox.com/android/maps/guides/install/#configure-credentials) or [iOS](https://docs.mapbox.com/ios/maps/guides/install/#configure-credentials) docs.

#### Secret token
To access platform SDKs you will need to create a secret access token with the `Downloads:Read` scope and set an environment variable `SDK_REGISTRY_TOKEN` using this token.
To access platform SDKs you will need to create a secret access token with the `Downloads:Read` scope and then:
- to download the Android SDK add the token configuration to `~/.gradle/gradle.properties` :
```
SDK_REGISTRY_TOKEN=YOUR_SECRET_MAPBOX_ACCESS_TOKEN
```
- to download the iOS SDK add the token configuration to `~/.netrc` :
```
machine api.mapbox.com
login mapbox
password YOUR_SECRET_MAPBOX_ACCESS_TOKEN
```

#### Public token
To instantiate the `MapView` widget pass the public access token with `ResourceOptions`:
To instantiate the `MapWidget` widget pass the public access token with `ResourceOptions`:
```
MapView(
MapWidget(
resourceOptions:
ResourceOptions(accessToken: PUBLIC_ACCESS_TOKEN))));
```
Expand Down Expand Up @@ -67,7 +77,7 @@ dependencies:
mapbox_maps:
git:
url: [email protected]:mapbox/mapbox-maps-flutter.git
ref: 0.1.0
ref: 0.2.0
```

### Configure permissions
Expand Down Expand Up @@ -100,18 +110,18 @@ import 'package:mapbox_maps/mapbox_maps.dart';
void main() {
runApp(MaterialApp(
home: MapView(
home: MapWidget(
resourceOptions: ResourceOptions(accessToken: YOUR_ACCESS_TOKEN))));
}
```

#### MapView widget
The `MapView` widget provides options to customize the map - you can set `ResourceOptions`, `MapOptions`, `CameraOptions`, `styleURL`.
#### MapWidget widget
The `MapWidget` widget provides options to customize the map - you can set `ResourceOptions`, `MapOptions`, `CameraOptions`, `styleURL`.

It also allows or add listeners for various events - related to style loading, map rendering, map loading.

#### MapboxMap controller
The `MapboxMap` controller instance is provided with `MapView.onMapCreated` callback.
The `MapboxMap` controller instance is provided with `MapWidget.onMapCreated` callback.

`MapboxMap` exposes an entry point to the most of the APIs Maps Flutter Plugin provides. It allows to control the map, camera, styles, observe map events,
query rendered features, etc.
Expand All @@ -137,8 +147,8 @@ class FullMapState extends State<FullMap> {
@override
Widget build(BuildContext context) {
return new Scaffold(
body: MapView(
key: ValueKey("mapView"),
body: MapWidget(
key: ValueKey("mapWidget"),
resourceOptions: ResourceOptions(accessToken: ACCESS_TOKEN),
onMapCreated: _onMapCreated,
));
Expand Down Expand Up @@ -199,7 +209,7 @@ Platform docs : [Android](https://docs.mapbox.com/android/maps/guides/styles/),
The Mapbox Maps Flutter Plugin allows full customization of the look of the map used in your application.

### Set a style
You can specify the initial style uri at `MapView.styleUri`, or load it at runtime using `MapboxMap.loadStyleURI` / `MapboxMap.loadStyleJson` :
You can specify the initial style uri at `MapWidget.styleUri`, or load it at runtime using `MapboxMap.loadStyleURI` / `MapboxMap.loadStyleJson` :

```
mapboxMap.loadStyleURI(Styles.LIGHT);
Expand Down Expand Up @@ -238,11 +248,11 @@ Platform docs : [Android](https://docs.mapbox.com/android/maps/guides/camera-and
The camera is the user's viewpoint above the map. The Maps Flutter Plugin provides you with options to set and adjust the camera position, listen for camera changes, get the camera position, and restrict the camera position to set bounds.

### Camera position
You can set the starting camera position using `MapView.cameraOptions` :
You can set the starting camera position using `MapWidget.cameraOptions` :

```
MapView(
key: ValueKey("mapView"),
MapWidget(
key: ValueKey("mapWidget"),
resourceOptions: ResourceOptions(accessToken: ACCESS_TOKEN),
cameraOptions: CameraOptions(
center: Point(coordinates: Position(-80.1263, 25.7845)).toJson(),
Expand Down Expand Up @@ -280,6 +290,6 @@ Platform docs : [Android](https://docs.mapbox.com/android/maps/guides/user-inter

Users interacting with the map in your application can explore the map by performing standard gestures.

You can pass custom `MapView.gestureRecognizers` to control which gestures
You can pass custom `MapWidget.gestureRecognizers` to control which gestures
are handled by the platform view.

9 changes: 8 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ android {
defaultConfig {
minSdkVersion 21
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

project.apply {
Expand All @@ -56,8 +61,10 @@ project.apply {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation ("com.mapbox.maps:android:10.8.0-beta.1"){
implementation ("com.mapbox.maps:android:10.9.0") {
exclude group: 'com.mapbox.plugin', module: 'maps-lifecycle'
}

implementation "androidx.annotation:annotation:1.5.0"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.1"
}
Loading

0 comments on commit 6af4dc3

Please sign in to comment.