├── .gitignore
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── android
├── .gitignore
├── .settings
│ └── org.eclipse.buildship.core.prefs
├── build.gradle
├── gradle.properties
├── settings.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── com
│ └── mapbox
│ └── mapboxgl
│ ├── FlutterMapView.java
│ ├── MapViewFactory.java
│ └── MapboxGlPlugin.java
├── example
├── .gitignore
├── .metadata
├── README.md
├── android
│ ├── .gitignore
│ ├── .project
│ ├── .settings
│ │ └── org.eclipse.buildship.core.prefs
│ ├── app
│ │ ├── .classpath
│ │ ├── .project
│ │ ├── .settings
│ │ │ └── org.eclipse.buildship.core.prefs
│ │ ├── build.gradle
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── mapbox
│ │ │ │ └── mapboxglexample
│ │ │ │ └── MainActivity.java
│ │ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── ios
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Podfile
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── Runner
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ └── LaunchImage.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ └── README.md
│ │ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── main.m
├── lib
│ └── main.dart
└── pubspec.yaml
├── flutter_mapbox_gl.iml
├── ios
├── .gitignore
├── Assets
│ └── .gitkeep
├── Classes
│ ├── MapboxGlPlugin.h
│ └── MapboxGlPlugin.m
└── flutter_mapbox_gl.podspec
├── lib
├── mapbox_gl.dart
└── src
│ ├── camera.dart
│ ├── controller.dart
│ ├── flutter_mapbox_view.dart
│ └── models.dart
├── pubspec.lock
├── pubspec.yaml
└── screenshot.png
/.gitignore:
--------------------------------------------------------------------------------
1 | android/.classpath
2 | android/.project
3 | .packages
4 | .vscode/
5 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 0.0.1
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | We welcome contributions to this repository. Please follow these steps if you're interested in making contributions:
4 |
5 | 1. Please familiarize yourself with the [install process](https://github.com/mapbox/flutter-mapbox-gl#getting-started).
6 |
7 | 2. Ensure that existing [pull requests](https://github.com/mapbox/flutter-mapbox-gl/pulls) and [issues](https://github.com/mapbox/flutter-mapbox-gl/issues) don’t already cover your contribution or question.
8 |
9 | 3. Create a new branch that will contain your contributed code and eventually create a pull request once you're done making changes.
10 |
11 | 4. If there are any changes that developers should be aware of, please update the [changelog](https://github.com/mapbox/flutter-mapbox-gl/blob/master/CHANGELOG.md) once your pull request has been merged to the `master` branch.
12 |
13 | # Code of conduct
14 | Everyone is invited to participate in Mapbox’s open source projects and public discussions: we want to create a welcoming and friendly environment. Harassment of participants or other unethical and unprofessional behavior will not be tolerated in our spaces. The [Contributor Covenant](http://contributor-covenant.org) applies to all projects under the Mapbox organization and we ask that you please read [the full text](http://contributor-covenant.org/version/1/2/0/).
15 |
16 | You can learn more about our open source philosophy on [mapbox.com](https://www.mapbox.com/about/open/).
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | flutter-mapbox-gl copyright (c) 2018, Mapbox.
2 |
3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4 |
5 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | > **Please note that this project has moved.** Please head to https://github.com/tobrun/flutter-mapbox-gl for updates.
2 |
3 | ---
4 |
5 | # Flutter Mapbox GL Native
6 |
7 | This Flutter plugin for [mapbox-gl-native](https://github.com/mapbox/mapbox-gl-native) enables
8 | embedded interactive and customizable vector maps inside of a Flutter widget. This project plugin is in early development stage. Only Android is supported for now.
9 |
10 | 
11 |
12 | ## Getting Started
13 |
14 | ### Android
15 |
16 | Following examples use Mapbox vector tiles, which require a Mapbox account and a Mapbox access token. Obtain a free access token on [your Mapbox account page](https://www.mapbox.com/account/access-tokens/). After you get the key, place it in project's Android directory:
17 | - Create a `local.properties` file with the following path: `$project_dir/android/local.properties`
18 | - Add `mapbox.accessToken="YOUR MAPBOX ACCESS TOKEN"`
19 | token to the **local.properties** file.
20 |
21 | #### Demo app
22 |
23 | - Install [Flutter](https://flutter.io/get-started/) and validate its installation with `flutter doctor`
24 | - Clone this repository with `git clone git@github.com:mapbox/flutter-mapbox-gl.git`
25 | - Run the app with `cd flutter_mapbox/example && flutter run`
26 |
27 | #### New project
28 |
29 | - Create new Flutter project in your IDE or via terminal
30 | - Add `mapbox_gl: ^0.0.1` dependency to `pubspec.yaml` file and [get the package](https://flutter.io/using-packages/#adding-a-package-dependency-to-an-app)
31 | - Add Mapbox read token value in the application manifest `android/app/src/main/AndroidManifest.xml`:
32 |
33 | ```xml
34 |
37 | ```
38 |
39 | - Import Mapbox widgets and add them to your widget tree
40 | ```
41 | import 'package:mapbox_gl/mapbox_gl.dart';
42 | ```
43 |
44 | ## Documentation
45 |
46 | This README file currently houses all of the documentation for this Flutter project. Please visit [mapbox.com/android-docs](https://www.mapbox.com/android-docs/) if you'd like more information about the Mapbox Maps SDK for Android and [mapbox.com/ios-sdk](https://www.mapbox.com/ios-sdk/) for more information about the Mapbox Maps SDK for iOS.
47 |
48 | ## Getting Help
49 |
50 | - **Need help with your code?**: Look for previous questions on the [#mapbox tag](https://stackoverflow.com/questions/tagged/mapbox+android) — or [ask a new question](https://stackoverflow.com/questions/tagged/mapbox+android).
51 | - **Have a bug to report?** [Open an issue](https://github.com/mapbox/flutter-mapbox-gl/issues/new). If possible, include a full log and information which shows the issue.
52 | - **Have a feature request?** [Open an issue](https://github.com/mapbox/flutter-mapbox-gl/issues/new). Tell us what the feature should do and why you want the feature.
53 |
54 | ## Sample code
55 |
56 | [This repository's example library](https://github.com/mapbox/flutter-mapbox-gl/tree/master/example/lib) is currently the best place for you to find reference code for this project.
57 |
58 | ## Contributing
59 |
60 | We welcome contributions to this repository!
61 |
62 | If you're interested in helping build this Mapbox/Flutter integration, please read [the contribution guide](https://github.com/mapbox/flutter-mapbox-gl/blob/master/CONTRIBUTING.md) to learn how to get started.
63 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/android/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.project.dir=../example/android
2 | eclipse.preferences.version=1
3 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | group 'com.mapbox.mapboxgl'
2 | version '1.0-SNAPSHOT'
3 |
4 | buildscript {
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 |
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.2.1'
12 | }
13 | }
14 |
15 | rootProject.allprojects {
16 | repositories {
17 | google()
18 | jcenter()
19 | mavenCentral()
20 | }
21 | }
22 |
23 | apply plugin: 'com.android.library'
24 |
25 | android {
26 | compileSdkVersion 27
27 |
28 | defaultConfig {
29 | minSdkVersion 16
30 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
31 | }
32 | lintOptions {
33 | disable 'InvalidPackage'
34 | }
35 | compileOptions {
36 | sourceCompatibility JavaVersion.VERSION_1_8
37 | targetCompatibility JavaVersion.VERSION_1_8
38 | }
39 | dependencies {
40 | implementation "com.mapbox.mapboxsdk:mapbox-android-sdk:6.8.1"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'mapbox_gl'
2 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/android/src/main/java/com/mapbox/mapboxgl/FlutterMapView.java:
--------------------------------------------------------------------------------
1 | package com.mapbox.mapboxgl;
2 |
3 | import android.app.Activity;
4 | import android.app.Application;
5 | import android.content.Context;
6 | import android.graphics.RectF;
7 | import android.os.Bundle;
8 | import android.support.annotation.NonNull;
9 | import android.util.Log;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import io.flutter.plugin.common.MethodCall;
13 | import io.flutter.plugin.common.MethodChannel;
14 |
15 | import static com.mapbox.mapboxgl.MapboxGlPlugin.CREATED;
16 | import static com.mapbox.mapboxgl.MapboxGlPlugin.DESTROYED;
17 | import static com.mapbox.mapboxgl.MapboxGlPlugin.PAUSED;
18 | import static com.mapbox.mapboxgl.MapboxGlPlugin.RESUMED;
19 | import static com.mapbox.mapboxgl.MapboxGlPlugin.STARTED;
20 | import static com.mapbox.mapboxgl.MapboxGlPlugin.STOPPED;
21 | import static io.flutter.plugin.common.MethodChannel.MethodCallHandler;
22 | import static io.flutter.plugin.common.MethodChannel.Result;
23 | import io.flutter.plugin.common.BinaryMessenger;
24 | import io.flutter.plugin.platform.PlatformView;
25 | import io.flutter.plugin.common.PluginRegistry;
26 |
27 | import io.flutter.plugin.common.PluginRegistry.Registrar;
28 | import io.flutter.view.FlutterView;
29 |
30 |
31 | import com.mapbox.mapboxsdk.Mapbox;
32 | import com.mapbox.mapboxsdk.maps.MapView;
33 | import com.mapbox.mapboxsdk.maps.MapboxMapOptions;
34 | import com.mapbox.mapboxsdk.maps.MapView;
35 | import com.mapbox.mapboxsdk.maps.MapboxMap;
36 | import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
37 |
38 | import com.mapbox.geojson.Feature;
39 | import com.mapbox.mapboxsdk.camera.CameraPosition;
40 | import com.mapbox.mapboxsdk.camera.CameraUpdate;
41 | import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
42 | import com.mapbox.mapboxsdk.constants.Style;
43 | import com.mapbox.mapboxsdk.geometry.LatLng;
44 | import com.mapbox.mapboxsdk.geometry.ProjectedMeters;
45 | import com.mapbox.mapboxsdk.maps.MapboxMapOptions;
46 | import com.mapbox.mapboxsdk.style.expressions.Expression;
47 | import com.mapbox.mapboxsdk.style.layers.Layer;
48 |
49 | import static com.mapbox.mapboxsdk.style.layers.Property.NONE;
50 | import static com.mapbox.mapboxsdk.style.layers.Property.VISIBLE;
51 | import static com.mapbox.mapboxsdk.style.layers.PropertyFactory.visibility;
52 |
53 | import com.mapbox.mapboxsdk.location.LocationComponent;
54 | import com.mapbox.mapboxsdk.location.LocationComponentOptions;
55 | import com.mapbox.mapboxsdk.location.modes.CameraMode;
56 | import com.mapbox.mapboxsdk.location.modes.RenderMode;
57 |
58 | import com.mapbox.android.core.permissions.PermissionsManager;
59 |
60 | import android.support.v4.content.ContextCompat;
61 | import com.mapbox.mapboxgl.R;
62 |
63 | import android.content.pm.ApplicationInfo;
64 | import android.content.pm.PackageManager;
65 |
66 | import java.util.ArrayList;
67 | import java.util.HashMap;
68 | import java.util.List;
69 | import java.util.Map;
70 | import java.util.concurrent.atomic.AtomicInteger;
71 |
72 | import android.graphics.PointF;
73 |
74 | public class FlutterMapView
75 | implements PlatformView, MethodCallHandler, OnMapReadyCallback, MapboxMap.OnMapClickListener,
76 | Application.ActivityLifecycleCallbacks{
77 | private final MethodChannel methodChannel;
78 | private final MapView mapView;
79 | private MapboxMap mapboxMap;
80 | private final PluginRegistry.Registrar registrar;
81 | private final AtomicInteger activityState;
82 | private final int registrarActivityHashCode;
83 | private boolean disposed = false;
84 | Context context;
85 |
86 | FlutterMapView(Context context, AtomicInteger state, PluginRegistry.Registrar registrar, int id) {
87 | try {
88 | ApplicationInfo ai = registrar.activity().getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA);
89 | Bundle bundle = ai.metaData;
90 | String token = bundle.getString("com.mapbox.token");
91 | Mapbox.getInstance(context,token);
92 | } catch (Exception e) {
93 | Log.e("MBGL", "Please configure in your AndroidManifest.xml file.");
94 | }
95 |
96 | this.context = context;
97 | MapboxMapOptions mbmo = null;
98 | mapView = new MapView(context, mbmo);
99 | mapView.getMapAsync(this);
100 | MapView.LayoutParams lp = new MapView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
101 | ViewGroup.LayoutParams.MATCH_PARENT);
102 | mapView.setLayoutParams(lp);
103 | methodChannel = new MethodChannel(registrar.messenger(), "com.mapbox/mapboxgl_" + id);
104 | methodChannel.setMethodCallHandler(this);
105 | this.registrar = registrar;
106 | registrar.activity().getApplication().registerActivityLifecycleCallbacks(this);
107 | activityState = state;
108 | this.registrarActivityHashCode = registrar.activity().hashCode();
109 | }
110 |
111 | void init() {
112 | switch (activityState.get()) {
113 | case STOPPED:
114 | mapView.onCreate(null);
115 | mapView.onStart();
116 | mapView.onResume();
117 | mapView.onPause();
118 | mapView.onStop();
119 | break;
120 | case PAUSED:
121 | mapView.onCreate(null);
122 | mapView.onStart();
123 | mapView.onResume();
124 | mapView.onPause();
125 | break;
126 | case RESUMED:
127 | mapView.onCreate(null);
128 | mapView.onStart();
129 | mapView.onResume();
130 | break;
131 | case STARTED:
132 | mapView.onCreate(null);
133 | mapView.onStart();
134 | break;
135 | case CREATED:
136 | mapView.onCreate(null);
137 | break;
138 | case DESTROYED:
139 | // Nothing to do, the activity has been completely destroyed.
140 | break;
141 | default:
142 | throw new IllegalArgumentException(
143 | "Cannot interpret " + activityState.get() + " as an activity state");
144 | }
145 | registrar.activity().getApplication().registerActivityLifecycleCallbacks(this);
146 | mapView.getMapAsync(this);
147 | }
148 |
149 | @Override
150 | public void onMapReady(MapboxMap mbMap) {
151 | Log.d("MBGL","onMapReady");
152 | mapboxMap = mbMap;
153 |
154 | mapboxMap.addOnMapClickListener(this);
155 | }
156 |
157 | @SuppressWarnings({"MissingPermission"})
158 | private void enableLocationComponent() {
159 | // Check if permissions are enabled and if not request
160 | if (PermissionsManager.areLocationPermissionsGranted(context)) {
161 |
162 | LocationComponentOptions options = LocationComponentOptions.builder(context)
163 | .trackingGesturesManagement(true)
164 | // .accuracyColor(ContextCompat.getColor(context, R.color.mapboxGreen))
165 | // .accuracyColor(0x3887BE)
166 | .build();
167 |
168 | // Get an instance of the component
169 | LocationComponent locationComponent = mapboxMap.getLocationComponent();
170 |
171 | // Activate with options
172 | locationComponent.activateLocationComponent(context, options);
173 |
174 | // Enable to make component visible
175 | locationComponent.setLocationComponentEnabled(true);
176 |
177 | // Set the component's camera mode
178 | locationComponent.setCameraMode(CameraMode.TRACKING);
179 | locationComponent.setRenderMode(RenderMode.COMPASS);
180 | }
181 | }
182 |
183 | @Override
184 | public void onMapClick(@NonNull LatLng point) {
185 | PointF pointf = mapboxMap.getProjection().toScreenLocation(point);
186 | final Map arguments = new HashMap<>(5);
187 | arguments.put("x", pointf.x);
188 | arguments.put("y", pointf.y);
189 | arguments.put("lng", point.getLongitude());
190 | arguments.put("lat", point.getLatitude());
191 | methodChannel.invokeMethod("onTap", arguments);// map#onTap
192 | }
193 |
194 | // todo: MUST DEAL HERE WITH LIFECYCLE METHODS!
195 |
196 | @Override
197 | public View getView() {
198 | return mapView;
199 | }
200 |
201 | @Override
202 | public void onMethodCall(MethodCall methodCall, MethodChannel.Result result) {
203 | switch (methodCall.method) {
204 |
205 | case "showUserLocation": {
206 | enableLocationComponent();
207 | break;
208 | }
209 | case "setStyleUrl": {
210 | String styleUrl = (String) methodCall.arguments;
211 | mapboxMap.setStyleUrl(styleUrl);
212 | result.success(null);
213 | break;
214 | }
215 |
216 | case "getStyleUrl": {
217 | Map reply = new HashMap<>();
218 | reply.put("styleUrl", mapboxMap.getStyleUrl());
219 | result.success(reply);
220 | break;
221 | }
222 |
223 | //
224 | // Camera API
225 | //
226 |
227 | case "easeTo": {
228 | CameraPosition cameraPosition = parseCamera(methodCall.argument("camera"));
229 | int duration = intParamOfCall(methodCall, "duration");
230 | CameraUpdate cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition);
231 | mapboxMap.easeCamera(cameraUpdate, duration, true);
232 | result.success(null);
233 | break;
234 | }
235 |
236 | case "flyTo": {
237 | CameraPosition cameraPosition = parseCamera(methodCall.argument("camera"));
238 | int duration = intParamOfCall(methodCall, "duration");
239 | CameraUpdate cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition);
240 | mapboxMap.animateCamera(cameraUpdate, duration);
241 | result.success(null);
242 | break;
243 | }
244 |
245 | case "jumpTo": {
246 | CameraPosition cameraPosition = parseCamera(methodCall.argument("camera"));
247 | CameraUpdate cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition);
248 | mapboxMap.moveCamera(cameraUpdate);
249 | result.success(null);
250 | break;
251 | }
252 |
253 | case "zoom": {
254 |
255 | double zoom = doubleParamOfCall(methodCall, "zoom");
256 | int duration = intParamOfCall(methodCall, "duration");
257 |
258 | CameraPosition cameraPosition = new CameraPosition.Builder().zoom(zoom).build();
259 | CameraUpdate cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition);
260 | mapboxMap.easeCamera(cameraUpdate, duration, true);
261 | result.success(null);
262 | break;
263 | }
264 |
265 | case "queryRenderedFeatures": {
266 | Map reply = new HashMap<>();
267 | List features;
268 | String[] layerIds = stringListParamOfCall(methodCall,"layerIds");
269 | String filter = stringParamOfCall(methodCall,"filter");
270 | Expression filterExpression = filter == null ? null : new Expression(filter);
271 | if (methodCall.hasArgument("x")) {
272 | PointF pixel = screenPointParamOfCall(methodCall);
273 | features = mapboxMap.queryRenderedFeatures(pixel, filterExpression, layerIds);
274 | } else {
275 | RectF rectF = screenRectParamOfCall(methodCall);
276 | features = mapboxMap.queryRenderedFeatures(rectF, filterExpression, layerIds);
277 | }
278 | List featuresJson = new ArrayList<>();
279 | for (Feature feature : features) {
280 | featuresJson.add(feature.toJson());
281 | }
282 | reply.put("features", featuresJson);
283 | result.success(reply);
284 | break;
285 | }
286 |
287 | case "setLayerProperty": {
288 |
289 | setLayerProperty(methodCall,result);
290 | break;
291 | }
292 |
293 |
294 |
295 |
296 | // case "zoomBy": {
297 | // double zoomBy = doubleParamOfCall(methodCall, "zoomBy");
298 | // float x = floatParamOfCall(methodCall, "x");
299 | // float y = floatParamOfCall(methodCall, "y");
300 | // long duration = longParamOfCall(methodCall, "duration");
301 | // mapboxMap.zoom(mapboxMap.getZoom() + zoomBy, new PointF(x, y), duration);
302 | // result.success(null);
303 | // break;
304 | // }
305 |
306 | // case "getZoom": {
307 | // Map reply = new HashMap<>();
308 | // reply.put("zoom", mapboxMap.getZoom());
309 | // result.success(reply);
310 | // break;
311 | // }
312 |
313 | // case "getMinZoom": {
314 | // Map reply = new HashMap<>();
315 | // reply.put("zoom", mapboxMap.getMinZoom());
316 | // result.success(reply);
317 | // break;
318 | // }
319 |
320 | // case "setMinZoom": {
321 | // double zoom = doubleParamOfCall(methodCall, "zoom");
322 | // mapboxMap.setMinZoom(zoom);
323 | // result.success(null);
324 | // break;
325 | // }
326 |
327 | // case "getMaxZoom": {
328 | // Map reply = new HashMap<>();
329 | // reply.put("zoom", mapboxMap.getMaxZoomLevel());
330 | // result.success(reply);
331 | // break;
332 | // }
333 |
334 | // case "setMaxZoom": {
335 | // double zoom = doubleParamOfCall(methodCall, "zoom");
336 | // mapboxMap.setMaxZoomPreference(zoom);
337 | // result.success(null);
338 | // break;
339 | // }
340 |
341 | default:
342 | result.notImplemented();
343 | }
344 |
345 | }
346 |
347 |
348 | void setLayerProperty(MethodCall methodCall, MethodChannel.Result result){
349 |
350 | //dart code:
351 | // await _channel.invokeMethod(
352 | // 'propertyName',
353 | // {
354 | // 'layer': layer,
355 | // 'propertyName': propertyName,
356 | // 'value': value,
357 | // 'options': options, //if we cannot transfer a map, we should convert this to JSON
358 | // },
359 | // );
360 |
361 | Log.d("dddd","setLayerProperty");
362 | String layerId = stringParamOfCall(methodCall, "layer");
363 | String propertyName = stringParamOfCall(methodCall, "propertyName");
364 |
365 | Layer layer = mapboxMap.getLayer(layerId);
366 |
367 | if(layer==null){
368 | result.error("0","layer "+layerId+" not found.",null);
369 | return;
370 | }
371 |
372 | if(propertyName.equals("visibility")){
373 | String value = "";
374 | try {
375 | value = (String) methodCall.argument("value");
376 | }
377 | catch (ClassCastException cce){
378 | result.error("0","cast exception thrown - value of visibility should be a String. in layer:"+layerId+".",null);
379 | return;
380 | }
381 | if(value.equals("visible"))
382 | layer.setProperties(visibility(VISIBLE));
383 | else if(value.equals("none"))
384 | layer.setProperties(visibility(NONE));
385 | else{
386 | result.error("0","value of visibility should be 'visible' or 'none', received value:"+value+".",null);
387 | return;
388 | }
389 | }
390 | else{
391 | result.error("0","property "+propertyName+" not implemented.",null);
392 | return;
393 | }
394 |
395 | result.success(null);
396 | }
397 |
398 |
399 | // Utils. should be refractored.
400 | private boolean booleanParamOfCall(MethodCall call, String param) {
401 | return Boolean.parseBoolean(call.argument(param));
402 | }
403 |
404 | private double doubleParamOfCall(MethodCall call, String param) {
405 | return ((Number) call.argument(param)).doubleValue();
406 | }
407 |
408 | private float floatParamOfCall(MethodCall call, String param) {
409 | return ((Number) call.argument(param)).floatValue();
410 | }
411 |
412 | private int intParamOfCall(MethodCall call, String param) {
413 | return ((Number) call.argument(param)).intValue();
414 | }
415 |
416 | private long longParamOfCall(MethodCall call, String param) {
417 | return ((Number) call.argument(param)).longValue();
418 | }
419 |
420 | private String stringParamOfCall(MethodCall call, String param) {
421 | return (String) call.argument(param);
422 | }
423 |
424 | private PointF screenPointParamOfCall(MethodCall call) {
425 | Double x = call.argument("x");
426 | Double y = call.argument("y");
427 | return new PointF(x.floatValue(), y.floatValue());
428 | }
429 |
430 | private RectF screenRectParamOfCall(MethodCall call) {
431 | Double left = call.argument("left");
432 | Double top = call.argument("top");
433 | Double right = call.argument("right");
434 | Double bottom = call.argument("bottom");
435 | return new RectF(left.floatValue(), top.floatValue(), right.floatValue(), bottom.floatValue());
436 | }
437 |
438 | private String[] stringListParamOfCall(MethodCall call, String param) {
439 | ArrayList arrayList = (ArrayList) call.argument(param);
440 | return arrayList == null ? null : arrayList.toArray(new String[arrayList.size()]);
441 | }
442 |
443 |
444 | private MapboxMapOptions parseOptions(Map options) {
445 |
446 | String style = (String) options.get("style");
447 | if (style == null) {
448 | style = Style.MAPBOX_STREETS;
449 | }
450 | MapboxMapOptions mapOptions = new MapboxMapOptions().styleUrl(style);
451 |
452 | Map camera = (Map) options.get("camera");
453 | if (camera != null) {
454 | mapOptions.camera(parseCamera(camera));
455 | }
456 | return mapOptions;
457 | }
458 |
459 | private CameraPosition parseCamera(Map camera) {
460 | CameraPosition.Builder cameraPosition = new CameraPosition.Builder();
461 |
462 | LatLng target = parseLatLng((Map) camera.get("target"));
463 | if (target != null) {
464 | cameraPosition.target(target);
465 | }
466 |
467 | Double zoom = (Double) camera.get("zoom");
468 | if (zoom != null) {
469 | cameraPosition.zoom(zoom);
470 | }
471 |
472 | Double bearing = (Double) camera.get("bearing");
473 | if (bearing != null) {
474 | cameraPosition.bearing(bearing);
475 | }
476 |
477 | Double tilt = (Double) camera.get("tilt");
478 | if (tilt != null) {
479 | cameraPosition.tilt(tilt);
480 | }
481 |
482 | return cameraPosition.build();
483 | }
484 |
485 | private LatLng parseLatLng(Map target) {
486 | if (target.containsKey("lat") && target.containsKey("lng")) {
487 | return new LatLng(((Number) target.get("lat")).doubleValue(), ((Number) target.get("lng")).doubleValue());
488 | }
489 | return null;
490 | }
491 |
492 |
493 |
494 | @Override
495 | public void dispose() {
496 | if (disposed) {
497 | return;
498 | }
499 | disposed = true;
500 | mapView.onDestroy();
501 | registrar.activity().getApplication().unregisterActivityLifecycleCallbacks(this);
502 | }
503 |
504 |
505 |
506 |
507 |
508 | @Override
509 | public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
510 | Log.d("dddd","onactivitycreated");
511 | if (disposed || activity.hashCode() != registrarActivityHashCode) {
512 | return;
513 | }
514 | mapView.onCreate(savedInstanceState);
515 | }
516 |
517 | @Override
518 | public void onActivityStarted(Activity activity) {
519 | Log.d("dddd","onActivityStarted");
520 | if (disposed || activity.hashCode() != registrarActivityHashCode) {
521 | return;
522 | }
523 | mapView.onStart();
524 | }
525 |
526 | @Override
527 | public void onActivityResumed(Activity activity) {
528 | Log.d("dddd","onActivityResumed");
529 | if (disposed || activity.hashCode() != registrarActivityHashCode) {
530 | return;
531 | }
532 | mapView.onResume();
533 | }
534 |
535 | @Override
536 | public void onActivityPaused(Activity activity) {
537 | if (disposed || activity.hashCode() != registrarActivityHashCode) {
538 | return;
539 | }
540 | mapView.onPause();
541 | }
542 |
543 | @Override
544 | public void onActivityStopped(Activity activity) {
545 | if (disposed || activity.hashCode() != registrarActivityHashCode) {
546 | return;
547 | }
548 | mapView.onStop();
549 | }
550 |
551 | @Override
552 | public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
553 | if (disposed || activity.hashCode() != registrarActivityHashCode) {
554 | return;
555 | }
556 | mapView.onSaveInstanceState(outState);
557 | }
558 |
559 | @Override
560 | public void onActivityDestroyed(Activity activity) {
561 | if (disposed || activity.hashCode() != registrarActivityHashCode) {
562 | return;
563 | }
564 | mapView.onDestroy();
565 | }
566 |
567 |
568 |
569 | }
570 |
--------------------------------------------------------------------------------
/android/src/main/java/com/mapbox/mapboxgl/MapViewFactory.java:
--------------------------------------------------------------------------------
1 | package com.mapbox.mapboxgl;
2 |
3 | import android.content.Context;
4 |
5 | import java.util.concurrent.atomic.AtomicInteger;
6 |
7 | import io.flutter.plugin.common.BinaryMessenger;
8 | import io.flutter.plugin.common.StandardMessageCodec;
9 | import io.flutter.plugin.platform.PlatformView;
10 | import io.flutter.plugin.platform.PlatformViewFactory;
11 | import io.flutter.plugin.common.PluginRegistry;
12 |
13 | public class MapViewFactory extends PlatformViewFactory {
14 | private final AtomicInteger mActivityState;
15 | private final PluginRegistry.Registrar registrar;
16 |
17 | public MapViewFactory(AtomicInteger state, PluginRegistry.Registrar registrar) {
18 | super(StandardMessageCodec.INSTANCE);
19 | mActivityState = state;
20 | this.registrar = registrar;
21 | }
22 |
23 | @Override
24 | public PlatformView create(Context context, int id, Object o) {
25 | FlutterMapView fmv = new FlutterMapView(context, mActivityState, registrar, id);
26 | fmv.init();
27 | return fmv;
28 | }
29 | }
--------------------------------------------------------------------------------
/android/src/main/java/com/mapbox/mapboxgl/MapboxGlPlugin.java:
--------------------------------------------------------------------------------
1 | package com.mapbox.mapboxgl;
2 |
3 | import android.app.Activity;
4 | import android.app.Application;
5 | import android.os.Bundle;
6 |
7 | import java.util.concurrent.atomic.AtomicInteger;
8 |
9 | import io.flutter.plugin.common.PluginRegistry.Registrar;
10 |
11 | public class MapboxGlPlugin implements Application.ActivityLifecycleCallbacks {
12 |
13 |
14 | static final int CREATED = 1;
15 | static final int STARTED = 2;
16 | static final int RESUMED = 3;
17 | static final int PAUSED = 4;
18 | static final int STOPPED = 5;
19 | static final int DESTROYED = 6;
20 | private final AtomicInteger state = new AtomicInteger(0);
21 | private final int registrarActivityHashCode;
22 |
23 |
24 |
25 |
26 |
27 |
28 | public static void registerWith(Registrar registrar) {
29 |
30 | final MapboxGlPlugin plugin = new MapboxGlPlugin(registrar);
31 | registrar.activity().getApplication().registerActivityLifecycleCallbacks(plugin);
32 |
33 | registrar
34 | .platformViewRegistry()
35 | .registerViewFactory(
36 | "com.mapbox/mapboxgl", new MapViewFactory(plugin.state, registrar));
37 | }
38 |
39 |
40 | private MapboxGlPlugin(Registrar registrar) {
41 | this.registrarActivityHashCode = registrar.activity().hashCode();
42 | }
43 |
44 |
45 |
46 | @Override
47 | public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
48 | if (activity.hashCode() != registrarActivityHashCode) {
49 | return;
50 | }
51 | state.set(CREATED);
52 | }
53 |
54 | @Override
55 | public void onActivityStarted(Activity activity) {
56 | if (activity.hashCode() != registrarActivityHashCode) {
57 | return;
58 | }
59 | state.set(STARTED);
60 | }
61 |
62 | @Override
63 | public void onActivityResumed(Activity activity) {
64 | if (activity.hashCode() != registrarActivityHashCode) {
65 | return;
66 | }
67 | state.set(RESUMED);
68 | }
69 |
70 | @Override
71 | public void onActivityPaused(Activity activity) {
72 | if (activity.hashCode() != registrarActivityHashCode) {
73 | return;
74 | }
75 | state.set(PAUSED);
76 | }
77 |
78 | @Override
79 | public void onActivityStopped(Activity activity) {
80 | if (activity.hashCode() != registrarActivityHashCode) {
81 | return;
82 | }
83 | state.set(STOPPED);
84 | }
85 |
86 | @Override
87 | public void onActivitySaveInstanceState(Activity activity, Bundle outState) {}
88 |
89 | @Override
90 | public void onActivityDestroyed(Activity activity) {
91 | if (activity.hashCode() != registrarActivityHashCode) {
92 | return;
93 | }
94 | state.set(DESTROYED);
95 | }
96 |
97 |
98 | }
99 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.lock
4 | *.log
5 | *.pyc
6 | *.swp
7 | .DS_Store
8 | .atom/
9 | .buildlog/
10 | .history
11 | .svn/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # Visual Studio Code related
20 | .vscode/
21 |
22 | # Flutter/Dart/Pub related
23 | **/doc/api/
24 | .dart_tool/
25 | .flutter-plugins
26 | .packages
27 | .pub-cache/
28 | .pub/
29 | build/
30 |
31 | # Android related
32 | **/android/**/gradle-wrapper.jar
33 | **/android/.gradle
34 | **/android/captures/
35 | **/android/gradlew
36 | **/android/gradlew.bat
37 | **/android/local.properties
38 | **/android/**/GeneratedPluginRegistrant.java
39 |
40 | # iOS/XCode related
41 | **/ios/**/*.mode1v3
42 | **/ios/**/*.mode2v3
43 | **/ios/**/*.moved-aside
44 | **/ios/**/*.pbxuser
45 | **/ios/**/*.perspectivev3
46 | **/ios/**/*sync/
47 | **/ios/**/.sconsign.dblite
48 | **/ios/**/.tags*
49 | **/ios/**/.vagrant/
50 | **/ios/**/DerivedData/
51 | **/ios/**/Icon?
52 | **/ios/**/Pods/
53 | **/ios/**/.symlinks/
54 | **/ios/**/profile
55 | **/ios/**/xcuserdata
56 | **/ios/.generated/
57 | **/ios/Flutter/App.framework
58 | **/ios/Flutter/Flutter.framework
59 | **/ios/Flutter/Generated.xcconfig
60 | **/ios/Flutter/app.flx
61 | **/ios/Flutter/app.zip
62 | **/ios/Flutter/flutter_assets/
63 | **/ios/ServiceDefinitions.json
64 | **/ios/Runner/GeneratedPluginRegistrant.*
65 |
66 | # Exceptions to above rules.
67 | !**/ios/**/default.mode1v3
68 | !**/ios/**/default.mode2v3
69 | !**/ios/**/default.pbxuser
70 | !**/ios/**/default.perspectivev3
71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
72 |
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 2e2f19d3e9dd9bbc4e97e6b79bd573ab67c65109
8 | channel: master
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # mapbox_gl_example
2 |
3 | Demonstrates how to use the mapbox_gl plugin.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.io/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.class
3 | .gradle
4 | /local.properties
5 | /.idea/workspace.xml
6 | /.idea/libraries
7 | .DS_Store
8 | /build
9 | /captures
10 | GeneratedPluginRegistrant.java
11 |
--------------------------------------------------------------------------------
/example/android/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | android
4 | Project android created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.buildship.core.gradleprojectbuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/example/android/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.project.dir=
2 | eclipse.preferences.version=1
3 |
--------------------------------------------------------------------------------
/example/android/app/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/example/android/app/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | app
4 | Project app created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.buildship.core.gradleprojectbuilder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.buildship.core.gradleprojectnature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/example/android/app/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.project.dir=..
2 | eclipse.preferences.version=1
3 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26 |
27 | android {
28 | compileSdkVersion 27
29 |
30 | lintOptions {
31 | disable 'InvalidPackage'
32 | }
33 |
34 | defaultConfig {
35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
36 | applicationId "com.mapbox.mapboxglexample"
37 | minSdkVersion 16
38 | targetSdkVersion 27
39 | versionCode flutterVersionCode.toInteger()
40 | versionName flutterVersionName
41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
42 | }
43 |
44 | buildTypes {
45 | release {
46 | // TODO: Add your own signing config for the release build.
47 | // Signing with the debug keys for now, so `flutter run --release` works.
48 | signingConfig signingConfigs.debug
49 | }
50 | }
51 | }
52 |
53 | flutter {
54 | source '../..'
55 | }
56 |
57 | dependencies {
58 | testImplementation 'junit:junit:4.12'
59 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
61 | }
62 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
15 |
19 |
20 |
27 |
31 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/mapbox/mapboxglexample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.mapbox.mapboxglexample;
2 |
3 | import android.os.Bundle;
4 | import io.flutter.app.FlutterActivity;
5 | import io.flutter.plugins.GeneratedPluginRegistrant;
6 |
7 | public class MainActivity extends FlutterActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | GeneratedPluginRegistrant.registerWith(this);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.2.1'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | jcenter()
16 | }
17 | }
18 |
19 | rootProject.buildDir = '../build'
20 | subprojects {
21 | project.buildDir = "${rootProject.buildDir}/${project.name}"
22 | }
23 | subprojects {
24 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
7 |
--------------------------------------------------------------------------------
/example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def parse_KV_file(file, separator='=')
14 | file_abs_path = File.expand_path(file)
15 | if !File.exists? file_abs_path
16 | return [];
17 | end
18 | pods_ary = []
19 | skip_line_start_symbols = ["#", "/"]
20 | File.foreach(file_abs_path) { |line|
21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22 | plugin = line.split(pattern=separator)
23 | if plugin.length == 2
24 | podname = plugin[0].strip()
25 | path = plugin[1].strip()
26 | podpath = File.expand_path("#{path}", file_abs_path)
27 | pods_ary.push({:name => podname, :path => podpath});
28 | else
29 | puts "Invalid plugin specification: #{line}"
30 | end
31 | }
32 | return pods_ary
33 | end
34 |
35 | target 'Runner' do
36 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
37 | # referring to absolute paths on developers' machines.
38 | system('rm -rf .symlinks')
39 | system('mkdir -p .symlinks/plugins')
40 |
41 | # Flutter Pods
42 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
43 | if generated_xcode_build_settings.empty?
44 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
45 | end
46 | generated_xcode_build_settings.map { |p|
47 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
48 | symlink = File.join('.symlinks', 'flutter')
49 | File.symlink(File.dirname(p[:path]), symlink)
50 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
51 | end
52 | }
53 |
54 | # Plugin Pods
55 | plugin_pods = parse_KV_file('../.flutter-plugins')
56 | plugin_pods.map { |p|
57 | symlink = File.join('.symlinks', 'plugins', p[:name])
58 | File.symlink(p[:path], symlink)
59 | pod p[:name], :path => File.join(symlink, 'ios')
60 | }
61 | end
62 |
63 | post_install do |installer|
64 | installer.pods_project.targets.each do |target|
65 | target.build_configurations.each do |config|
66 | config.build_settings['ENABLE_BITCODE'] = 'NO'
67 | end
68 | end
69 | end
70 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
18 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
19 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
20 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
21 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
22 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
23 | /* End PBXBuildFile section */
24 |
25 | /* Begin PBXCopyFilesBuildPhase section */
26 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
27 | isa = PBXCopyFilesBuildPhase;
28 | buildActionMask = 2147483647;
29 | dstPath = "";
30 | dstSubfolderSpec = 10;
31 | files = (
32 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
33 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
34 | );
35 | name = "Embed Frameworks";
36 | runOnlyForDeploymentPostprocessing = 0;
37 | };
38 | /* End PBXCopyFilesBuildPhase section */
39 |
40 | /* Begin PBXFileReference section */
41 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
42 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
43 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
44 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
45 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
46 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
47 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
48 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
49 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
50 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
51 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
52 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
54 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
55 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
56 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
57 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
58 | /* End PBXFileReference section */
59 |
60 | /* Begin PBXFrameworksBuildPhase section */
61 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
62 | isa = PBXFrameworksBuildPhase;
63 | buildActionMask = 2147483647;
64 | files = (
65 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
66 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
67 | );
68 | runOnlyForDeploymentPostprocessing = 0;
69 | };
70 | /* End PBXFrameworksBuildPhase section */
71 |
72 | /* Begin PBXGroup section */
73 | 9740EEB11CF90186004384FC /* Flutter */ = {
74 | isa = PBXGroup;
75 | children = (
76 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
77 | 3B80C3931E831B6300D905FE /* App.framework */,
78 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
79 | 9740EEBA1CF902C7004384FC /* Flutter.framework */,
80 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
81 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
82 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
83 | );
84 | name = Flutter;
85 | sourceTree = "";
86 | };
87 | 97C146E51CF9000F007C117D = {
88 | isa = PBXGroup;
89 | children = (
90 | 9740EEB11CF90186004384FC /* Flutter */,
91 | 97C146F01CF9000F007C117D /* Runner */,
92 | 97C146EF1CF9000F007C117D /* Products */,
93 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
94 | );
95 | sourceTree = "";
96 | };
97 | 97C146EF1CF9000F007C117D /* Products */ = {
98 | isa = PBXGroup;
99 | children = (
100 | 97C146EE1CF9000F007C117D /* Runner.app */,
101 | );
102 | name = Products;
103 | sourceTree = "";
104 | };
105 | 97C146F01CF9000F007C117D /* Runner */ = {
106 | isa = PBXGroup;
107 | children = (
108 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
109 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
110 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
111 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
112 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
113 | 97C147021CF9000F007C117D /* Info.plist */,
114 | 97C146F11CF9000F007C117D /* Supporting Files */,
115 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
116 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
117 | );
118 | path = Runner;
119 | sourceTree = "";
120 | };
121 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
122 | isa = PBXGroup;
123 | children = (
124 | 97C146F21CF9000F007C117D /* main.m */,
125 | );
126 | name = "Supporting Files";
127 | sourceTree = "";
128 | };
129 | /* End PBXGroup section */
130 |
131 | /* Begin PBXNativeTarget section */
132 | 97C146ED1CF9000F007C117D /* Runner */ = {
133 | isa = PBXNativeTarget;
134 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
135 | buildPhases = (
136 | 9740EEB61CF901F6004384FC /* Run Script */,
137 | 97C146EA1CF9000F007C117D /* Sources */,
138 | 97C146EB1CF9000F007C117D /* Frameworks */,
139 | 97C146EC1CF9000F007C117D /* Resources */,
140 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
141 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
142 | );
143 | buildRules = (
144 | );
145 | dependencies = (
146 | );
147 | name = Runner;
148 | productName = Runner;
149 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
150 | productType = "com.apple.product-type.application";
151 | };
152 | /* End PBXNativeTarget section */
153 |
154 | /* Begin PBXProject section */
155 | 97C146E61CF9000F007C117D /* Project object */ = {
156 | isa = PBXProject;
157 | attributes = {
158 | LastUpgradeCheck = 0910;
159 | ORGANIZATIONNAME = "The Chromium Authors";
160 | TargetAttributes = {
161 | 97C146ED1CF9000F007C117D = {
162 | CreatedOnToolsVersion = 7.3.1;
163 | };
164 | };
165 | };
166 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
167 | compatibilityVersion = "Xcode 3.2";
168 | developmentRegion = English;
169 | hasScannedForEncodings = 0;
170 | knownRegions = (
171 | en,
172 | Base,
173 | );
174 | mainGroup = 97C146E51CF9000F007C117D;
175 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
176 | projectDirPath = "";
177 | projectRoot = "";
178 | targets = (
179 | 97C146ED1CF9000F007C117D /* Runner */,
180 | );
181 | };
182 | /* End PBXProject section */
183 |
184 | /* Begin PBXResourcesBuildPhase section */
185 | 97C146EC1CF9000F007C117D /* Resources */ = {
186 | isa = PBXResourcesBuildPhase;
187 | buildActionMask = 2147483647;
188 | files = (
189 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
190 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
191 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
192 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
193 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
194 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
195 | );
196 | runOnlyForDeploymentPostprocessing = 0;
197 | };
198 | /* End PBXResourcesBuildPhase section */
199 |
200 | /* Begin PBXShellScriptBuildPhase section */
201 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
202 | isa = PBXShellScriptBuildPhase;
203 | buildActionMask = 2147483647;
204 | files = (
205 | );
206 | inputPaths = (
207 | );
208 | name = "Thin Binary";
209 | outputPaths = (
210 | );
211 | runOnlyForDeploymentPostprocessing = 0;
212 | shellPath = /bin/sh;
213 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
214 | };
215 | 9740EEB61CF901F6004384FC /* Run Script */ = {
216 | isa = PBXShellScriptBuildPhase;
217 | buildActionMask = 2147483647;
218 | files = (
219 | );
220 | inputPaths = (
221 | );
222 | name = "Run Script";
223 | outputPaths = (
224 | );
225 | runOnlyForDeploymentPostprocessing = 0;
226 | shellPath = /bin/sh;
227 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
228 | };
229 | /* End PBXShellScriptBuildPhase section */
230 |
231 | /* Begin PBXSourcesBuildPhase section */
232 | 97C146EA1CF9000F007C117D /* Sources */ = {
233 | isa = PBXSourcesBuildPhase;
234 | buildActionMask = 2147483647;
235 | files = (
236 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
237 | 97C146F31CF9000F007C117D /* main.m in Sources */,
238 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
239 | );
240 | runOnlyForDeploymentPostprocessing = 0;
241 | };
242 | /* End PBXSourcesBuildPhase section */
243 |
244 | /* Begin PBXVariantGroup section */
245 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
246 | isa = PBXVariantGroup;
247 | children = (
248 | 97C146FB1CF9000F007C117D /* Base */,
249 | );
250 | name = Main.storyboard;
251 | sourceTree = "";
252 | };
253 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
254 | isa = PBXVariantGroup;
255 | children = (
256 | 97C147001CF9000F007C117D /* Base */,
257 | );
258 | name = LaunchScreen.storyboard;
259 | sourceTree = "";
260 | };
261 | /* End PBXVariantGroup section */
262 |
263 | /* Begin XCBuildConfiguration section */
264 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
265 | isa = XCBuildConfiguration;
266 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
267 | buildSettings = {
268 | ALWAYS_SEARCH_USER_PATHS = NO;
269 | CLANG_ANALYZER_NONNULL = YES;
270 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
271 | CLANG_CXX_LIBRARY = "libc++";
272 | CLANG_ENABLE_MODULES = YES;
273 | CLANG_ENABLE_OBJC_ARC = YES;
274 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
275 | CLANG_WARN_BOOL_CONVERSION = YES;
276 | CLANG_WARN_COMMA = YES;
277 | CLANG_WARN_CONSTANT_CONVERSION = YES;
278 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
279 | CLANG_WARN_EMPTY_BODY = YES;
280 | CLANG_WARN_ENUM_CONVERSION = YES;
281 | CLANG_WARN_INFINITE_RECURSION = YES;
282 | CLANG_WARN_INT_CONVERSION = YES;
283 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
284 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
285 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
286 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
287 | CLANG_WARN_STRICT_PROTOTYPES = YES;
288 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
289 | CLANG_WARN_UNREACHABLE_CODE = YES;
290 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
291 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
292 | COPY_PHASE_STRIP = NO;
293 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
294 | ENABLE_NS_ASSERTIONS = NO;
295 | ENABLE_STRICT_OBJC_MSGSEND = YES;
296 | GCC_C_LANGUAGE_STANDARD = gnu99;
297 | GCC_NO_COMMON_BLOCKS = YES;
298 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
299 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
300 | GCC_WARN_UNDECLARED_SELECTOR = YES;
301 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
302 | GCC_WARN_UNUSED_FUNCTION = YES;
303 | GCC_WARN_UNUSED_VARIABLE = YES;
304 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
305 | MTL_ENABLE_DEBUG_INFO = NO;
306 | SDKROOT = iphoneos;
307 | TARGETED_DEVICE_FAMILY = "1,2";
308 | VALIDATE_PRODUCT = YES;
309 | };
310 | name = Profile;
311 | };
312 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
313 | isa = XCBuildConfiguration;
314 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
315 | buildSettings = {
316 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
317 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
318 | DEVELOPMENT_TEAM = S8QB4VV633;
319 | ENABLE_BITCODE = NO;
320 | FRAMEWORK_SEARCH_PATHS = (
321 | "$(inherited)",
322 | "$(PROJECT_DIR)/Flutter",
323 | );
324 | INFOPLIST_FILE = Runner/Info.plist;
325 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
326 | LIBRARY_SEARCH_PATHS = (
327 | "$(inherited)",
328 | "$(PROJECT_DIR)/Flutter",
329 | );
330 | PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.mapboxGlExample;
331 | PRODUCT_NAME = "$(TARGET_NAME)";
332 | VERSIONING_SYSTEM = "apple-generic";
333 | };
334 | name = Profile;
335 | };
336 | 97C147031CF9000F007C117D /* Debug */ = {
337 | isa = XCBuildConfiguration;
338 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
339 | buildSettings = {
340 | ALWAYS_SEARCH_USER_PATHS = NO;
341 | CLANG_ANALYZER_NONNULL = YES;
342 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
343 | CLANG_CXX_LIBRARY = "libc++";
344 | CLANG_ENABLE_MODULES = YES;
345 | CLANG_ENABLE_OBJC_ARC = YES;
346 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
347 | CLANG_WARN_BOOL_CONVERSION = YES;
348 | CLANG_WARN_COMMA = YES;
349 | CLANG_WARN_CONSTANT_CONVERSION = YES;
350 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
351 | CLANG_WARN_EMPTY_BODY = YES;
352 | CLANG_WARN_ENUM_CONVERSION = YES;
353 | CLANG_WARN_INFINITE_RECURSION = YES;
354 | CLANG_WARN_INT_CONVERSION = YES;
355 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
356 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
357 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
358 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
359 | CLANG_WARN_STRICT_PROTOTYPES = YES;
360 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
361 | CLANG_WARN_UNREACHABLE_CODE = YES;
362 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
363 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
364 | COPY_PHASE_STRIP = NO;
365 | DEBUG_INFORMATION_FORMAT = dwarf;
366 | ENABLE_STRICT_OBJC_MSGSEND = YES;
367 | ENABLE_TESTABILITY = YES;
368 | GCC_C_LANGUAGE_STANDARD = gnu99;
369 | GCC_DYNAMIC_NO_PIC = NO;
370 | GCC_NO_COMMON_BLOCKS = YES;
371 | GCC_OPTIMIZATION_LEVEL = 0;
372 | GCC_PREPROCESSOR_DEFINITIONS = (
373 | "DEBUG=1",
374 | "$(inherited)",
375 | );
376 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
377 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
378 | GCC_WARN_UNDECLARED_SELECTOR = YES;
379 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
380 | GCC_WARN_UNUSED_FUNCTION = YES;
381 | GCC_WARN_UNUSED_VARIABLE = YES;
382 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
383 | MTL_ENABLE_DEBUG_INFO = YES;
384 | ONLY_ACTIVE_ARCH = YES;
385 | SDKROOT = iphoneos;
386 | TARGETED_DEVICE_FAMILY = "1,2";
387 | };
388 | name = Debug;
389 | };
390 | 97C147041CF9000F007C117D /* Release */ = {
391 | isa = XCBuildConfiguration;
392 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
393 | buildSettings = {
394 | ALWAYS_SEARCH_USER_PATHS = NO;
395 | CLANG_ANALYZER_NONNULL = YES;
396 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
397 | CLANG_CXX_LIBRARY = "libc++";
398 | CLANG_ENABLE_MODULES = YES;
399 | CLANG_ENABLE_OBJC_ARC = YES;
400 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
401 | CLANG_WARN_BOOL_CONVERSION = YES;
402 | CLANG_WARN_COMMA = YES;
403 | CLANG_WARN_CONSTANT_CONVERSION = YES;
404 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
405 | CLANG_WARN_EMPTY_BODY = YES;
406 | CLANG_WARN_ENUM_CONVERSION = YES;
407 | CLANG_WARN_INFINITE_RECURSION = YES;
408 | CLANG_WARN_INT_CONVERSION = YES;
409 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
410 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
413 | CLANG_WARN_STRICT_PROTOTYPES = YES;
414 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
415 | CLANG_WARN_UNREACHABLE_CODE = YES;
416 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
417 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
418 | COPY_PHASE_STRIP = NO;
419 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
420 | ENABLE_NS_ASSERTIONS = NO;
421 | ENABLE_STRICT_OBJC_MSGSEND = YES;
422 | GCC_C_LANGUAGE_STANDARD = gnu99;
423 | GCC_NO_COMMON_BLOCKS = YES;
424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
426 | GCC_WARN_UNDECLARED_SELECTOR = YES;
427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
428 | GCC_WARN_UNUSED_FUNCTION = YES;
429 | GCC_WARN_UNUSED_VARIABLE = YES;
430 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
431 | MTL_ENABLE_DEBUG_INFO = NO;
432 | SDKROOT = iphoneos;
433 | TARGETED_DEVICE_FAMILY = "1,2";
434 | VALIDATE_PRODUCT = YES;
435 | };
436 | name = Release;
437 | };
438 | 97C147061CF9000F007C117D /* Debug */ = {
439 | isa = XCBuildConfiguration;
440 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
441 | buildSettings = {
442 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
443 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
444 | ENABLE_BITCODE = NO;
445 | FRAMEWORK_SEARCH_PATHS = (
446 | "$(inherited)",
447 | "$(PROJECT_DIR)/Flutter",
448 | );
449 | INFOPLIST_FILE = Runner/Info.plist;
450 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
451 | LIBRARY_SEARCH_PATHS = (
452 | "$(inherited)",
453 | "$(PROJECT_DIR)/Flutter",
454 | );
455 | PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.flutterMapboxGlExample;
456 | PRODUCT_NAME = "$(TARGET_NAME)";
457 | VERSIONING_SYSTEM = "apple-generic";
458 | };
459 | name = Debug;
460 | };
461 | 97C147071CF9000F007C117D /* Release */ = {
462 | isa = XCBuildConfiguration;
463 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
464 | buildSettings = {
465 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
466 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
467 | ENABLE_BITCODE = NO;
468 | FRAMEWORK_SEARCH_PATHS = (
469 | "$(inherited)",
470 | "$(PROJECT_DIR)/Flutter",
471 | );
472 | INFOPLIST_FILE = Runner/Info.plist;
473 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
474 | LIBRARY_SEARCH_PATHS = (
475 | "$(inherited)",
476 | "$(PROJECT_DIR)/Flutter",
477 | );
478 | PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.mapboxGlExample;
479 | PRODUCT_NAME = "$(TARGET_NAME)";
480 | VERSIONING_SYSTEM = "apple-generic";
481 | };
482 | name = Release;
483 | };
484 | /* End XCBuildConfiguration section */
485 |
486 | /* Begin XCConfigurationList section */
487 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
488 | isa = XCConfigurationList;
489 | buildConfigurations = (
490 | 97C147031CF9000F007C117D /* Debug */,
491 | 97C147041CF9000F007C117D /* Release */,
492 | 249021D3217E4FDB00AE95B9 /* Profile */,
493 | );
494 | defaultConfigurationIsVisible = 0;
495 | defaultConfigurationName = Release;
496 | };
497 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
498 | isa = XCConfigurationList;
499 | buildConfigurations = (
500 | 97C147061CF9000F007C117D /* Debug */,
501 | 97C147071CF9000F007C117D /* Release */,
502 | 249021D4217E4FDB00AE95B9 /* Profile */,
503 | );
504 | defaultConfigurationIsVisible = 0;
505 | defaultConfigurationName = Release;
506 | };
507 | /* End XCConfigurationList section */
508 | };
509 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
510 | }
511 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
56 |
58 |
64 |
65 |
66 |
67 |
68 |
69 |
75 |
77 |
83 |
84 |
85 |
86 |
88 |
89 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | [GeneratedPluginRegistrant registerWithRegistry:self];
9 | // Override point for customization after application launch.
10 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | mapbox_gl_example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/example/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char* argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:mapbox_gl/mapbox_gl.dart';
3 |
4 | void main() => runApp(MaterialApp(home: MapboxExample()));
5 |
6 | class MapboxExample extends StatefulWidget {
7 | @override
8 | MapboxExampleState createState() {
9 | return new MapboxExampleState();
10 | }
11 | }
12 |
13 | class MapboxExampleState extends State {
14 | MapViewController controller;
15 |
16 | void _onMapViewCreated(MapViewController controller) {
17 | this.controller = controller;
18 | }
19 |
20 | @override
21 | Widget build(BuildContext context) {
22 | return Scaffold(
23 | appBar: AppBar(title: const Text('Flutter MapView example')),
24 | body: Stack(children: [
25 | MapView(
26 | onMapViewCreated: _onMapViewCreated,
27 | onTap: (point, coords) async {
28 | List ls = await controller.queryRenderedFeatures(point, ['LayerName'], null);
29 | print("queryRenderedFeatures test $ls");
30 | },
31 | ),
32 | Column(
33 | children: [
34 | RaisedButton(
35 | child: Text('Show User Location'),
36 | onPressed: () async {
37 | //check permissions before this, or turn them on manually.
38 | controller.showUserLocation();
39 | },
40 | ),
41 | RaisedButton(
42 | child: Text('getStyle'),
43 | onPressed: () async {
44 | print(await controller.getStyleUrl());
45 | },
46 | ),
47 | RaisedButton(
48 | child: Text('setStyle'),
49 | onPressed: () async {
50 | controller.setStyleUrl("mapbox://styles/mapbox/satellite-v9");
51 | },
52 | ),
53 | RaisedButton(
54 | child: Text('at ease'),
55 | onPressed: () async {
56 | // controller.easeTo(Camera(target: LatLng(lat: 32, lng: 35), zoom: 12), 2000);
57 | controller.easeTo(Camera(target: LatLng(lat: 32, lng: 35)), 2000);
58 | },
59 | ),
60 | RaisedButton(
61 | child: Text('fly to'),
62 | onPressed: () async {
63 | controller.flyTo(Camera(target: LatLng(lat: 32, lng: 35)), 2000);
64 | },
65 | ),
66 | RaisedButton(
67 | child: Text('zoom only'),
68 | onPressed: () async {
69 | controller.zoom(10, 2000);
70 | },
71 | ),
72 | ],
73 | ),
74 | ]),
75 | );
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: mapbox_gl_example
2 | description: Demonstrates how to use the mapbox_gl plugin.
3 | publish_to: 'none'
4 |
5 | environment:
6 | sdk: ">=2.0.0-dev.68.0 <3.0.0"
7 |
8 | dependencies:
9 | flutter:
10 | sdk: flutter
11 |
12 | # The following adds the Cupertino Icons font to your application.
13 | # Use with the CupertinoIcons class for iOS style icons.
14 | cupertino_icons: ^0.1.2
15 |
16 | dev_dependencies:
17 | flutter_test:
18 | sdk: flutter
19 |
20 | mapbox_gl:
21 | path: ../
22 |
23 | # For information on the generic Dart part of this file, see the
24 | # following page: https://www.dartlang.org/tools/pub/pubspec
25 |
26 | # The following section is specific to Flutter.
27 | flutter:
28 |
29 | # The following line ensures that the Material Icons font is
30 | # included with your application, so that you can use the icons in
31 | # the material Icons class.
32 | uses-material-design: true
33 |
34 | # To add assets to your application, add an assets section, like this:
35 | # assets:
36 | # - images/a_dot_burr.jpeg
37 | # - images/a_dot_ham.jpeg
38 |
39 | # An image asset can refer to one or more resolution-specific "variants", see
40 | # https://flutter.io/assets-and-images/#resolution-aware.
41 |
42 | # For details regarding adding assets from package dependencies, see
43 | # https://flutter.io/assets-and-images/#from-packages
44 |
45 | # To add custom fonts to your application, add a fonts section here,
46 | # in this "flutter" section. Each entry in this list should have a
47 | # "family" key with the font family name, and a "fonts" key with a
48 | # list giving the asset and other descriptors for the font. For
49 | # example:
50 | # fonts:
51 | # - family: Schyler
52 | # fonts:
53 | # - asset: fonts/Schyler-Regular.ttf
54 | # - asset: fonts/Schyler-Italic.ttf
55 | # style: italic
56 | # - family: Trajan Pro
57 | # fonts:
58 | # - asset: fonts/TrajanPro.ttf
59 | # - asset: fonts/TrajanPro_Bold.ttf
60 | # weight: 700
61 | #
62 | # For details regarding fonts from package dependencies,
63 | # see https://flutter.io/custom-fonts/#from-packages
64 |
--------------------------------------------------------------------------------
/flutter_mapbox_gl.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/Generated.xcconfig
37 |
--------------------------------------------------------------------------------
/ios/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mapbox/flutter-mapbox-gl/0389d3e1584bb47deef438a77ab6ad28afa199d1/ios/Assets/.gitkeep
--------------------------------------------------------------------------------
/ios/Classes/MapboxGlPlugin.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface MapboxGlPlugin : NSObject
4 | @end
5 |
--------------------------------------------------------------------------------
/ios/Classes/MapboxGlPlugin.m:
--------------------------------------------------------------------------------
1 | #import "MapboxGlPlugin.h"
2 |
3 | @implementation MapboxGlPlugin
4 | + (void)registerWithRegistrar:(NSObject*)registrar {
5 | FlutterMethodChannel* channel = [FlutterMethodChannel
6 | methodChannelWithName:@"mapbox_gl"
7 | binaryMessenger:[registrar messenger]];
8 | MapboxGlPlugin* instance = [[MapboxGlPlugin alloc] init];
9 | [registrar addMethodCallDelegate:instance channel:channel];
10 | }
11 |
12 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
13 | if ([@"getPlatformVersion" isEqualToString:call.method]) {
14 | result([@"iOS " stringByAppendingString:[[UIDevice currentDevice] systemVersion]]);
15 | } else {
16 | result(FlutterMethodNotImplemented);
17 | }
18 | }
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/ios/flutter_mapbox_gl.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
3 | #
4 | Pod::Spec.new do |s|
5 | s.name = 'mapbox_gl'
6 | s.version = '0.0.1'
7 | s.summary = 'A new Flutter plugin.'
8 | s.description = <<-DESC
9 | A new Flutter plugin.
10 | DESC
11 | s.homepage = 'http://example.com'
12 | s.license = { :file => '../LICENSE' }
13 | s.author = { 'Your Company' => 'email@example.com' }
14 | s.source = { :path => '.' }
15 | s.source_files = 'Classes/**/*'
16 | s.public_header_files = 'Classes/**/*.h'
17 | s.dependency 'Flutter'
18 |
19 | s.ios.deployment_target = '8.0'
20 | end
21 |
22 |
--------------------------------------------------------------------------------
/lib/mapbox_gl.dart:
--------------------------------------------------------------------------------
1 | library mapbox_gl;
2 |
3 | import 'dart:convert';
4 |
5 | import 'package:flutter/foundation.dart';
6 | import 'package:flutter/material.dart';
7 | import 'package:flutter/services.dart';
8 | import 'package:meta/meta.dart';
9 |
10 |
11 | part 'src/controller.dart';
12 | part 'src/flutter_mapbox_view.dart';
13 | part 'src/camera.dart';
14 | part 'src/models.dart';
15 |
16 | // import 'dart:async';
17 |
18 | // import 'package:flutter/services.dart';
19 |
20 | // class MapboxGl {
21 | // static const MethodChannel _channel =
22 | // const MethodChannel('mapbox_gl');
23 |
24 | // static Future get platformVersion async {
25 | // final String version = await _channel.invokeMethod('getPlatformVersion');
26 | // return version;
27 | // }
28 | // }
29 |
--------------------------------------------------------------------------------
/lib/src/camera.dart:
--------------------------------------------------------------------------------
1 | part of mapbox_gl;
2 |
3 | class Camera {
4 | final LatLng target;
5 | final double zoom;
6 | final double bearing;
7 | final double tilt;
8 |
9 | Camera({this.target, this.zoom, this.bearing, this.tilt});
10 |
11 | Camera copyWith({LatLng target, double zoom, double bearing, double tilt}) {
12 | LatLng newTarget = target ?? this.target;
13 | double newZoom = zoom ?? this.zoom;
14 | double newBearing = bearing ?? this.bearing;
15 | double newTilt = tilt ?? this.tilt;
16 |
17 | return new Camera(target: newTarget, zoom: newZoom, bearing: newBearing, tilt: newTilt);
18 | }
19 |
20 | Map toMap() {
21 | return {
22 | "target": (target != null) ? target.toMap() : null,
23 | "zoom": zoom,
24 | "bearing": bearing,
25 | "tilt": tilt
26 | };
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lib/src/controller.dart:
--------------------------------------------------------------------------------
1 | part of mapbox_gl;
2 |
3 | typedef OnMapTapCallback(ScreenPoint point, LatLng coordinates);
4 |
5 | class MapViewController extends ChangeNotifier {
6 | final MethodChannel _channel;
7 | // MapViewControllerListener _listener;
8 | OnMapTapCallback onTap;
9 |
10 | MapViewController(int id, {this.onTap}) : _channel = new MethodChannel('com.mapbox/mapboxgl_$id') {
11 | _channel.setMethodCallHandler(_handleMethodCall);
12 | }
13 |
14 | Future _handleMethodCall(MethodCall call) async {
15 | switch (call.method) {
16 | case 'onTap':
17 | final double x = call.arguments['x'];
18 | final double y = call.arguments['y'];
19 | final double lng = call.arguments['lng'];
20 | final double lat = call.arguments['lat'];
21 | if (onTap != null) onTap(ScreenPoint(x, y), LatLng(lng: lng, lat: lat));
22 | break;
23 |
24 | default:
25 | print("unknown methpd called");
26 | }
27 | }
28 |
29 |
30 | Future showUserLocation() async {
31 | try {
32 | await _channel.invokeMethod('showUserLocation');
33 | } on PlatformException catch (e) {
34 | return new Future.error(e);
35 | }
36 | }
37 |
38 | Future setStyleUrl(String styleUrl) async {
39 | try {
40 | await _channel.invokeMethod('setStyleUrl', styleUrl);
41 | } on PlatformException catch (e) {
42 | return new Future.error(e);
43 | }
44 | }
45 |
46 | Future getStyleUrl() async {
47 | try {
48 | final Map