├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── map_controller │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── 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-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── docs ├── .last_build_id ├── assets │ ├── AssetManifest.json │ ├── FontManifest.json │ ├── NOTICES │ ├── assets │ │ └── airports.geojson │ └── fonts │ │ └── MaterialIcons-Regular.otf ├── favicon.png ├── flutter_service_worker.js ├── icons │ ├── Icon-192.png │ └── Icon-512.png ├── index.html ├── main.dart.js ├── manifest.json └── version.json ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── map_controller_example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── 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-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── assets │ ├── airports.geojson │ └── polygons.geojson ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── 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 │ │ └── Runner-Bridging-Header.h ├── lib │ ├── geojson.dart │ ├── index.dart │ ├── main.dart │ ├── markers.dart │ ├── stateful_markers.dart │ └── tile_layer.dart ├── pubspec.yaml └── web │ ├── favicon.png │ ├── icons │ ├── Icon-192.png │ └── Icon-512.png │ ├── index.html │ └── manifest.json ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── 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 │ └── Runner-Bridging-Header.h ├── lib ├── map_controller.dart └── src │ ├── controller.dart │ ├── exceptions.dart │ ├── models.dart │ ├── state │ ├── lines.dart │ ├── map.dart │ ├── markers.dart │ ├── polygons.dart │ ├── stateful_markers.dart │ └── tile_layer.dart │ ├── tile_layer │ ├── layers.dart │ └── tile_layers_bar.dart │ └── types.dart ├── pubspec.yaml └── web ├── favicon.png ├── icons ├── Icon-192.png └── Icon-512.png ├── index.html └── manifest.json /.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 | # Sphinx documentation 23 | docs/_build/ 24 | 25 | # Flutter/Dart/Pub related 26 | **/doc/api/ 27 | .dart_tool/ 28 | .flutter-plugins 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | build/ 33 | **/.flutter-plugins-dependencies 34 | **/flutter_export_environment.sh 35 | 36 | # Android related 37 | **/android/**/gradle-wrapper.jar 38 | **/android/.gradle 39 | **/android/captures/ 40 | **/android/gradlew 41 | **/android/gradlew.bat 42 | **/android/local.properties 43 | **/android/**/GeneratedPluginRegistrant.java 44 | 45 | # iOS/XCode related 46 | **/ios/**/*.mode1v3 47 | **/ios/**/*.mode2v3 48 | **/ios/**/*.moved-aside 49 | **/ios/**/*.pbxuser 50 | **/ios/**/*.perspectivev3 51 | **/ios/**/*sync/ 52 | **/ios/**/.sconsign.dblite 53 | **/ios/**/.tags* 54 | **/ios/**/.vagrant/ 55 | **/ios/**/DerivedData/ 56 | **/ios/**/Icon? 57 | **/ios/**/Pods/ 58 | **/ios/**/.symlinks/ 59 | **/ios/**/profile 60 | **/ios/**/xcuserdata 61 | **/ios/.generated/ 62 | **/ios/Flutter/App.framework 63 | **/ios/Flutter/Flutter.framework 64 | **/ios/Flutter/Generated.xcconfig 65 | **/ios/Flutter/app.flx 66 | **/ios/Flutter/app.zip 67 | **/ios/Flutter/flutter_assets/ 68 | **/ios/ServiceDefinitions.json 69 | **/ios/Runner/GeneratedPluginRegistrant.* 70 | 71 | # Exceptions to above rules. 72 | !**/ios/**/default.mode1v3 73 | !**/ios/**/default.mode2v3 74 | !**/ios/**/default.pbxuser 75 | !**/ios/**/default.perspectivev3 76 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 77 | 78 | # Coverage report 79 | coverage/output/ 80 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 0.9.0 4 | 5 | - Update Flutter project and dependencies 6 | - Fix: prevent markers number from increasing 7 | 8 | ## 0.8.0 9 | 10 | Update dependencies 11 | 12 | ## 0.7.1 13 | 14 | - Minor dependency update 15 | - Add web support for tile layers 16 | 17 | ## 0.7.0 18 | 19 | - Update dependencies 20 | - Add stateful markers management 21 | - Fix in tile layer 22 | 23 | ## 0.6.1 24 | 25 | Fix for rxdart api change 26 | 27 | ## 0.6.0 28 | 29 | Upgrade to Flutter map 0.8.0 for Flutter 1.12+ compatibility 30 | 31 | ## 0.5.1 32 | 33 | Add tile layer management 34 | 35 | ## 0.5.0 36 | 37 | - Upgrade dependencies 38 | - Use more strict analysis options 39 | - Add `fitLine` and `addLineFromGeoPoints` methods 40 | - Add `fitMarker` and `fitMarkers` methods 41 | 42 | ## 0.4.2 43 | 44 | - Add the `fitLine` method 45 | - Add the `addLineFromGeoPoint` method 46 | 47 | ## 0.4.1 48 | 49 | - Add support for geojson 50 | - Add the `rotate` method 51 | - Update dependencies 52 | 53 | ## 0.4.0 54 | 55 | - Add map controller change type 56 | - Add the `fromGeoJson` method 57 | 58 | ## 0.3.0 59 | 60 | Add methods to add and remove polygons and lines 61 | 62 | ## 0.2.0 63 | 64 | Update dependencies 65 | 66 | ## 0.1.0 67 | 68 | Initial release 69 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Map controller 2 | 3 | [![pub package](https://img.shields.io/pub/v/map_controller.svg)](https://pub.dartlang.org/packages/map_controller) 4 | 5 | Stateful map controller for Flutter Map. Manage markers, lines and polygons. 6 | 7 | [View the web demo](https://synw.github.io/map_controller) 8 | 9 | ## Usage 10 | 11 | ```dart 12 | import 'dart:async'; 13 | import 'package:flutter/material.dart'; 14 | import 'package:flutter_map/flutter_map.dart'; 15 | import 'package:latlong/latlong.dart'; 16 | import 'package:map_controller/map_controller.dart'; 17 | 18 | class _MapPageState extends State { 19 | MapController mapController; 20 | StatefulMapController statefulMapController; 21 | StreamSubscription sub; 22 | 23 | @override 24 | void initState() { 25 | // intialize the controllers 26 | mapController = MapController(); 27 | statefulMapController = StatefulMapController(mapController: mapController); 28 | 29 | // wait for the controller to be ready before using it 30 | statefulMapController.onReady.then((_) => print("The map controller is ready"))); 31 | 32 | /// [Important] listen to the changefeed to rebuild the map on changes: 33 | /// this will rebuild the map when for example addMarker or any method 34 | /// that mutates the map assets is called 35 | sub = statefulMapController.changeFeed.listen((change) => setState(() {})); 36 | super.initState(); 37 | } 38 | 39 | @override 40 | Widget build(BuildContext context) { 41 | return Scaffold( 42 | body: SafeArea( 43 | child: Stack(children: [ 44 | FlutterMap( 45 | mapController: mapController, 46 | options: MapOptions(center: LatLng(48.853831, 2.348722), zoom: 11.0), 47 | layers: [ 48 | MarkerLayerOptions(markers: statefulMapController.markers), 49 | PolylineLayerOptions(polylines: statefulMapController.lines), 50 | PolygonLayerOptions(polygons: statefulMapController.polygons) 51 | ], 52 | ), 53 | // ... 54 | ])), 55 | ); 56 | } 57 | 58 | @override 59 | void dispose() { 60 | sub.cancel(); 61 | super.dispose(); 62 | } 63 | } 64 | 65 | class MapPage extends StatefulWidget { 66 | @override 67 | _MapPageState createState() => _MapPageState(); 68 | } 69 | ``` 70 | 71 | ## Api 72 | 73 | Api for the [StatefulMapController](https://pub.dev/documentation/map_controller/latest/map_controller/StatefulMapController-class.html) class 74 | 75 | ### Map controls 76 | 77 | #### Zoom 78 | 79 | **`zoom`**: get the current zoom value 80 | 81 | **`zoomIn()`**: increase the zoom level by 1 82 | 83 | **`zoomOut()`**: decrease the zoom level by 1 84 | 85 | **`zoomTo`**(`Double` *value*): zoom to the provided value 86 | 87 | #### Center 88 | 89 | **`center`**: get the current center `LatLng` value 90 | 91 | **`centerOnPoint`**(`LatLng` *point*): center on the `LatLng` value 92 | 93 | ### Map assets 94 | 95 | #### Markers 96 | 97 | **`addMarker`**(`String` *name*, `Marker` *marker*): add a named marker on the map 98 | 99 | **`addMarkers`**(`Map` *markers*): add several named markers on the map 100 | 101 | **`removeMarker`**(`String` *name*, `Marker` *marker*): remove a named marker from the map 102 | 103 | **`removeMarkers`**(`Map` *markers*): remove several named markers from the map 104 | 105 | **`markers`**: get the markers that are on the map 106 | 107 | **`namedMarkers`**: get the markers with their names that are on the map 108 | 109 | #### Stateful markers 110 | 111 | *New in 0.7*: the stateful makers hold their own state and can be mutated 112 | 113 | ```dart 114 | statefulMapController.addStatefulMarker( 115 | name: "some marker", 116 | statefulMarker: StatefulMarker( 117 | height: 80.0, 118 | width: 120.0, 119 | state: {"showText": false}, 120 | point: LatLng(48.853831, 2.348722), 121 | builder: (BuildContext context, Map state) { 122 | Widget w; 123 | final markerIcon = IconButton( 124 | icon: const Icon(Icons.location_on), 125 | onPressed: () => statefulMapController.mutateMarker( 126 | name: "some marker", 127 | property: "showText", 128 | value: !(state["showText"] as bool))); 129 | if (state["showText"] == true) { 130 | w = Column(children: [ 131 | markerIcon, 132 | Container( 133 | color: Colors.white, 134 | child: Padding( 135 | padding: const EdgeInsets.all(5.0), 136 | child: Text(place.name, textScaleFactor: 1.3))), 137 | ]); 138 | } else { 139 | w = markerIcon; 140 | } 141 | return w; 142 | }) 143 | ); 144 | ``` 145 | 146 | #### Lines 147 | 148 | **`addLine`**(`String` *name*, 149 | `List` *points*, 150 | `double` *width* = 1.0, 151 | `Color` *color* = Colors.green, 152 | `bool` *isDotted* = false): add a line on the map 153 | 154 | **`lines`**: get the lines that are on the map 155 | 156 | #### Polygons 157 | 158 | **`addPolygon`**(`String` *name*, 159 | `List` *points*, 160 | `double` *width* = 1.0, 161 | `Color` *color* = const Color(0xFF00FF00), 162 | `double` *borderWidth* = 0.0, 163 | `Color` *borderColor* = const Color(0xFFFFFF00)): add a polygon on the map 164 | 165 | **`polygons`**: get the polygons that are on the map 166 | 167 | ### On ready callback 168 | 169 | Execute some code right after the map is ready: 170 | 171 | ```dart 172 | @override 173 | void initState() { 174 | statefulMapController.onReady.then((_) { 175 | setState((_) =>_ready = true); 176 | }); 177 | super.initState(); 178 | } 179 | ``` 180 | 181 | ### Changefeed 182 | 183 | A changefeed is available: it's a stream with all state changes from the map controller. Use it to update the map when a change occurs: 184 | 185 | ```dart 186 | statefulMapController.onReady.then((_) { 187 | statefulMapController.changeFeed.listen((change) => setState(() {})); 188 | }); 189 | } 190 | ``` 191 | 192 | ### Geojson data 193 | 194 | The map controller can draw on the map from geojson data: 195 | 196 | ```dart 197 | void loadData() async { 198 | print("Loading geojson data"); 199 | final data = await rootBundle.loadString('assets/airports.geojson'); 200 | await statefulMapController.fromGeoJson(data, 201 | markerIcon: Icon(Icons.local_airport), verbose: true); 202 | } 203 | 204 | @override 205 | void initState() { 206 | mapController = MapController(); 207 | statefulMapController = StatefulMapController(mapController: mapController); 208 | statefulMapController.onReady.then((_) => loadData()); 209 | sub = statefulMapController.changeFeed.listen((change) => setState(() {})); 210 | super.initState(); 211 | } 212 | 213 | ``` 214 | 215 | ### Tile layer management 216 | 217 | Some predefined tile layers are available. 218 | 219 | ```dart 220 | FlutterMap( 221 | mapController: mapController, 222 | options: MapOptions( 223 | center: LatLng(48.853831, 2.348722), zoom: 11.0), 224 | layers: [ 225 | // Use the map controller's tile layer 226 | statefulMapController.tileLayer, 227 | MarkerLayerOptions(markers: statefulMapController.markers), 228 | // ... 229 | ], 230 | ) 231 | ``` 232 | 233 | To switch tile layers at runtime use: 234 | 235 | ```dart 236 | statefulMapController.switchTileLayer(TileLayerType.monochrome); 237 | ``` 238 | 239 | Available layers: 240 | 241 | ```dart 242 | TileLayerType.normal 243 | TileLayerType.topography 244 | TileLayerType.monochrome 245 | TileLayerType.hike 246 | ``` 247 | 248 | A tile layers bar is available: 249 | 250 | ```dart 251 | Stack(children: [ 252 | FlutterMap( 253 | mapController: mapController, 254 | options: MapOptions(center: LatLng(48.853831, 2.348722), zoom: 11.0), 255 | layers: [ 256 | statefulMapController.tileLayer, 257 | MarkerLayerOptions(markers: statefulMapController.markers), 258 | ], 259 | ), 260 | Positioned( 261 | top: 15.0, 262 | right: 15.0, 263 | child: TileLayersBar(controller: statefulMapController)) 264 | ]) 265 | ``` -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:extra_pedantic/analysis_options.yaml 2 | 3 | analyzer: 4 | strong-mode: 5 | implicit-casts: false 6 | implicit-dynamic: false 7 | errors: 8 | missing_return: error 9 | missing_required_param: error 10 | invalid_use_of_protected_member: error 11 | dead_code: info 12 | sdk_version_async_exported_from_core: ignore 13 | linter: 14 | rules: 15 | - unnecessary_statements 16 | - unnecessary_lambdas 17 | - avoid_classes_with_only_static_members 18 | - avoid_renaming_method_parameters 19 | - camel_case_types 20 | - constant_identifier_names 21 | - cascade_invocations 22 | - omit_local_variable_types -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /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 plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 30 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | defaultConfig { 36 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 37 | applicationId "com.example.map_controller" 38 | minSdkVersion 16 39 | targetSdkVersion 30 40 | versionCode flutterVersionCode.toInteger() 41 | versionName flutterVersionName 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 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 59 | } 60 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/map_controller/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.map_controller 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /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-6.7-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /docs/.last_build_id: -------------------------------------------------------------------------------- 1 | 2c8c0016e18d4544ee4991351fe1d0ad -------------------------------------------------------------------------------- /docs/assets/AssetManifest.json: -------------------------------------------------------------------------------- 1 | {"assets/airports.geojson":["assets/airports.geojson"]} -------------------------------------------------------------------------------- /docs/assets/FontManifest.json: -------------------------------------------------------------------------------- 1 | [{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.otf"}]}] -------------------------------------------------------------------------------- /docs/assets/fonts/MaterialIcons-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/docs/assets/fonts/MaterialIcons-Regular.otf -------------------------------------------------------------------------------- /docs/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/docs/favicon.png -------------------------------------------------------------------------------- /docs/flutter_service_worker.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const MANIFEST = 'flutter-app-manifest'; 3 | const TEMP = 'flutter-temp-cache'; 4 | const CACHE_NAME = 'flutter-app-cache'; 5 | const RESOURCES = { 6 | "manifest.json": "0f2541b2699c200328d7f1da1857d3ae", 7 | "version.json": "fe08816f6f66fcd5826b14dfd3bdb172", 8 | "favicon.png": "5dcef449791fa27946b3d35ad8803796", 9 | "main.dart.js": "206e5fd784c3af08972cbebb87776e52", 10 | "icons/Icon-192.png": "ac9a721a12bbc803b44f645561ecb1e1", 11 | "icons/Icon-512.png": "96e752610906ba2a93c65f8abe1645f1", 12 | "index.html": "a6311788c78192623ae52fb145c2a093", 13 | "/": "a6311788c78192623ae52fb145c2a093", 14 | "assets/fonts/MaterialIcons-Regular.otf": "1288c9e28052e028aba623321f7826ac", 15 | "assets/FontManifest.json": "7b2a36307916a9721811788013e65289", 16 | "assets/AssetManifest.json": "0937aee0c381201167251130e4b2e125", 17 | "assets/NOTICES": "fe1820935ac2c27eab0b8741ad4c8d87", 18 | "assets/assets/airports.geojson": "48e7a2533b6f8c0d7c8290680ba93eb3" 19 | }; 20 | 21 | // The application shell files that are downloaded before a service worker can 22 | // start. 23 | const CORE = [ 24 | "/", 25 | "main.dart.js", 26 | "index.html", 27 | "assets/NOTICES", 28 | "assets/AssetManifest.json", 29 | "assets/FontManifest.json"]; 30 | // During install, the TEMP cache is populated with the application shell files. 31 | self.addEventListener("install", (event) => { 32 | self.skipWaiting(); 33 | return event.waitUntil( 34 | caches.open(TEMP).then((cache) => { 35 | return cache.addAll( 36 | CORE.map((value) => new Request(value + '?revision=' + RESOURCES[value], {'cache': 'reload'}))); 37 | }) 38 | ); 39 | }); 40 | 41 | // During activate, the cache is populated with the temp files downloaded in 42 | // install. If this service worker is upgrading from one with a saved 43 | // MANIFEST, then use this to retain unchanged resource files. 44 | self.addEventListener("activate", function(event) { 45 | return event.waitUntil(async function() { 46 | try { 47 | var contentCache = await caches.open(CACHE_NAME); 48 | var tempCache = await caches.open(TEMP); 49 | var manifestCache = await caches.open(MANIFEST); 50 | var manifest = await manifestCache.match('manifest'); 51 | // When there is no prior manifest, clear the entire cache. 52 | if (!manifest) { 53 | await caches.delete(CACHE_NAME); 54 | contentCache = await caches.open(CACHE_NAME); 55 | for (var request of await tempCache.keys()) { 56 | var response = await tempCache.match(request); 57 | await contentCache.put(request, response); 58 | } 59 | await caches.delete(TEMP); 60 | // Save the manifest to make future upgrades efficient. 61 | await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES))); 62 | return; 63 | } 64 | var oldManifest = await manifest.json(); 65 | var origin = self.location.origin; 66 | for (var request of await contentCache.keys()) { 67 | var key = request.url.substring(origin.length + 1); 68 | if (key == "") { 69 | key = "/"; 70 | } 71 | // If a resource from the old manifest is not in the new cache, or if 72 | // the MD5 sum has changed, delete it. Otherwise the resource is left 73 | // in the cache and can be reused by the new service worker. 74 | if (!RESOURCES[key] || RESOURCES[key] != oldManifest[key]) { 75 | await contentCache.delete(request); 76 | } 77 | } 78 | // Populate the cache with the app shell TEMP files, potentially overwriting 79 | // cache files preserved above. 80 | for (var request of await tempCache.keys()) { 81 | var response = await tempCache.match(request); 82 | await contentCache.put(request, response); 83 | } 84 | await caches.delete(TEMP); 85 | // Save the manifest to make future upgrades efficient. 86 | await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES))); 87 | return; 88 | } catch (err) { 89 | // On an unhandled exception the state of the cache cannot be guaranteed. 90 | console.error('Failed to upgrade service worker: ' + err); 91 | await caches.delete(CACHE_NAME); 92 | await caches.delete(TEMP); 93 | await caches.delete(MANIFEST); 94 | } 95 | }()); 96 | }); 97 | 98 | // The fetch handler redirects requests for RESOURCE files to the service 99 | // worker cache. 100 | self.addEventListener("fetch", (event) => { 101 | if (event.request.method !== 'GET') { 102 | return; 103 | } 104 | var origin = self.location.origin; 105 | var key = event.request.url.substring(origin.length + 1); 106 | // Redirect URLs to the index.html 107 | if (key.indexOf('?v=') != -1) { 108 | key = key.split('?v=')[0]; 109 | } 110 | if (event.request.url == origin || event.request.url.startsWith(origin + '/#') || key == '') { 111 | key = '/'; 112 | } 113 | // If the URL is not the RESOURCE list then return to signal that the 114 | // browser should take over. 115 | if (!RESOURCES[key]) { 116 | return; 117 | } 118 | // If the URL is the index.html, perform an online-first request. 119 | if (key == '/') { 120 | return onlineFirst(event); 121 | } 122 | event.respondWith(caches.open(CACHE_NAME) 123 | .then((cache) => { 124 | return cache.match(event.request).then((response) => { 125 | // Either respond with the cached resource, or perform a fetch and 126 | // lazily populate the cache. 127 | return response || fetch(event.request).then((response) => { 128 | cache.put(event.request, response.clone()); 129 | return response; 130 | }); 131 | }) 132 | }) 133 | ); 134 | }); 135 | 136 | self.addEventListener('message', (event) => { 137 | // SkipWaiting can be used to immediately activate a waiting service worker. 138 | // This will also require a page refresh triggered by the main worker. 139 | if (event.data === 'skipWaiting') { 140 | self.skipWaiting(); 141 | return; 142 | } 143 | if (event.data === 'downloadOffline') { 144 | downloadOffline(); 145 | return; 146 | } 147 | }); 148 | 149 | // Download offline will check the RESOURCES for all files not in the cache 150 | // and populate them. 151 | async function downloadOffline() { 152 | var resources = []; 153 | var contentCache = await caches.open(CACHE_NAME); 154 | var currentContent = {}; 155 | for (var request of await contentCache.keys()) { 156 | var key = request.url.substring(origin.length + 1); 157 | if (key == "") { 158 | key = "/"; 159 | } 160 | currentContent[key] = true; 161 | } 162 | for (var resourceKey of Object.keys(RESOURCES)) { 163 | if (!currentContent[resourceKey]) { 164 | resources.push(resourceKey); 165 | } 166 | } 167 | return contentCache.addAll(resources); 168 | } 169 | 170 | // Attempt to download the resource online before falling back to 171 | // the offline cache. 172 | function onlineFirst(event) { 173 | return event.respondWith( 174 | fetch(event.request).then((response) => { 175 | return caches.open(CACHE_NAME).then((cache) => { 176 | cache.put(event.request, response.clone()); 177 | return response; 178 | }); 179 | }).catch((error) => { 180 | return caches.open(CACHE_NAME).then((cache) => { 181 | return cache.match(event.request).then((response) => { 182 | if (response != null) { 183 | return response; 184 | } 185 | throw error; 186 | }); 187 | }); 188 | }) 189 | ); 190 | } 191 | -------------------------------------------------------------------------------- /docs/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/docs/icons/Icon-192.png -------------------------------------------------------------------------------- /docs/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/docs/icons/Icon-512.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | map_controller_example 19 | 20 | 21 | 22 | 25 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "map_controller_example", 3 | "short_name": "map_controller_example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /docs/version.json: -------------------------------------------------------------------------------- 1 | {"app_name":"map_controller_example","version":"1.0.0","build_number":"1"} -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /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: 4b50ca7f7fbf56be72e54cd200825b760416a356 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # map_controller_example 2 | 3 | A new Flutter project. 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.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /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 plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 30 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | defaultConfig { 36 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 37 | applicationId "com.example.map_controller_example" 38 | minSdkVersion 16 39 | targetSdkVersion 30 40 | versionCode flutterVersionCode.toInteger() 41 | versionName flutterVersionName 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 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 59 | } 60 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/map_controller_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.map_controller_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /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-6.7-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/assets/polygons.geojson: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "features": [ 4 | { 5 | "type": "Feature", 6 | "properties": { 7 | "name": "point1" 8 | }, 9 | "geometry": { 10 | "type": "Point", 11 | "coordinates": [ 12 | 0, 13 | 0 14 | ] 15 | } 16 | }, 17 | { 18 | "type": "Feature", 19 | "properties": { 20 | "name": "point2" 21 | }, 22 | "geometry": { 23 | "type": "Point", 24 | "coordinates": [ 25 | 0, 26 | 0 27 | ] 28 | } 29 | }, 30 | { 31 | "type": "Feature", 32 | "properties": { 33 | "name": "collection" 34 | }, 35 | "geometry": { 36 | "geometries": [ 37 | { 38 | "type": "Polygon", 39 | "coordinates": [ 40 | [ 41 | [ 42 | 100.0, 43 | 0.0 44 | ], 45 | [ 46 | 101.0, 47 | 0.0 48 | ], 49 | [ 50 | 101.0, 51 | 1.0 52 | ], 53 | [ 54 | 100.0, 55 | 1.0 56 | ], 57 | [ 58 | 100.0, 59 | 0.0 60 | ] 61 | ] 62 | ] 63 | }, 64 | { 65 | "type": "Polygon", 66 | "coordinates": [ 67 | [ 68 | [ 69 | 100.0, 70 | 0.0 71 | ], 72 | [ 73 | 101.0, 74 | 0.0 75 | ], 76 | [ 77 | 101.0, 78 | 1.0 79 | ], 80 | [ 81 | 100.0, 82 | 1.0 83 | ], 84 | [ 85 | 100.0, 86 | 0.0 87 | ] 88 | ] 89 | ] 90 | } 91 | ], 92 | "type": "GeometryCollection" 93 | } 94 | } 95 | ] 96 | } -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /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 "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /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 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | INFOPLIST_FILE = Runner/Info.plist; 293 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 294 | PRODUCT_BUNDLE_IDENTIFIER = com.example.mapControllerExample; 295 | PRODUCT_NAME = "$(TARGET_NAME)"; 296 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 297 | SWIFT_VERSION = 5.0; 298 | VERSIONING_SYSTEM = "apple-generic"; 299 | }; 300 | name = Profile; 301 | }; 302 | 97C147031CF9000F007C117D /* Debug */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | ALWAYS_SEARCH_USER_PATHS = NO; 306 | CLANG_ANALYZER_NONNULL = YES; 307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 308 | CLANG_CXX_LIBRARY = "libc++"; 309 | CLANG_ENABLE_MODULES = YES; 310 | CLANG_ENABLE_OBJC_ARC = YES; 311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_COMMA = YES; 314 | CLANG_WARN_CONSTANT_CONVERSION = YES; 315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 317 | CLANG_WARN_EMPTY_BODY = YES; 318 | CLANG_WARN_ENUM_CONVERSION = YES; 319 | CLANG_WARN_INFINITE_RECURSION = YES; 320 | CLANG_WARN_INT_CONVERSION = YES; 321 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 322 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 323 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 326 | CLANG_WARN_STRICT_PROTOTYPES = YES; 327 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 328 | CLANG_WARN_UNREACHABLE_CODE = YES; 329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 331 | COPY_PHASE_STRIP = NO; 332 | DEBUG_INFORMATION_FORMAT = dwarf; 333 | ENABLE_STRICT_OBJC_MSGSEND = YES; 334 | ENABLE_TESTABILITY = YES; 335 | GCC_C_LANGUAGE_STANDARD = gnu99; 336 | GCC_DYNAMIC_NO_PIC = NO; 337 | GCC_NO_COMMON_BLOCKS = YES; 338 | GCC_OPTIMIZATION_LEVEL = 0; 339 | GCC_PREPROCESSOR_DEFINITIONS = ( 340 | "DEBUG=1", 341 | "$(inherited)", 342 | ); 343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 345 | GCC_WARN_UNDECLARED_SELECTOR = YES; 346 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 347 | GCC_WARN_UNUSED_FUNCTION = YES; 348 | GCC_WARN_UNUSED_VARIABLE = YES; 349 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 350 | MTL_ENABLE_DEBUG_INFO = YES; 351 | ONLY_ACTIVE_ARCH = YES; 352 | SDKROOT = iphoneos; 353 | TARGETED_DEVICE_FAMILY = "1,2"; 354 | }; 355 | name = Debug; 356 | }; 357 | 97C147041CF9000F007C117D /* Release */ = { 358 | isa = XCBuildConfiguration; 359 | buildSettings = { 360 | ALWAYS_SEARCH_USER_PATHS = NO; 361 | CLANG_ANALYZER_NONNULL = YES; 362 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 363 | CLANG_CXX_LIBRARY = "libc++"; 364 | CLANG_ENABLE_MODULES = YES; 365 | CLANG_ENABLE_OBJC_ARC = YES; 366 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 367 | CLANG_WARN_BOOL_CONVERSION = YES; 368 | CLANG_WARN_COMMA = YES; 369 | CLANG_WARN_CONSTANT_CONVERSION = YES; 370 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 372 | CLANG_WARN_EMPTY_BODY = YES; 373 | CLANG_WARN_ENUM_CONVERSION = YES; 374 | CLANG_WARN_INFINITE_RECURSION = YES; 375 | CLANG_WARN_INT_CONVERSION = YES; 376 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 377 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 378 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 379 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 380 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 381 | CLANG_WARN_STRICT_PROTOTYPES = YES; 382 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 383 | CLANG_WARN_UNREACHABLE_CODE = YES; 384 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 385 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 386 | COPY_PHASE_STRIP = NO; 387 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 388 | ENABLE_NS_ASSERTIONS = NO; 389 | ENABLE_STRICT_OBJC_MSGSEND = YES; 390 | GCC_C_LANGUAGE_STANDARD = gnu99; 391 | GCC_NO_COMMON_BLOCKS = YES; 392 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 393 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 394 | GCC_WARN_UNDECLARED_SELECTOR = YES; 395 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 396 | GCC_WARN_UNUSED_FUNCTION = YES; 397 | GCC_WARN_UNUSED_VARIABLE = YES; 398 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 399 | MTL_ENABLE_DEBUG_INFO = NO; 400 | SDKROOT = iphoneos; 401 | SUPPORTED_PLATFORMS = iphoneos; 402 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 403 | TARGETED_DEVICE_FAMILY = "1,2"; 404 | VALIDATE_PRODUCT = YES; 405 | }; 406 | name = Release; 407 | }; 408 | 97C147061CF9000F007C117D /* Debug */ = { 409 | isa = XCBuildConfiguration; 410 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 411 | buildSettings = { 412 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 413 | CLANG_ENABLE_MODULES = YES; 414 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 415 | ENABLE_BITCODE = NO; 416 | INFOPLIST_FILE = Runner/Info.plist; 417 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 418 | PRODUCT_BUNDLE_IDENTIFIER = com.example.mapControllerExample; 419 | PRODUCT_NAME = "$(TARGET_NAME)"; 420 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 421 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 422 | SWIFT_VERSION = 5.0; 423 | VERSIONING_SYSTEM = "apple-generic"; 424 | }; 425 | name = Debug; 426 | }; 427 | 97C147071CF9000F007C117D /* Release */ = { 428 | isa = XCBuildConfiguration; 429 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 430 | buildSettings = { 431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 432 | CLANG_ENABLE_MODULES = YES; 433 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 434 | ENABLE_BITCODE = NO; 435 | INFOPLIST_FILE = Runner/Info.plist; 436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 437 | PRODUCT_BUNDLE_IDENTIFIER = com.example.mapControllerExample; 438 | PRODUCT_NAME = "$(TARGET_NAME)"; 439 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 440 | SWIFT_VERSION = 5.0; 441 | VERSIONING_SYSTEM = "apple-generic"; 442 | }; 443 | name = Release; 444 | }; 445 | /* End XCBuildConfiguration section */ 446 | 447 | /* Begin XCConfigurationList section */ 448 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 449 | isa = XCConfigurationList; 450 | buildConfigurations = ( 451 | 97C147031CF9000F007C117D /* Debug */, 452 | 97C147041CF9000F007C117D /* Release */, 453 | 249021D3217E4FDB00AE95B9 /* Profile */, 454 | ); 455 | defaultConfigurationIsVisible = 0; 456 | defaultConfigurationName = Release; 457 | }; 458 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | 97C147061CF9000F007C117D /* Debug */, 462 | 97C147071CF9000F007C117D /* Release */, 463 | 249021D4217E4FDB00AE95B9 /* Profile */, 464 | ); 465 | defaultConfigurationIsVisible = 0; 466 | defaultConfigurationName = Release; 467 | }; 468 | /* End XCConfigurationList section */ 469 | }; 470 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 471 | } 472 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/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 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | map_controller_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/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/geojson.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:pedantic/pedantic.dart'; 4 | import 'package:flutter/services.dart' show rootBundle; 5 | import 'package:flutter_map/flutter_map.dart'; 6 | import 'package:latlong/latlong.dart'; 7 | import 'package:map_controller/map_controller.dart'; 8 | 9 | class _GeoJsonPageState extends State { 10 | MapController mapController; 11 | StatefulMapController statefulMapController; 12 | StreamSubscription sub; 13 | 14 | Future loadData() async { 15 | // data is from http://geojson.xyz/ 16 | print("Loading geojson data"); 17 | final data = await rootBundle.loadString('assets/airports.geojson'); 18 | unawaited(statefulMapController.fromGeoJson(data, 19 | markerIcon: Icon(Icons.local_airport), verbose: true)); 20 | } 21 | 22 | @override 23 | void initState() { 24 | mapController = MapController(); 25 | statefulMapController = StatefulMapController(mapController: mapController); 26 | statefulMapController.onReady.then((_) => loadData()); 27 | sub = statefulMapController.changeFeed.listen((change) => setState(() {})); 28 | super.initState(); 29 | } 30 | 31 | @override 32 | Widget build(BuildContext context) { 33 | return Scaffold( 34 | body: SafeArea( 35 | child: FlutterMap( 36 | mapController: mapController, 37 | options: MapOptions( 38 | center: LatLng(0.0, 0.0), 39 | zoom: 2.0, 40 | ), 41 | layers: [ 42 | statefulMapController.tileLayer, 43 | MarkerLayerOptions( 44 | markers: statefulMapController.markers, 45 | ), 46 | ], 47 | )), 48 | ); 49 | } 50 | 51 | @override 52 | void dispose() { 53 | sub.cancel(); 54 | super.dispose(); 55 | } 56 | } 57 | 58 | class GeoJsonPage extends StatefulWidget { 59 | @override 60 | _GeoJsonPageState createState() => _GeoJsonPageState(); 61 | } 62 | -------------------------------------------------------------------------------- /example/lib/index.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class IndexPage extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | body: Center( 9 | child: Column( 10 | mainAxisAlignment: MainAxisAlignment.center, 11 | children: [ 12 | if (!kIsWeb) 13 | const MainButton( 14 | icon: Icons.filter, 15 | text: "Geojson", 16 | link: "/geojson", 17 | ), 18 | const MainButton( 19 | icon: Icons.location_on, 20 | text: "Markers", 21 | link: "/markers", 22 | ), 23 | const MainButton( 24 | icon: Icons.edit_location, 25 | text: "Stateful markers", 26 | link: "/stateful_markers", 27 | ), 28 | const MainButton( 29 | icon: Icons.map, 30 | text: "Tile layer", 31 | link: "/tile_layer", 32 | ), 33 | ]), 34 | )); 35 | } 36 | } 37 | 38 | class MainButton extends StatelessWidget { 39 | const MainButton({Key key, this.text, this.icon, this.link}) 40 | : super(key: key); 41 | 42 | final String text; 43 | final IconData icon; 44 | final String link; 45 | 46 | @override 47 | Widget build(BuildContext context) { 48 | return GestureDetector( 49 | child: Column(children: [ 50 | Icon(icon, size: 85.0, color: Colors.grey), 51 | Padding( 52 | padding: const EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 20.0), 53 | child: Text(text, 54 | textAlign: TextAlign.center, 55 | textScaleFactor: 1.3, 56 | style: TextStyle(color: Colors.grey)), 57 | ) 58 | ]), 59 | onTap: () => Navigator.of(context).pushNamed(link), 60 | ); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'geojson.dart'; 4 | import 'index.dart'; 5 | import 'markers.dart'; 6 | import 'stateful_markers.dart'; 7 | import 'tile_layer.dart'; 8 | 9 | final Map routes = { 10 | '/': (BuildContext context) => IndexPage(), 11 | '/markers': (BuildContext context) => MarkersPage(), 12 | '/geojson': (BuildContext context) => GeoJsonPage(), 13 | '/tile_layer': (BuildContext context) => TileLayerPage(), 14 | '/stateful_markers': (BuildContext context) => StatefulMarkersPage(), 15 | }; 16 | 17 | void main() => runApp(MyApp()); 18 | 19 | class MyApp extends StatelessWidget { 20 | @override 21 | Widget build(BuildContext context) { 22 | return MaterialApp( 23 | title: 'Map controller demo', 24 | routes: routes, 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /example/lib/markers.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_map/flutter_map.dart'; 5 | import 'package:latlong/latlong.dart'; 6 | import 'package:map_controller/map_controller.dart'; 7 | 8 | class Place { 9 | Place(this.name, this.point); 10 | 11 | final String name; 12 | final LatLng point; 13 | } 14 | 15 | class _MarkersPageState extends State { 16 | MapController mapController; 17 | StatefulMapController statefulMapController; 18 | StreamSubscription sub; 19 | 20 | final List places = [ 21 | Place("Notre-Dame", LatLng(48.853831, 2.348722)), 22 | Place("Montmartre", LatLng(48.886463, 2.341169)), 23 | Place("Champs-Elysées", LatLng(48.873932, 2.294821)), 24 | Place("Chinatown", LatLng(48.827393, 2.361897)), 25 | Place("Tour Eiffel", LatLng(48.85801, 2.294713)) 26 | ]; 27 | 28 | final _markersOnMap = []; 29 | bool ready = false; 30 | 31 | void addMarker(BuildContext context) { 32 | for (final place in places) { 33 | if (!_markersOnMap.contains(place)) { 34 | print("Adding marker ${place.name}"); 35 | statefulMapController.addMarker( 36 | name: place.name, 37 | marker: Marker( 38 | point: place.point, 39 | builder: (BuildContext context) { 40 | return const Icon(Icons.location_on); 41 | })); 42 | _markersOnMap.add(place); 43 | return; 44 | } 45 | } 46 | } 47 | 48 | @override 49 | void initState() { 50 | mapController = MapController(); 51 | statefulMapController = StatefulMapController(mapController: mapController); 52 | statefulMapController.onReady.then((_) => setState(() => ready = true)); 53 | sub = statefulMapController.changeFeed.listen((change) => setState(() {})); 54 | super.initState(); 55 | } 56 | 57 | @override 58 | Widget build(BuildContext context) { 59 | return Scaffold( 60 | body: SafeArea( 61 | child: FlutterMap( 62 | mapController: mapController, 63 | options: MapOptions( 64 | center: LatLng(48.853831, 2.348722), 65 | zoom: 11.0, 66 | ), 67 | layers: [ 68 | statefulMapController.tileLayer, 69 | MarkerLayerOptions( 70 | markers: statefulMapController.markers, 71 | ), 72 | ], 73 | ), 74 | ), 75 | floatingActionButton: ready 76 | ? FloatingActionButton( 77 | child: Icon(Icons.add), 78 | onPressed: () => addMarker(context), 79 | ) 80 | : const Text(""), 81 | ); 82 | } 83 | 84 | @override 85 | void dispose() { 86 | sub.cancel(); 87 | super.dispose(); 88 | } 89 | } 90 | 91 | class MarkersPage extends StatefulWidget { 92 | @override 93 | _MarkersPageState createState() => _MarkersPageState(); 94 | } 95 | -------------------------------------------------------------------------------- /example/lib/stateful_markers.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_map/flutter_map.dart'; 5 | import 'package:latlong/latlong.dart'; 6 | import 'package:map_controller/map_controller.dart'; 7 | 8 | class Place { 9 | Place(this.name, this.point); 10 | 11 | final String name; 12 | final LatLng point; 13 | } 14 | 15 | class _StatefulMarkersPageState extends State { 16 | MapController mapController; 17 | StatefulMapController statefulMapController; 18 | StreamSubscription sub; 19 | 20 | final List places = [ 21 | Place("Notre-Dame", LatLng(48.853831, 2.348722)), 22 | Place("Montmartre", LatLng(48.886463, 2.341169)), 23 | Place("Champs-Elysées", LatLng(48.873932, 2.294821)), 24 | Place("Chinatown", LatLng(48.827393, 2.361897)), 25 | Place("Tour Eiffel", LatLng(48.85801, 2.294713)) 26 | ]; 27 | 28 | final _markersOnMap = []; 29 | bool ready = false; 30 | 31 | void addMarker(BuildContext context) { 32 | for (final place in places) { 33 | if (!_markersOnMap.contains(place)) { 34 | print("Adding marker ${place.name}"); 35 | statefulMapController.addStatefulMarker( 36 | name: place.name, 37 | statefulMarker: StatefulMarker( 38 | //anchorAlign: AnchorAlign.bottom, 39 | height: 80.0, 40 | width: 150.0, 41 | state: {"showText": false}, 42 | point: place.point, 43 | builder: (BuildContext context, Map state) { 44 | Widget w; 45 | final markerIcon = IconButton( 46 | icon: const Icon(Icons.location_on), 47 | onPressed: () => statefulMapController.mutateMarker( 48 | name: place.name, 49 | property: "showText", 50 | value: !(state["showText"] as bool))); 51 | if (state["showText"] == true) { 52 | w = Column(children: [ 53 | markerIcon, 54 | Container( 55 | color: Colors.white, 56 | child: Padding( 57 | padding: const EdgeInsets.all(5.0), 58 | child: Text(place.name, textScaleFactor: 1.3))), 59 | ]); 60 | } else { 61 | w = markerIcon; 62 | } 63 | return w; 64 | })); 65 | _markersOnMap.add(place); 66 | return; 67 | } 68 | } 69 | } 70 | 71 | @override 72 | void initState() { 73 | mapController = MapController(); 74 | statefulMapController = StatefulMapController(mapController: mapController); 75 | statefulMapController.onReady.then((_) => setState(() => ready = true)); 76 | sub = statefulMapController.changeFeed.listen((change) => setState(() {})); 77 | super.initState(); 78 | } 79 | 80 | @override 81 | Widget build(BuildContext context) { 82 | return Scaffold( 83 | body: SafeArea( 84 | child: FlutterMap( 85 | mapController: mapController, 86 | options: MapOptions( 87 | center: LatLng(48.853831, 2.348722), 88 | zoom: 11.0, 89 | ), 90 | layers: [ 91 | statefulMapController.tileLayer, 92 | MarkerLayerOptions( 93 | markers: statefulMapController.markers, 94 | ), 95 | ], 96 | ), 97 | ), 98 | floatingActionButton: ready 99 | ? FloatingActionButton( 100 | child: Icon(Icons.add), 101 | onPressed: () => addMarker(context), 102 | ) 103 | : const Text(""), 104 | ); 105 | } 106 | 107 | @override 108 | void dispose() { 109 | sub.cancel(); 110 | super.dispose(); 111 | } 112 | } 113 | 114 | class StatefulMarkersPage extends StatefulWidget { 115 | @override 116 | _StatefulMarkersPageState createState() => _StatefulMarkersPageState(); 117 | } 118 | -------------------------------------------------------------------------------- /example/lib/tile_layer.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_map/flutter_map.dart'; 5 | import 'package:latlong/latlong.dart'; 6 | import 'package:map_controller/map_controller.dart'; 7 | 8 | class _TileLayerPageState extends State { 9 | MapController mapController; 10 | StatefulMapController statefulMapController; 11 | StreamSubscription sub; 12 | 13 | bool ready = false; 14 | 15 | @override 16 | void initState() { 17 | mapController = MapController(); 18 | statefulMapController = StatefulMapController(mapController: mapController); 19 | statefulMapController.onReady.then((_) => setState(() => ready = true)); 20 | sub = statefulMapController.changeFeed.listen((change) => setState(() {})); 21 | super.initState(); 22 | } 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Scaffold( 27 | body: SafeArea( 28 | child: Stack(children: [ 29 | FlutterMap( 30 | mapController: mapController, 31 | options: MapOptions(center: LatLng(48.853831, 2.348722), zoom: 11.0), 32 | layers: [ 33 | statefulMapController.tileLayer, 34 | MarkerLayerOptions(markers: statefulMapController.markers), 35 | ], 36 | ), 37 | Positioned( 38 | top: 15.0, 39 | right: 15.0, 40 | child: TileLayersBar(controller: statefulMapController)) 41 | ])), 42 | ); 43 | } 44 | 45 | @override 46 | void dispose() { 47 | sub.cancel(); 48 | super.dispose(); 49 | } 50 | } 51 | 52 | class TileLayerPage extends StatefulWidget { 53 | @override 54 | _TileLayerPageState createState() => _TileLayerPageState(); 55 | } 56 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: map_controller_example 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.7.0 <3.0.0" 22 | 23 | dependencies: 24 | flutter: 25 | sdk: flutter 26 | map_controller: 27 | path: ../ 28 | provider: ^4.3.3 29 | 30 | dev_dependencies: 31 | flutter_test: 32 | sdk: flutter 33 | 34 | # For information on the generic Dart part of this file, see the 35 | # following page: https://dart.dev/tools/pub/pubspec 36 | # The following section is specific to Flutter. 37 | flutter: 38 | 39 | # The following line ensures that the Material Icons font is 40 | # included with your application, so that you can use the icons in 41 | # the material Icons class. 42 | uses-material-design: true 43 | assets: 44 | - assets/airports.geojson 45 | # To add assets to your application, add an assets section, like this: 46 | # assets: 47 | # - images/a_dot_burr.jpeg 48 | # - images/a_dot_ham.jpeg 49 | # An image asset can refer to one or more resolution-specific "variants", see 50 | # https://flutter.dev/assets-and-images/#resolution-aware. 51 | # For details regarding adding assets from package dependencies, see 52 | # https://flutter.dev/assets-and-images/#from-packages 53 | # To add custom fonts to your application, add a fonts section here, 54 | # in this "flutter" section. Each entry in this list should have a 55 | # "family" key with the font family name, and a "fonts" key with a 56 | # list giving the asset and other descriptors for the font. For 57 | # example: 58 | # fonts: 59 | # - family: Schyler 60 | # fonts: 61 | # - asset: fonts/Schyler-Regular.ttf 62 | # - asset: fonts/Schyler-Italic.ttf 63 | # style: italic 64 | # - family: Trajan Pro 65 | # fonts: 66 | # - asset: fonts/TrajanPro.ttf 67 | # - asset: fonts/TrajanPro_Bold.ttf 68 | # weight: 700 69 | # 70 | # For details regarding fonts from package dependencies, 71 | # see https://flutter.dev/custom-fonts/#from-packages 72 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | map_controller_example 19 | 20 | 21 | 22 | 25 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "map_controller_example", 3 | "short_name": "map_controller_example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /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 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | INFOPLIST_FILE = Runner/Info.plist; 293 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 294 | PRODUCT_BUNDLE_IDENTIFIER = com.example.mapController; 295 | PRODUCT_NAME = "$(TARGET_NAME)"; 296 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 297 | SWIFT_VERSION = 5.0; 298 | VERSIONING_SYSTEM = "apple-generic"; 299 | }; 300 | name = Profile; 301 | }; 302 | 97C147031CF9000F007C117D /* Debug */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | ALWAYS_SEARCH_USER_PATHS = NO; 306 | CLANG_ANALYZER_NONNULL = YES; 307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 308 | CLANG_CXX_LIBRARY = "libc++"; 309 | CLANG_ENABLE_MODULES = YES; 310 | CLANG_ENABLE_OBJC_ARC = YES; 311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_COMMA = YES; 314 | CLANG_WARN_CONSTANT_CONVERSION = YES; 315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 317 | CLANG_WARN_EMPTY_BODY = YES; 318 | CLANG_WARN_ENUM_CONVERSION = YES; 319 | CLANG_WARN_INFINITE_RECURSION = YES; 320 | CLANG_WARN_INT_CONVERSION = YES; 321 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 322 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 323 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 326 | CLANG_WARN_STRICT_PROTOTYPES = YES; 327 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 328 | CLANG_WARN_UNREACHABLE_CODE = YES; 329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 331 | COPY_PHASE_STRIP = NO; 332 | DEBUG_INFORMATION_FORMAT = dwarf; 333 | ENABLE_STRICT_OBJC_MSGSEND = YES; 334 | ENABLE_TESTABILITY = YES; 335 | GCC_C_LANGUAGE_STANDARD = gnu99; 336 | GCC_DYNAMIC_NO_PIC = NO; 337 | GCC_NO_COMMON_BLOCKS = YES; 338 | GCC_OPTIMIZATION_LEVEL = 0; 339 | GCC_PREPROCESSOR_DEFINITIONS = ( 340 | "DEBUG=1", 341 | "$(inherited)", 342 | ); 343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 345 | GCC_WARN_UNDECLARED_SELECTOR = YES; 346 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 347 | GCC_WARN_UNUSED_FUNCTION = YES; 348 | GCC_WARN_UNUSED_VARIABLE = YES; 349 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 350 | MTL_ENABLE_DEBUG_INFO = YES; 351 | ONLY_ACTIVE_ARCH = YES; 352 | SDKROOT = iphoneos; 353 | TARGETED_DEVICE_FAMILY = "1,2"; 354 | }; 355 | name = Debug; 356 | }; 357 | 97C147041CF9000F007C117D /* Release */ = { 358 | isa = XCBuildConfiguration; 359 | buildSettings = { 360 | ALWAYS_SEARCH_USER_PATHS = NO; 361 | CLANG_ANALYZER_NONNULL = YES; 362 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 363 | CLANG_CXX_LIBRARY = "libc++"; 364 | CLANG_ENABLE_MODULES = YES; 365 | CLANG_ENABLE_OBJC_ARC = YES; 366 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 367 | CLANG_WARN_BOOL_CONVERSION = YES; 368 | CLANG_WARN_COMMA = YES; 369 | CLANG_WARN_CONSTANT_CONVERSION = YES; 370 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 372 | CLANG_WARN_EMPTY_BODY = YES; 373 | CLANG_WARN_ENUM_CONVERSION = YES; 374 | CLANG_WARN_INFINITE_RECURSION = YES; 375 | CLANG_WARN_INT_CONVERSION = YES; 376 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 377 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 378 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 379 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 380 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 381 | CLANG_WARN_STRICT_PROTOTYPES = YES; 382 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 383 | CLANG_WARN_UNREACHABLE_CODE = YES; 384 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 385 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 386 | COPY_PHASE_STRIP = NO; 387 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 388 | ENABLE_NS_ASSERTIONS = NO; 389 | ENABLE_STRICT_OBJC_MSGSEND = YES; 390 | GCC_C_LANGUAGE_STANDARD = gnu99; 391 | GCC_NO_COMMON_BLOCKS = YES; 392 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 393 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 394 | GCC_WARN_UNDECLARED_SELECTOR = YES; 395 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 396 | GCC_WARN_UNUSED_FUNCTION = YES; 397 | GCC_WARN_UNUSED_VARIABLE = YES; 398 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 399 | MTL_ENABLE_DEBUG_INFO = NO; 400 | SDKROOT = iphoneos; 401 | SUPPORTED_PLATFORMS = iphoneos; 402 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 403 | TARGETED_DEVICE_FAMILY = "1,2"; 404 | VALIDATE_PRODUCT = YES; 405 | }; 406 | name = Release; 407 | }; 408 | 97C147061CF9000F007C117D /* Debug */ = { 409 | isa = XCBuildConfiguration; 410 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 411 | buildSettings = { 412 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 413 | CLANG_ENABLE_MODULES = YES; 414 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 415 | ENABLE_BITCODE = NO; 416 | INFOPLIST_FILE = Runner/Info.plist; 417 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 418 | PRODUCT_BUNDLE_IDENTIFIER = com.example.mapController; 419 | PRODUCT_NAME = "$(TARGET_NAME)"; 420 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 421 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 422 | SWIFT_VERSION = 5.0; 423 | VERSIONING_SYSTEM = "apple-generic"; 424 | }; 425 | name = Debug; 426 | }; 427 | 97C147071CF9000F007C117D /* Release */ = { 428 | isa = XCBuildConfiguration; 429 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 430 | buildSettings = { 431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 432 | CLANG_ENABLE_MODULES = YES; 433 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 434 | ENABLE_BITCODE = NO; 435 | INFOPLIST_FILE = Runner/Info.plist; 436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 437 | PRODUCT_BUNDLE_IDENTIFIER = com.example.mapController; 438 | PRODUCT_NAME = "$(TARGET_NAME)"; 439 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 440 | SWIFT_VERSION = 5.0; 441 | VERSIONING_SYSTEM = "apple-generic"; 442 | }; 443 | name = Release; 444 | }; 445 | /* End XCBuildConfiguration section */ 446 | 447 | /* Begin XCConfigurationList section */ 448 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 449 | isa = XCConfigurationList; 450 | buildConfigurations = ( 451 | 97C147031CF9000F007C117D /* Debug */, 452 | 97C147041CF9000F007C117D /* Release */, 453 | 249021D3217E4FDB00AE95B9 /* Profile */, 454 | ); 455 | defaultConfigurationIsVisible = 0; 456 | defaultConfigurationName = Release; 457 | }; 458 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | 97C147061CF9000F007C117D /* Debug */, 462 | 97C147071CF9000F007C117D /* Release */, 463 | 249021D4217E4FDB00AE95B9 /* Profile */, 464 | ); 465 | defaultConfigurationIsVisible = 0; 466 | defaultConfigurationName = Release; 467 | }; 468 | /* End XCConfigurationList section */ 469 | }; 470 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 471 | } 472 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | map_controller 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 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/map_controller.dart: -------------------------------------------------------------------------------- 1 | library map_controller; 2 | 3 | export 'src/controller.dart'; 4 | export 'src/models.dart'; 5 | export 'src/models.dart'; 6 | export 'src/tile_layer/layers.dart'; 7 | export 'src/tile_layer/layers.dart'; 8 | export 'src/tile_layer/tile_layers_bar.dart'; 9 | export 'src/types.dart'; 10 | -------------------------------------------------------------------------------- /lib/src/controller.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_map/flutter_map.dart'; 6 | import 'package:geojson/geojson.dart'; 7 | import 'package:geopoint/geopoint.dart'; 8 | import 'package:latlong/latlong.dart'; 9 | import 'package:map_controller/src/exceptions.dart'; 10 | import 'package:pedantic/pedantic.dart'; 11 | import 'package:rxdart/rxdart.dart'; 12 | 13 | import 'models.dart'; 14 | import 'state/lines.dart'; 15 | import 'state/map.dart'; 16 | import 'state/markers.dart'; 17 | import 'state/polygons.dart'; 18 | import 'state/stateful_markers.dart'; 19 | import 'state/tile_layer.dart'; 20 | import 'types.dart'; 21 | 22 | /// The map controller 23 | class StatefulMapController { 24 | /// Provide a Flutter map [MapController] 25 | StatefulMapController( 26 | {@required this.mapController, 27 | this.tileLayerType = TileLayerType.normal, 28 | this.customTileLayer, 29 | this.verbose = false}) 30 | : assert(mapController != null) { 31 | // init state 32 | _markersState = MarkersState(mapController: mapController, notify: notify); 33 | _linesState = LinesState(notify: notify); 34 | _polygonsState = PolygonsState(notify: notify); 35 | _mapState = MapState(mapController: mapController, notify: notify); 36 | _statefulMarkersState = 37 | StatefulMarkersState(mapController: mapController, notify: notify); 38 | if (customTileLayer != null) { 39 | tileLayerType = TileLayerType.custom; 40 | } 41 | _tileLayerState = TileLayerState( 42 | type: tileLayerType, customTileLayer: customTileLayer, notify: notify); 43 | mapController.onReady.then((_) { 44 | // fire the map is ready callback 45 | if (!_readyCompleter.isCompleted) { 46 | _readyCompleter.complete(); 47 | } 48 | }); 49 | } 50 | 51 | /// The Flutter Map [MapController] 52 | final MapController mapController; 53 | 54 | /// The Flutter Map [MapOptions] 55 | MapOptions mapOptions; 56 | 57 | /// The initial tile layer 58 | TileLayerType tileLayerType; 59 | 60 | /// A custom tile layer options 61 | TileLayerOptions customTileLayer; 62 | 63 | /// Verbosity level 64 | final bool verbose; 65 | 66 | MapState _mapState; 67 | MarkersState _markersState; 68 | LinesState _linesState; 69 | PolygonsState _polygonsState; 70 | TileLayerState _tileLayerState; 71 | StatefulMarkersState _statefulMarkersState; 72 | 73 | final Completer _readyCompleter = Completer(); 74 | final _subject = PublishSubject(); 75 | 76 | /// On ready callback: this is fired when the contoller is ready 77 | Future get onReady => _readyCompleter.future; 78 | 79 | /// A stream with changes occuring on the map 80 | Stream get changeFeed => 81 | _subject.distinct(); 82 | 83 | /// The map zoom value 84 | double get zoom => mapController.zoom; 85 | 86 | /// Rotate the map 87 | set rotate(double degree) => mapController.rotate(degree); 88 | 89 | /// The map center value 90 | LatLng get center => mapController.center; 91 | 92 | /// The stateful markers present on the map 93 | Map get statefulMarkers => 94 | _statefulMarkersState.statefulMarkers; 95 | 96 | void addStatefulMarker({String name, StatefulMarker statefulMarker}) => 97 | _statefulMarkersState.addStatefulMarker(name, statefulMarker); 98 | 99 | void addStatefulMarkers(Map statefulMarkers) => 100 | _statefulMarkersState.addStatefulMarkers(statefulMarkers); 101 | 102 | void mutateMarker({String name, String property, dynamic value}) => 103 | _statefulMarkersState.mutate(name, property, value); 104 | 105 | /// The markers present on the map 106 | List get markers { 107 | List markers = []; 108 | markers 109 | ..addAll(_markersState.markers) 110 | ..addAll(_statefulMarkersState.markers); 111 | return markers; 112 | } 113 | 114 | /// The markers present on the map and their names 115 | Map get namedMarkers => _markersState.namedMarkers; 116 | 117 | /// The lines present on the map 118 | List get lines => _linesState.lines; 119 | 120 | /// The named lines present on the map 121 | Map get namedLines => _linesState.namedLines; 122 | 123 | /// The polygons present on the map 124 | List get polygons => _polygonsState.polygons; 125 | 126 | /// The named polygons present on the map 127 | Map get namedPolygons => _polygonsState.namedPolygons; 128 | 129 | /// The current map tile layer 130 | TileLayerOptions get tileLayer => _tileLayerState.tileLayer; 131 | 132 | /// Zoom in one level 133 | Future zoomIn() => _mapState.zoomIn(); 134 | 135 | /// Zoom out one level 136 | Future zoomOut() => _mapState.zoomOut(); 137 | 138 | /// Zoom to level 139 | Future zoomTo(double value) => _mapState.zoomTo(value); 140 | 141 | /// Center the map on a [LatLng] 142 | Future centerOnPoint(LatLng point) => _mapState.centerOnPoint(point); 143 | 144 | /// The callback used to handle gestures and keep the state in sync 145 | void onPositionChanged(MapPosition pos, bool gesture) => 146 | _mapState.onPositionChanged(pos, gesture); 147 | 148 | /// Add a marker on the map 149 | Future addMarker({@required Marker marker, @required String name}) => 150 | _markersState.addMarker(marker: marker, name: name); 151 | 152 | /// Remove a marker from the map 153 | Future removeMarker({@required String name}) => 154 | _markersState.removeMarker(name: name); 155 | 156 | /// Add multiple markers to the map 157 | Future addMarkers({@required Map markers}) => 158 | _markersState.addMarkers(markers: markers); 159 | 160 | /// Remove multiple makers from the map 161 | Future removeMarkers({@required List names}) => 162 | _markersState.removeMarkers(names: names); 163 | 164 | /// Fit bounds for all markers on map 165 | Future fitMarkers() async => _markersState.fitAll(); 166 | 167 | /// Fit bounds for one marker on map 168 | Future fitMarker(String name) async => _markersState.fitOne(name); 169 | 170 | /// Fit bounds and zoom the map to center on a line 171 | Future fitLine(String name) async { 172 | final line = _linesState.namedLines[name]; 173 | final bounds = LatLngBounds(); 174 | line.points.forEach(bounds.extend); 175 | mapController.fitBounds(bounds); 176 | } 177 | 178 | /// Add a line on the map 179 | Future addLine( 180 | {@required String name, 181 | @required List points, 182 | double width = 3.0, 183 | Color color = Colors.green, 184 | bool isDotted = false}) async { 185 | await _linesState.addLine( 186 | name: name, 187 | points: points, 188 | color: color, 189 | width: width, 190 | isDotted: isDotted); 191 | } 192 | 193 | /// Add a line on the map 194 | Future addLineFromGeoPoints( 195 | {@required String name, 196 | @required List geoPoints, 197 | double width = 3.0, 198 | Color color = Colors.green, 199 | bool isDotted = false}) async { 200 | final points = 201 | GeoSerie(type: GeoSerieType.line, name: "serie", geoPoints: geoPoints) 202 | .toLatLng(); 203 | await _linesState.addLine( 204 | name: name, 205 | points: points, 206 | color: color, 207 | width: width, 208 | isDotted: isDotted); 209 | } 210 | 211 | /// Remove a line from the map 212 | Future removeLine(String name) => _linesState.removeLine(name); 213 | 214 | /// Remove a polygon from the map 215 | Future removePolygon(String name) => _polygonsState.removePolygon(name); 216 | 217 | /// Add a polygon on the map 218 | Future addPolygon( 219 | {@required String name, 220 | @required List points, 221 | Color color = Colors.lightBlue, 222 | double borderWidth = 0.0, 223 | Color borderColor = const Color(0xFFFFFF00)}) => 224 | _polygonsState.addPolygon( 225 | name: name, 226 | points: points, 227 | color: color, 228 | borderWidth: borderWidth, 229 | borderColor: borderColor); 230 | 231 | /// Switch to a tile layer 232 | void switchTileLayer(TileLayerType layer) => 233 | _tileLayerState.switchTileLayer(layer); 234 | 235 | /// Display some geojson data on the map 236 | Future fromGeoJson(String data, 237 | {bool verbose = false, 238 | Icon markerIcon = const Icon(Icons.location_on), 239 | bool noIsolate = false}) async { 240 | print("From geojson $data"); 241 | 242 | final geojson = GeoJson(); 243 | geojson.processedFeatures.listen((GeoJsonFeature feature) { 244 | switch (feature.type) { 245 | case GeoJsonFeatureType.point: 246 | final point = feature.geometry as GeoJsonPoint; 247 | unawaited(addMarker( 248 | name: point.name, 249 | marker: Marker( 250 | point: 251 | LatLng(point.geoPoint.latitude, point.geoPoint.longitude), 252 | builder: (BuildContext context) => markerIcon), 253 | )); 254 | break; 255 | case GeoJsonFeatureType.multipoint: 256 | final mp = feature.geometry as GeoJsonMultiPoint; 257 | for (final geoPoint in mp.geoSerie.geoPoints) { 258 | unawaited(addMarker( 259 | name: geoPoint.name, 260 | marker: Marker( 261 | point: LatLng(geoPoint.latitude, geoPoint.longitude), 262 | builder: (BuildContext context) => markerIcon), 263 | )); 264 | } 265 | break; 266 | case GeoJsonFeatureType.line: 267 | final line = feature.geometry as GeoJsonLine; 268 | unawaited(addLine(name: line.name, points: line.geoSerie.toLatLng())); 269 | break; 270 | case GeoJsonFeatureType.multiline: 271 | final ml = feature.geometry as GeoJsonMultiLine; 272 | for (final line in ml.lines) { 273 | unawaited( 274 | addLine(name: line.name, points: line.geoSerie.toLatLng())); 275 | } 276 | break; 277 | case GeoJsonFeatureType.polygon: 278 | final poly = feature.geometry as GeoJsonPolygon; 279 | for (final geoSerie in poly.geoSeries) { 280 | unawaited( 281 | addPolygon(name: geoSerie.name, points: geoSerie.toLatLng())); 282 | } 283 | break; 284 | case GeoJsonFeatureType.multipolygon: 285 | final mp = feature.geometry as GeoJsonMultiPolygon; 286 | for (final poly in mp.polygons) { 287 | for (final geoSerie in poly.geoSeries) { 288 | unawaited( 289 | addPolygon(name: geoSerie.name, points: geoSerie.toLatLng())); 290 | } 291 | } 292 | break; 293 | case GeoJsonFeatureType.geometryCollection: 294 | // TODO : implement 295 | throw const NotImplementedException( 296 | "GeoJsonFeatureType.geometryCollection Not implemented"); 297 | } 298 | }); 299 | if (noIsolate) { 300 | await geojson.parseInMainThread(data); 301 | } else { 302 | await geojson.parse(data); 303 | } 304 | } 305 | 306 | /// Export all the map assets to a [GeoJsonFeatureCollection] 307 | GeoJsonFeatureCollection toGeoJsonFeatures() { 308 | final featureCollection = GeoJsonFeatureCollection() 309 | ..collection = []; 310 | final markersFeature = _markersState.toGeoJsonFeatures(); 311 | final linesFeature = _linesState.toGeoJsonFeatures(); 312 | final polygonsFeature = _polygonsState.toGeoJsonFeatures(); 313 | if (markersFeature != null) { 314 | featureCollection.collection.add(markersFeature); 315 | } 316 | if (linesFeature != null) { 317 | featureCollection.collection.add(linesFeature); 318 | } 319 | if (polygonsFeature != null) { 320 | featureCollection.collection.add(polygonsFeature); 321 | } 322 | return featureCollection; 323 | } 324 | 325 | /// Convert the map assets to a geojson string 326 | String toGeoJson() => toGeoJsonFeatures().serialize(); 327 | 328 | /// Notify to the changefeed 329 | void notify( 330 | String name, dynamic value, Function from, MapControllerChangeType type) { 331 | final change = StatefulMapControllerStateChange( 332 | name: name, value: value, from: from, type: type); 333 | if (verbose) { 334 | print("Map state change: $change"); 335 | } 336 | _subject.add(change); 337 | } 338 | } 339 | -------------------------------------------------------------------------------- /lib/src/exceptions.dart: -------------------------------------------------------------------------------- 1 | /// An exception for a marker 2 | class MarkerException implements Exception { 3 | /// Provide a message 4 | const MarkerException(this.message); 5 | 6 | /// The error message 7 | final String message; 8 | } 9 | 10 | /// An exception for a not implemented feature 11 | class NotImplementedException implements Exception { 12 | /// Default constructor 13 | const NotImplementedException(this.message); 14 | 15 | /// The error message 16 | final String message; 17 | } 18 | -------------------------------------------------------------------------------- /lib/src/models.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_map/flutter_map.dart'; 4 | import 'package:latlong/latlong.dart'; 5 | 6 | typedef StatefulMarkerBuidler = Widget Function( 7 | BuildContext, Map); 8 | 9 | class StatefulMarker { 10 | StatefulMarker( 11 | {@required this.point, 12 | @required this.state, 13 | @required this.builder, 14 | this.width = 30.0, 15 | this.height = 30.0, 16 | this.anchorAlign = AnchorAlign.center}); 17 | 18 | final LatLng point; 19 | final double width; 20 | final double height; 21 | final AnchorAlign anchorAlign; 22 | final Map state; 23 | StatefulMarkerBuidler builder; 24 | 25 | Marker get marker => _build(); 26 | 27 | void mutate(String name, dynamic value) => state[name] = value; 28 | 29 | Marker _build() { 30 | return Marker( 31 | anchorPos: AnchorPos.align(anchorAlign), 32 | point: point, 33 | width: width, 34 | height: height, 35 | builder: (BuildContext c) => builder(c, state)); 36 | } 37 | } 38 | 39 | /// The type of the controller change 40 | enum MapControllerChangeType { 41 | /// Update center 42 | center, 43 | 44 | /// Update zoom 45 | zoom, 46 | 47 | /// Update markers 48 | markers, 49 | 50 | /// Update lines 51 | lines, 52 | 53 | /// Update polygons 54 | polygons, 55 | 56 | /// Update position stream state 57 | positionStream, 58 | 59 | /// Change the tile layer 60 | tileLayer 61 | } 62 | 63 | /// Desctiption of a state change 64 | class StatefulMapControllerStateChange { 65 | /// Name and value of the change 66 | StatefulMapControllerStateChange( 67 | {@required this.type, 68 | @required this.name, 69 | @required this.value, 70 | this.from}) 71 | : assert(name != null), 72 | assert(type != null); 73 | 74 | /// Name of the change 75 | final String name; 76 | 77 | /// Value of the change 78 | final dynamic value; 79 | 80 | /// Where the change comes from 81 | final Function from; 82 | 83 | /// The change type 84 | final MapControllerChangeType type; 85 | 86 | /// String representation 87 | @override 88 | String toString() { 89 | return "${this.name} ${this.value} from ${this.from}"; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /lib/src/state/lines.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_map/flutter_map.dart'; 4 | import 'package:geojson/geojson.dart'; 5 | import 'package:geopoint/geopoint.dart'; 6 | import 'package:latlong/latlong.dart'; 7 | 8 | import '../models.dart'; 9 | 10 | /// State of the lines on the map 11 | class LinesState { 12 | /// Default contructor 13 | LinesState({@required this.notify}) : assert(notify != null); 14 | 15 | /// The notify function 16 | final Function notify; 17 | 18 | final Map _namedLines = {}; 19 | 20 | /// The named lines on the map 21 | Map get namedLines => _namedLines; 22 | 23 | /// The lines present on the map 24 | List get lines => _namedLines.values.toList(); 25 | 26 | /// Add a line on the map 27 | Future addLine( 28 | {@required String name, 29 | @required List points, 30 | double width = 1.0, 31 | Color color = Colors.green, 32 | bool isDotted = false}) async { 33 | //print("ADD LINE $name of ${points.length} points"); 34 | _namedLines[name] = Polyline( 35 | points: points, strokeWidth: width, color: color, isDotted: isDotted); 36 | notify("updateLines", _namedLines[name], addLine, 37 | MapControllerChangeType.lines); 38 | } 39 | 40 | /// Remove a line from the map 41 | Future removeLine(String name) async { 42 | if (_namedLines.containsKey(name)) { 43 | _namedLines.remove(name); 44 | notify("updateLines", name, removeLine, MapControllerChangeType.lines); 45 | } 46 | } 47 | 48 | /// Export all lines to a [GeoJsonFeature] with geometry 49 | /// type [GeoJsonMultiLine] 50 | GeoJsonFeature toGeoJsonFeatures() { 51 | if (namedLines.isEmpty) { 52 | return null; 53 | } 54 | final multiLine = GeoJsonMultiLine(name: "map_lines"); 55 | for (final k in namedLines.keys) { 56 | final polyline = namedLines[k]; 57 | final line = GeoJsonLine()..name = k; 58 | final geoSerie = GeoSerie(name: line.name, type: GeoSerieType.line); 59 | for (final point in polyline.points) { 60 | geoSerie.geoPoints.add( 61 | GeoPoint(latitude: point.latitude, longitude: point.longitude)); 62 | } 63 | line.geoSerie = geoSerie; 64 | multiLine.lines.add(line); 65 | } 66 | final feature = GeoJsonFeature() 67 | ..type = GeoJsonFeatureType.multiline 68 | ..geometry = multiLine 69 | ..properties = {"name": "map_lines"}; 70 | return feature; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/src/state/map.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_map/flutter_map.dart'; 4 | import 'package:latlong/latlong.dart'; 5 | 6 | import '../models.dart'; 7 | 8 | /// State of the map 9 | class MapState { 10 | /// Default constructor 11 | MapState({@required this.mapController, @required this.notify}) 12 | : assert(mapController != null); 13 | 14 | /// The [MapController] 15 | final MapController mapController; 16 | 17 | /// Function to notify the changefeed 18 | final Function notify; 19 | 20 | double _zoom = 1.0; 21 | LatLng _center = LatLng(0.0, 0.0); 22 | 23 | /// Zoom in one level 24 | Future zoomIn() async { 25 | //print("ZOOM IN"); 26 | final z = mapController.zoom + 1; 27 | mapController.move(mapController.center, z); 28 | _zoom = z; 29 | notify("zoom", z, zoomIn, MapControllerChangeType.zoom); 30 | } 31 | 32 | /// Zoom out one level 33 | Future zoomOut() async { 34 | //print("ZOOM OUT"); 35 | final z = mapController.zoom - 1; 36 | mapController.move(mapController.center, z); 37 | _zoom = z; 38 | notify("zoom", z, zoomOut, MapControllerChangeType.zoom); 39 | } 40 | 41 | /// Zoom to level 42 | Future zoomTo(double value) async { 43 | //print("ZOOM TO $value"); 44 | mapController.move(mapController.center, value); 45 | _zoom = value; 46 | notify("zoom", value, zoomOut, MapControllerChangeType.zoom); 47 | } 48 | 49 | /// Center the map on a [LatLng] 50 | Future centerOnPoint(LatLng point) async { 51 | mapController.move(point, mapController.zoom); 52 | _center = point; 53 | notify("center", point, centerOnPoint, MapControllerChangeType.center); 54 | } 55 | 56 | /// Tell listeners that the zoom or center has changed 57 | /// 58 | /// This is used to handle the gestures 59 | void onPositionChanged(MapPosition posChange, bool gesture) { 60 | //print("Position changed: zoom ${posChange.zoom} / ${posChange.center}"); 61 | if (posChange.zoom != _zoom) { 62 | _zoom = posChange.zoom; 63 | notify("zoom", posChange.zoom, onPositionChanged, 64 | MapControllerChangeType.zoom); 65 | } 66 | if (posChange.center != _center) { 67 | _center = posChange.center; 68 | notify("center", posChange.center, onPositionChanged, 69 | MapControllerChangeType.center); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/src/state/markers.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_map/flutter_map.dart'; 4 | import 'package:geojson/geojson.dart'; 5 | import 'package:geopoint/geopoint.dart'; 6 | 7 | import '../exceptions.dart'; 8 | import '../models.dart'; 9 | 10 | /// The state of the markers on the map 11 | class MarkersState { 12 | /// Provide a [MapController] 13 | MarkersState({@required this.mapController, @required this.notify}) 14 | : assert(mapController != null); 15 | 16 | /// The Flutter Map controller 17 | final MapController mapController; 18 | 19 | /// The notification function 20 | final Function notify; 21 | 22 | var _markers = []; 23 | final Map _namedMarkers = {}; 24 | 25 | /// The markers present on the map 26 | List get markers => _markers; 27 | 28 | /// The markers present on the map and their names 29 | Map get namedMarkers => _namedMarkers; 30 | 31 | /// Add a marker on the map 32 | Future addMarker( 33 | {@required String name, @required Marker marker}) async { 34 | if (marker == null) { 35 | throw ArgumentError("marker must not be null"); 36 | } 37 | if (name == null) { 38 | throw ArgumentError("name must not be null"); 39 | } 40 | //print("STATE ADD MARKER $name"); 41 | //print("STATE MARKERS: $_namedMarkers"); 42 | try { 43 | //_buildMarkers(); 44 | final markerAt = _markerAt(_namedMarkers[name], name); 45 | if (markerAt == null) { 46 | _markers.add(marker); 47 | } else { 48 | _markers[markerAt] = marker; 49 | } 50 | } catch (e) { 51 | throw MarkerException("Can not build marker $name for add: $e"); 52 | } 53 | notify("updateMarkers", marker, addMarker, MapControllerChangeType.markers); 54 | try { 55 | _namedMarkers[name] = marker; 56 | } catch (e) { 57 | throw MarkerException("Can not add marker: $e"); 58 | } 59 | //print("STATE MARKERS AFTER ADD: $_namedMarkers"); 60 | } 61 | 62 | /// Remove a marker from the map 63 | Future removeMarker({@required String name}) async { 64 | if (name == null) { 65 | throw ArgumentError("name must not be null"); 66 | } 67 | //if (name != "livemarker") { 68 | //print("STATE REMOVE MARKER $name"); 69 | //print("STATE MARKERS: $_namedMarkers"); 70 | //} 71 | try { 72 | //_buildMarkers(); 73 | final removeAt = _markerAt(_namedMarkers[name], name); 74 | if (removeAt != null) { 75 | _markers.removeAt(removeAt); 76 | } else { 77 | throw MarkerException("Can not find marker $name for removal"); 78 | } 79 | } catch (e) { 80 | throw MarkerException("Can not build for remove marker: $e"); 81 | } 82 | notify( 83 | "updateMarkers", name, removeMarker, MapControllerChangeType.markers); 84 | try { 85 | final res = _namedMarkers.remove(name); 86 | if (res == null) { 87 | throw MarkerException("Marker $name not found in map"); 88 | } 89 | } catch (e) { 90 | throw MarkerException("Can not remove marker: $e"); 91 | } 92 | print("STATE MARKERS AFTER REMOVE: $_namedMarkers"); 93 | } 94 | 95 | int _markerAt(Marker marker, String name) { 96 | int removeAt; 97 | if (!_namedMarkers.containsKey(name)) { 98 | return removeAt; 99 | } 100 | var i = 0; 101 | for (final m in _markers) { 102 | if (m.point == _namedMarkers[name].point) { 103 | removeAt = i; 104 | break; 105 | } 106 | ++i; 107 | } 108 | return removeAt; 109 | } 110 | 111 | /// Add multiple markers on the map 112 | Future addMarkers({@required Map markers}) async { 113 | if (markers == null) { 114 | throw ArgumentError.notNull("markers must not be null"); 115 | } 116 | try { 117 | markers.forEach((k, v) { 118 | _namedMarkers[k] = v; 119 | }); 120 | } catch (e) { 121 | throw MarkerException("Can not add markers: $e"); 122 | } 123 | _buildMarkers(); 124 | notify( 125 | "updateMarkers", markers, addMarkers, MapControllerChangeType.markers); 126 | } 127 | 128 | /// Remove multiple markers from the map 129 | Future removeMarkers({@required List names}) async { 130 | if (names == null) { 131 | throw ArgumentError.notNull("names must not be null"); 132 | } 133 | names.forEach(_namedMarkers.remove); 134 | _buildMarkers(); 135 | notify( 136 | "updateMarkers", names, removeMarkers, MapControllerChangeType.markers); 137 | } 138 | 139 | /// Export all markers to a [GeoJsonFeature] with geometry 140 | /// type [GeoJsonMultiPoint] 141 | GeoJsonFeature toGeoJsonFeatures() { 142 | if (namedMarkers.isEmpty) { 143 | return null; 144 | } 145 | final multiPoint = GeoJsonMultiPoint(); 146 | final geoPoints = []; 147 | for (final k in namedMarkers.keys) { 148 | final m = namedMarkers[k]; 149 | geoPoints.add(GeoPoint( 150 | latitude: m.point.latitude, 151 | longitude: m.point.longitude, 152 | )); 153 | } 154 | multiPoint 155 | ..name = "map_markers" 156 | ..geoSerie = 157 | GeoSerie.fromNameAndType(name: multiPoint.name, typeStr: "group"); 158 | multiPoint.geoSerie.geoPoints = geoPoints; 159 | final feature = GeoJsonFeature() 160 | ..type = GeoJsonFeatureType.multipoint 161 | ..properties = {"name": multiPoint.name} 162 | ..geometry = multiPoint; 163 | return feature; 164 | } 165 | 166 | /// Fit a marker on map 167 | void fitOne(String name) { 168 | final bounds = LatLngBounds()..extend(namedMarkers[name].point); 169 | mapController.fitBounds(bounds); 170 | } 171 | 172 | /// Fit all markers on map 173 | void fitAll() { 174 | final bounds = LatLngBounds(); 175 | for (final m in namedMarkers.keys) { 176 | bounds.extend(namedMarkers[m].point); 177 | } 178 | mapController.fitBounds(bounds); 179 | } 180 | 181 | void _buildMarkers() { 182 | _markers = _namedMarkers.values.toList(); 183 | //print("AFTER BUILD MARKERS"); 184 | //_printMarkers(); 185 | } 186 | 187 | /*void _printMarkers() { 188 | for (var k in _namedMarkers.keys) { 189 | print("NAMED MARKER $k: ${_namedMarkers[k]}"); 190 | } 191 | }*/ 192 | } 193 | -------------------------------------------------------------------------------- /lib/src/state/polygons.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter_map/flutter_map.dart'; 4 | import 'package:latlong/latlong.dart'; 5 | import 'package:geojson/geojson.dart'; 6 | import 'package:geopoint/geopoint.dart'; 7 | import '../models.dart'; 8 | 9 | /// State of the polygons on the map 10 | class PolygonsState { 11 | /// Default contructor 12 | PolygonsState({@required this.notify}) : assert(notify != null); 13 | 14 | /// The notify function 15 | final Function notify; 16 | 17 | final Map _namedPolygons = {}; 18 | 19 | /// The named polygons on the map 20 | Map get namedPolygons => _namedPolygons; 21 | 22 | /// The lines present on the map 23 | List get polygons => _namedPolygons.values.toList(); 24 | 25 | /// Add a polygon on the map 26 | Future addPolygon( 27 | {@required String name, 28 | @required List points, 29 | Color color, 30 | double borderWidth, 31 | Color borderColor}) async { 32 | _namedPolygons[name] = Polygon( 33 | points: points, 34 | color: color, 35 | borderStrokeWidth: borderWidth, 36 | borderColor: borderColor); 37 | notify("updatePolygons", _namedPolygons[name], addPolygon, 38 | MapControllerChangeType.polygons); 39 | } 40 | 41 | /// Remove a polygon from the map 42 | Future removePolygon(String name) async { 43 | if (_namedPolygons.containsKey(name)) { 44 | _namedPolygons.remove(name); 45 | notify("updatePolygons", name, removePolygon, 46 | MapControllerChangeType.polygons); 47 | } 48 | } 49 | 50 | /// Export all polygons to a [GeoJsonFeature] with geometry 51 | /// type [GeoJsonMultiPolygon] 52 | GeoJsonFeature toGeoJsonFeatures() { 53 | if (namedPolygons.isEmpty) { 54 | return null; 55 | } 56 | final multiPolygon = GeoJsonMultiPolygon(name: "map_polygons"); 57 | for (final k in namedPolygons.keys) { 58 | final mapPolygon = namedPolygons[k]; 59 | final polygon = GeoJsonPolygon()..name = k; 60 | final geoSerie = GeoSerie(name: polygon.name, type: GeoSerieType.polygon); 61 | for (final point in mapPolygon.points) { 62 | geoSerie.geoPoints.add( 63 | GeoPoint(latitude: point.latitude, longitude: point.longitude)); 64 | } 65 | polygon.geoSeries = [geoSerie]; 66 | multiPolygon.polygons.add(polygon); 67 | } 68 | final feature = GeoJsonFeature() 69 | ..type = GeoJsonFeatureType.multipolygon 70 | ..geometry = multiPolygon 71 | ..properties = {"name": "map_polygons"}; 72 | return feature; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /lib/src/state/stateful_markers.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter_map/flutter_map.dart'; 3 | 4 | import '../models.dart'; 5 | 6 | class StatefulMarkersState { 7 | /// Provide a [MapController] 8 | StatefulMarkersState({@required this.mapController, @required this.notify}) 9 | : assert(mapController != null); 10 | 11 | /// The Flutter Map controller 12 | final MapController mapController; 13 | 14 | /// The notification function 15 | final Function notify; 16 | 17 | final _statefulMarkers = {}; 18 | final _namedMarkers = {}; 19 | 20 | List get markers => _namedMarkers.values.toList(); 21 | Map get statefulMarkers => _statefulMarkers; 22 | 23 | void addStatefulMarker(String name, StatefulMarker statefulMarker) { 24 | _statefulMarkers[name] = statefulMarker; 25 | _namedMarkers[name] = statefulMarker.marker; 26 | notify("updateMarkers", statefulMarker, addStatefulMarker, 27 | MapControllerChangeType.markers); 28 | } 29 | 30 | void addStatefulMarkers(Map statefulMarkers) { 31 | statefulMarkers.forEach((name, marker) { 32 | _statefulMarkers[name] = marker; 33 | _namedMarkers[name] = marker.marker; 34 | }); 35 | notify("updateMarkers", statefulMarkers, addStatefulMarkers, 36 | MapControllerChangeType.markers); 37 | } 38 | 39 | void mutate(String name, String property, dynamic value) { 40 | _statefulMarkers[name].mutate(property, value); 41 | addStatefulMarker(name, _statefulMarkers[name]); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/src/state/tile_layer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_map/flutter_map.dart'; 4 | 5 | import '../models.dart'; 6 | import '../types.dart'; 7 | 8 | /// The state of the tile layer 9 | class TileLayerState { 10 | /// Default contructor 11 | TileLayerState( 12 | {@required this.type, @required this.notify, this.customTileLayer}) { 13 | _tileLayer = _tileLayerForType(type); 14 | } 15 | 16 | /// The tile layer type 17 | TileLayerType type; 18 | 19 | /// A custom tile layer options 20 | TileLayerOptions customTileLayer; 21 | 22 | /// Function to notify the changefeed 23 | final Function notify; 24 | 25 | TileLayerOptions _tileLayer; 26 | 27 | TileLayerOptions get tileLayer => _tileLayer; 28 | 29 | void switchTileLayer(TileLayerType layer) { 30 | _tileLayer = _tileLayerForType(layer); 31 | notify("switchTileLayer", layer, switchTileLayer, 32 | MapControllerChangeType.tileLayer); 33 | } 34 | 35 | TileLayerOptions _tileLayerForType(TileLayerType layer) { 36 | TileLayerOptions tlo; 37 | switch (layer) { 38 | case TileLayerType.hike: 39 | tlo = TileLayerOptions( 40 | urlTemplate: "https://tiles.wmflabs.org/hikebike/{z}/{x}/{y}.png", 41 | subdomains: ['a', 'b', 'c'], 42 | tileProvider: kIsWeb 43 | ? _NonCachingNetworkTileProvider() 44 | : NetworkTileProvider()); 45 | break; 46 | case TileLayerType.topography: 47 | tlo = TileLayerOptions( 48 | urlTemplate: "http://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", 49 | subdomains: ['a', 'b', 'c'], 50 | tileProvider: kIsWeb 51 | ? _NonCachingNetworkTileProvider() 52 | : NetworkTileProvider()); 53 | break; 54 | case TileLayerType.monochrome: 55 | tlo = TileLayerOptions( 56 | urlTemplate: 57 | "http://www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png", 58 | subdomains: ['a', 'b', 'c'], 59 | tileProvider: kIsWeb 60 | ? _NonCachingNetworkTileProvider() 61 | : NetworkTileProvider()); 62 | break; 63 | case TileLayerType.custom: 64 | if (customTileLayer != null) { 65 | tlo = customTileLayer; 66 | } else { 67 | tlo = customTileLayer; 68 | } 69 | break; 70 | default: 71 | tlo = TileLayerOptions( 72 | urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", 73 | subdomains: ['a', 'b', 'c'], 74 | tileProvider: kIsWeb 75 | ? _NonCachingNetworkTileProvider() 76 | : NetworkTileProvider()); 77 | } 78 | return tlo; 79 | } 80 | } 81 | 82 | class _NonCachingNetworkTileProvider extends TileProvider { 83 | @override 84 | ImageProvider getImage(Coords coords, TileLayerOptions options) { 85 | return NetworkImage(getTileUrl(coords, options)); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /lib/src/tile_layer/layers.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../controller.dart'; 4 | import '../types.dart'; 5 | 6 | class _MapTileLayerNormalState extends State { 7 | _MapTileLayerNormalState({@required this.controller}); 8 | 9 | final StatefulMapController controller; 10 | 11 | TileLayerType _tileLayerType; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return IconButton( 16 | iconSize: 30.0, 17 | color: (_tileLayerType == TileLayerType.normal) 18 | ? Colors.blueGrey 19 | : Colors.grey, 20 | icon: const Icon(Icons.map), 21 | tooltip: "Normal layer", 22 | onPressed: () => widget.controller.switchTileLayer(TileLayerType.normal), 23 | ); 24 | } 25 | } 26 | 27 | /// Normal tile layer 28 | class MapTileLayerNormal extends StatefulWidget { 29 | /// Provide a controller 30 | const MapTileLayerNormal({@required this.controller}); 31 | 32 | /// The map controller 33 | final StatefulMapController controller; 34 | 35 | @override 36 | _MapTileLayerNormalState createState() => 37 | _MapTileLayerNormalState(controller: controller); 38 | } 39 | 40 | class _MapTileLayerMonochromeState extends State { 41 | _MapTileLayerMonochromeState({@required this.controller}); 42 | 43 | final StatefulMapController controller; 44 | 45 | TileLayerType _tileLayerType; 46 | 47 | @override 48 | Widget build(BuildContext context) { 49 | return IconButton( 50 | iconSize: 30.0, 51 | color: (_tileLayerType == TileLayerType.monochrome) 52 | ? Colors.blueGrey 53 | : Colors.grey, 54 | icon: const Icon(Icons.local_car_wash), 55 | tooltip: "Monochrome layer", 56 | onPressed: () => controller.switchTileLayer(TileLayerType.monochrome), 57 | ); 58 | } 59 | } 60 | 61 | /// Monochrome tile layer 62 | class MapTileLayerMonochrome extends StatefulWidget { 63 | /// Provide a controller 64 | const MapTileLayerMonochrome({@required this.controller}); 65 | 66 | /// The map controller 67 | final StatefulMapController controller; 68 | 69 | @override 70 | _MapTileLayerMonochromeState createState() => 71 | _MapTileLayerMonochromeState(controller: controller); 72 | } 73 | 74 | class _MapTileLayerTopographyState extends State { 75 | _MapTileLayerTopographyState({@required this.controller}); 76 | 77 | final StatefulMapController controller; 78 | 79 | TileLayerType _tileLayerType; 80 | 81 | @override 82 | Widget build(BuildContext context) { 83 | return IconButton( 84 | iconSize: 30.0, 85 | color: (_tileLayerType == TileLayerType.topography) 86 | ? Colors.blueGrey 87 | : Colors.grey, 88 | icon: const Icon(Icons.photo), 89 | tooltip: "Topography layer", 90 | onPressed: () => controller.switchTileLayer(TileLayerType.topography), 91 | ); 92 | } 93 | } 94 | 95 | /// Topography tile layer 96 | class MapTileLayerTopography extends StatefulWidget { 97 | /// Provide a controller 98 | const MapTileLayerTopography({@required this.controller}); 99 | 100 | /// The map controller 101 | final StatefulMapController controller; 102 | 103 | @override 104 | _MapTileLayerTopographyState createState() => 105 | _MapTileLayerTopographyState(controller: controller); 106 | } 107 | 108 | class _MapTileLayerHikeState extends State { 109 | _MapTileLayerHikeState({@required this.controller}); 110 | 111 | final StatefulMapController controller; 112 | 113 | TileLayerType _tileLayerType; 114 | 115 | @override 116 | Widget build(BuildContext context) { 117 | return IconButton( 118 | iconSize: 30.0, 119 | color: (_tileLayerType == TileLayerType.hike) 120 | ? Colors.blueGrey 121 | : Colors.grey, 122 | icon: const Icon(Icons.landscape), 123 | tooltip: "Hills layer", 124 | onPressed: () => controller.switchTileLayer(TileLayerType.hike), 125 | ); 126 | } 127 | } 128 | 129 | /// Hike tile layer 130 | class MapTileLayerHike extends StatefulWidget { 131 | /// Provide a controller 132 | const MapTileLayerHike({@required this.controller}); 133 | 134 | /// The map controller 135 | final StatefulMapController controller; 136 | 137 | @override 138 | _MapTileLayerHikeState createState() => 139 | _MapTileLayerHikeState(controller: controller); 140 | } 141 | 142 | class _MapTileLayerCustomState extends State { 143 | _MapTileLayerCustomState({@required this.controller}); 144 | 145 | final StatefulMapController controller; 146 | 147 | TileLayerType _tileLayerType; 148 | 149 | @override 150 | Widget build(BuildContext context) { 151 | return IconButton( 152 | iconSize: 30.0, 153 | color: (_tileLayerType == TileLayerType.custom) 154 | ? Colors.blueGrey 155 | : Colors.grey, 156 | icon: const Icon(Icons.map), 157 | tooltip: "Custom layer", 158 | onPressed: () => widget.controller.switchTileLayer(TileLayerType.custom), 159 | ); 160 | } 161 | } 162 | 163 | /// Custom tile layer 164 | class MapTileLayerCustom extends StatefulWidget { 165 | /// Provide a controller 166 | const MapTileLayerCustom({@required this.controller}); 167 | 168 | /// The map controller 169 | final StatefulMapController controller; 170 | 171 | @override 172 | _MapTileLayerCustomState createState() => 173 | _MapTileLayerCustomState(controller: controller); 174 | } 175 | -------------------------------------------------------------------------------- /lib/src/tile_layer/tile_layers_bar.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:map_controller/map_controller.dart'; 5 | 6 | import '../controller.dart'; 7 | import '../types.dart'; 8 | 9 | class _TileLayersBarState extends State { 10 | _TileLayersBarState({@required this.controller}) 11 | : assert(controller != null), 12 | _tileLayerType = controller.tileLayerType; 13 | 14 | final StatefulMapController controller; 15 | 16 | TileLayerType _tileLayerType; 17 | StreamSubscription _sub; 18 | 19 | @override 20 | void initState() { 21 | _sub = controller.changeFeed.listen((change) { 22 | if (change.type == MapControllerChangeType.tileLayer) { 23 | setState(() => _tileLayerType = change.value as TileLayerType); 24 | } 25 | }); 26 | super.initState(); 27 | } 28 | 29 | Widget _buildLayers() { 30 | return Column(children: [ 31 | IconButton( 32 | iconSize: 30.0, 33 | color: (_tileLayerType == TileLayerType.normal) 34 | ? Colors.blueGrey 35 | : Colors.grey, 36 | icon: const Icon(Icons.map), 37 | tooltip: "Normal layer", 38 | onPressed: () => controller.switchTileLayer(TileLayerType.normal), 39 | ), 40 | IconButton( 41 | iconSize: 30.0, 42 | color: (_tileLayerType == TileLayerType.monochrome) 43 | ? Colors.blueGrey 44 | : Colors.grey, 45 | icon: const Icon(Icons.local_car_wash), 46 | tooltip: "Monochrome layer", 47 | onPressed: () => controller.switchTileLayer(TileLayerType.monochrome), 48 | ), 49 | IconButton( 50 | iconSize: 30.0, 51 | color: (_tileLayerType == TileLayerType.topography) 52 | ? Colors.blueGrey 53 | : Colors.grey, 54 | icon: const Icon(Icons.photo), 55 | tooltip: "Topography layer", 56 | onPressed: () => controller.switchTileLayer(TileLayerType.topography), 57 | ), 58 | IconButton( 59 | iconSize: 30.0, 60 | color: (_tileLayerType == TileLayerType.hike) 61 | ? Colors.blueGrey 62 | : Colors.grey, 63 | icon: const Icon(Icons.landscape), 64 | tooltip: "Hills layer", 65 | onPressed: () => controller.switchTileLayer(TileLayerType.hike), 66 | ), 67 | ]); 68 | } 69 | 70 | @override 71 | Widget build(BuildContext context) => _buildLayers(); 72 | 73 | @override 74 | void dispose() { 75 | _sub.cancel(); 76 | super.dispose(); 77 | } 78 | } 79 | 80 | /// The tile layers bar 81 | class TileLayersBar extends StatefulWidget { 82 | /// Provide a controller 83 | const TileLayersBar({@required this.controller}); 84 | 85 | /// The map controller 86 | final StatefulMapController controller; 87 | 88 | @override 89 | _TileLayersBarState createState() => 90 | _TileLayersBarState(controller: controller); 91 | } 92 | -------------------------------------------------------------------------------- /lib/src/types.dart: -------------------------------------------------------------------------------- 1 | /// The different map tile layers available 2 | enum TileLayerType { 3 | /// Normal layer 4 | normal, 5 | 6 | /// Topographic layer 7 | topography, 8 | 9 | /// Monochrome layer 10 | monochrome, 11 | 12 | /// Hike layer 13 | hike, 14 | 15 | /// Custom tile layer 16 | custom 17 | } 18 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: map_controller 2 | description: A map controller for Flutter map. Manage markers, lines and polygons. 3 | homepage: https://github.com/synw/map_controller 4 | version: 0.9.0 5 | 6 | environment: 7 | sdk: ">=2.7.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | extra_pedantic: ^1.2.0 13 | flutter_map: ^0.11.0 14 | geojson: ^0.10.0 15 | geopoint: ^0.8.0 16 | latlong: ^0.6.1 17 | pedantic: ^1.9.2 18 | rxdart: ^0.25.0 19 | 20 | dev_dependencies: 21 | flutter_test: 22 | sdk: flutter 23 | 24 | # For information on the generic Dart part of this file, see the 25 | # following page: https://dart.dev/tools/pub/pubspec 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 | # To add assets to your application, add an assets section, like this: 34 | # assets: 35 | # - images/a_dot_burr.jpeg 36 | # - images/a_dot_ham.jpeg 37 | # An image asset can refer to one or more resolution-specific "variants", see 38 | # https://flutter.dev/assets-and-images/#resolution-aware. 39 | # For details regarding adding assets from package dependencies, see 40 | # https://flutter.dev/assets-and-images/#from-packages 41 | # To add custom fonts to your application, add a fonts section here, 42 | # in this "flutter" section. Each entry in this list should have a 43 | # "family" key with the font family name, and a "fonts" key with a 44 | # list giving the asset and other descriptors for the font. For 45 | # example: 46 | # fonts: 47 | # - family: Schyler 48 | # fonts: 49 | # - asset: fonts/Schyler-Regular.ttf 50 | # - asset: fonts/Schyler-Italic.ttf 51 | # style: italic 52 | # - family: Trajan Pro 53 | # fonts: 54 | # - asset: fonts/TrajanPro.ttf 55 | # - asset: fonts/TrajanPro_Bold.ttf 56 | # weight: 700 57 | # 58 | # For details regarding fonts from package dependencies, 59 | # see https://flutter.dev/custom-fonts/#from-packages 60 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/synw/map_controller/36184317934eca5ce571aff90ab4b83aadb22e34/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | map_controller 30 | 31 | 32 | 33 | 36 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "map_controller", 3 | "short_name": "map_controller", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | --------------------------------------------------------------------------------