diff --git a/.packages b/.packages new file mode 100644 index 000000000..dfbbf260c --- /dev/null +++ b/.packages @@ -0,0 +1,99 @@ +# Generated by pub on 2021-01-08 01:21:05.841448. +_fe_analyzer_shared:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-12.0.0/lib/ +analyzer:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.40.6/lib/ +ansicolor:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/ansicolor-1.1.1/lib/ +archive:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/archive-2.0.13/lib/ +args:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.6.0/lib/ +async:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.5.0-nullsafety.1/lib/ +boolean_selector:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0-nullsafety.1/lib/ +cached_network_image:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/cached_network_image-2.5.0/lib/ +characters:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0-nullsafety.3/lib/ +charcode:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.2.0-nullsafety.1/lib/ +cli_util:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/cli_util-0.2.0/lib/ +clock:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.0-nullsafety.1/lib/ +collection:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0-nullsafety.3/lib/ +console_log_handler:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/console_log_handler-1.1.6/lib/ +convert:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/convert-2.1.1/lib/ +coverage:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/coverage-0.14.2/lib/ +crypto:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-2.1.5/lib/ +fake_async:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0-nullsafety.1/lib/ +ffi:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/ +file:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/file-5.2.1/lib/ +flutter:file:///Users/escmoteur/Entwicklung/flutter/packages/flutter/lib/ +flutter_blurhash:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_blurhash-0.5.0/lib/ +flutter_cache_manager:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_cache_manager-2.1.0/lib/ +flutter_image:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image-3.0.0/lib/ +flutter_test:file:///Users/escmoteur/Entwicklung/flutter/packages/flutter_test/lib/ +glob:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/glob-1.2.0/lib/ +http:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/ +http_multi_server:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.2.0/lib/ +http_parser:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.4/lib/ +image:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/image-2.1.19/lib/ +intl:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.16.1/lib/ +io:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/io-0.3.4/lib/ +js:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3-nullsafety.2/lib/ +latlong:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/latlong-0.6.1/lib/ +lists:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/lists-0.1.6/lib/ +location:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/location-2.5.4/lib/ +logging:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/logging-0.11.4/lib/ +matcher:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10-nullsafety.1/lib/ +meta:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0-nullsafety.3/lib/ +mgrs_dart:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/mgrs_dart-1.0.1/lib/ +mime:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/mime-0.9.7/lib/ +node_interop:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/node_interop-1.2.1/lib/ +node_io:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/node_io-1.2.0/lib/ +node_preamble:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/node_preamble-1.4.12/lib/ +octo_image:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/octo_image-0.3.0/lib/ +package_config:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/package_config-1.9.3/lib/ +path:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.0-nullsafety.1/lib/ +path_provider:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.24/lib/ +path_provider_linux:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/lib/ +path_provider_macos:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+6/lib/ +path_provider_platform_interface:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_platform_interface-1.0.4/lib/ +path_provider_windows:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.4+3/lib/ +pedantic:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/pedantic-1.10.0-nullsafety.2/lib/ +petitparser:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/petitparser-3.1.0/lib/ +platform:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/platform-2.2.1/lib/ +plugin_platform_interface:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/plugin_platform_interface-1.0.3/lib/ +pool:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/pool-1.5.0-nullsafety.2/lib/ +positioned_tap_detector:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/positioned_tap_detector-1.0.3/lib/ +process:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/process-3.0.13/lib/ +proj4dart:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/proj4dart-1.0.5/lib/ +pub_semver:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/pub_semver-1.4.4/lib/ +quiver:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-2.1.5/lib/ +rxdart:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/rxdart-0.25.0/lib/ +shelf:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/shelf-0.7.9/lib/ +shelf_packages_handler:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_packages_handler-2.0.0/lib/ +shelf_static:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_static-0.2.9+1/lib/ +shelf_web_socket:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_web_socket-0.2.3/lib/ +sky_engine:file:///Users/escmoteur/Entwicklung/flutter/bin/cache/pkg/sky_engine/lib/ +source_map_stack_trace:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/source_map_stack_trace-2.1.0-nullsafety.3/lib/ +source_maps:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/source_maps-0.10.10-nullsafety.2/lib/ +source_span:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.8.0-nullsafety.2/lib/ +sqflite:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.2+1/lib/ +sqflite_common:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite_common-1.0.2+1/lib/ +stack_trace:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0-nullsafety.1/lib/ +stream_channel:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0-nullsafety.1/lib/ +string_scanner:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0-nullsafety.1/lib/ +synchronized:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/synchronized-2.2.0+2/lib/ +term_glyph:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0-nullsafety.1/lib/ +test:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/test-1.16.0-nullsafety.5/lib/ +test_api:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.19-nullsafety.2/lib/ +test_core:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/test_core-0.3.12-nullsafety.5/lib/ +transparent_image:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/transparent_image-1.0.0/lib/ +tuple:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/tuple-1.0.3/lib/ +typed_data:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0-nullsafety.3/lib/ +unicode:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/unicode-0.2.4/lib/ +uuid:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/uuid-2.2.2/lib/ +validate:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/validate-1.7.0/lib/ +vector_math:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0-nullsafety.3/lib/ +vm_service:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/vm_service-5.5.0/lib/ +watcher:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/watcher-0.9.7+15/lib/ +web_socket_channel:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/web_socket_channel-1.1.0/lib/ +webkit_inspection_protocol:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/webkit_inspection_protocol-0.7.4/lib/ +win32:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4/lib/ +wkt_parser:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/wkt_parser-1.0.7/lib/ +xdg_directories:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/xdg_directories-0.1.2/lib/ +xml:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/xml-4.5.1/lib/ +yaml:file:///Users/escmoteur/Entwicklung/flutter/.pub-cache/hosted/pub.dartlang.org/yaml-2.2.1/lib/ +flutter_map:lib/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 53809a705..7d5bf661f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [0.10.2] - 10/29/2020 +- added property `allowPanning` to `MapOptions` that allows to disable only panning while touch events are still triggered + ## [0.10.1+1] - 8/4/2020 - fix possible issue with code published in previous version diff --git a/example/assets/berlin.mbtiles b/example/assets/berlin.mbtiles deleted file mode 100644 index 84b18c60a..000000000 Binary files a/example/assets/berlin.mbtiles and /dev/null differ diff --git a/example/ios/Flutter/Debug.xcconfig b/example/ios/Flutter/Debug.xcconfig index 592ceee85..e8efba114 100644 --- a/example/ios/Flutter/Debug.xcconfig +++ b/example/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/example/ios/Flutter/Release.xcconfig b/example/ios/Flutter/Release.xcconfig index 592ceee85..399e9340e 100644 --- a/example/ios/Flutter/Release.xcconfig +++ b/example/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/example/ios/Podfile b/example/ios/Podfile new file mode 100644 index 000000000..1e8c3c90a --- /dev/null +++ b/example/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock new file mode 100644 index 000000000..2ad23941e --- /dev/null +++ b/example/ios/Podfile.lock @@ -0,0 +1,43 @@ +PODS: + - Flutter (1.0.0) + - FMDB (2.7.5): + - FMDB/standard (= 2.7.5) + - FMDB/standard (2.7.5) + - location (0.0.1): + - Flutter + - path_provider (0.0.1): + - Flutter + - sqflite (0.0.2): + - Flutter + - FMDB (>= 2.7.5) + +DEPENDENCIES: + - Flutter (from `Flutter`) + - location (from `.symlinks/plugins/location/ios`) + - path_provider (from `.symlinks/plugins/path_provider/ios`) + - sqflite (from `.symlinks/plugins/sqflite/ios`) + +SPEC REPOS: + trunk: + - FMDB + +EXTERNAL SOURCES: + Flutter: + :path: Flutter + location: + :path: ".symlinks/plugins/location/ios" + path_provider: + :path: ".symlinks/plugins/path_provider/ios" + sqflite: + :path: ".symlinks/plugins/sqflite/ios" + +SPEC CHECKSUMS: + Flutter: 0e3d915762c693b495b44d77113d4970485de6ec + FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a + location: 3a2eed4dd2fab25e7b7baf2a9efefe82b512d740 + path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c + sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 + +PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c + +COCOAPODS: 1.10.0 diff --git a/example/lib/main.dart b/example/lib/main.dart index 7addcbea4..4a86ef8af 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -10,7 +10,6 @@ import './pages/map_controller.dart'; import './pages/marker_anchor.dart'; import './pages/moving_markers.dart'; import './pages/offline_map.dart'; -import './pages/offline_mbtiles_map.dart'; import './pages/on_tap.dart'; import './pages/overlay_image.dart'; import './pages/plugin_api.dart'; @@ -48,7 +47,6 @@ class MyApp extends StatelessWidget { PluginScaleBar.route: (context) => PluginScaleBar(), PluginZoomButtons.route: (context) => PluginZoomButtons(), OfflineMapPage.route: (context) => OfflineMapPage(), - OfflineMBTilesMapPage.route: (context) => OfflineMBTilesMapPage(), OnTapPage.route: (context) => OnTapPage(), MovingMarkersPage.route: (context) => MovingMarkersPage(), CirclePage.route: (context) => CirclePage(), diff --git a/example/lib/pages/animated_map_controller.dart b/example/lib/pages/animated_map_controller.dart index 91af3e95a..593601217 100644 --- a/example/lib/pages/animated_map_controller.dart +++ b/example/lib/pages/animated_map_controller.dart @@ -90,7 +90,7 @@ class AnimatedMapControllerPageState extends State builder: (ctx) => Container( child: FlutterLogo( key: Key('green'), - colors: Colors.green, + textColor: Colors.green, ), ), ), @@ -100,7 +100,7 @@ class AnimatedMapControllerPageState extends State point: paris, builder: (ctx) => Container( key: Key('purple'), - child: FlutterLogo(colors: Colors.purple), + child: FlutterLogo(textColor: Colors.purple), ), ), ]; diff --git a/example/lib/pages/home.dart b/example/lib/pages/home.dart index ef4144314..621a3fbc3 100644 --- a/example/lib/pages/home.dart +++ b/example/lib/pages/home.dart @@ -16,7 +16,7 @@ class HomePage extends StatelessWidget { point: LatLng(51.5, -0.09), builder: (ctx) => Container( child: FlutterLogo( - colors: Colors.blue, + textColor: Colors.blue, key: ObjectKey(Colors.blue), ), ), @@ -27,7 +27,7 @@ class HomePage extends StatelessWidget { point: LatLng(53.3498, -6.2603), builder: (ctx) => Container( child: FlutterLogo( - colors: Colors.green, + textColor: Colors.green, key: ObjectKey(Colors.green), ), ), @@ -38,7 +38,7 @@ class HomePage extends StatelessWidget { point: LatLng(48.8566, 2.3522), builder: (ctx) => Container( child: FlutterLogo( - colors: Colors.purple, + textColor: Colors.purple, key: ObjectKey(Colors.purple), ), ), diff --git a/example/lib/pages/live_location.dart b/example/lib/pages/live_location.dart index 25666bc21..9d1c3aa1d 100644 --- a/example/lib/pages/live_location.dart +++ b/example/lib/pages/live_location.dart @@ -105,7 +105,7 @@ class _LiveLocationPageState extends State { point: currentLatLng, builder: (ctx) => Container( child: FlutterLogo( - colors: Colors.blue, + textColor: Colors.blue, key: ObjectKey(Colors.blue), ), ), diff --git a/example/lib/pages/map_controller.dart b/example/lib/pages/map_controller.dart index ba622c16b..4bd1d25e1 100644 --- a/example/lib/pages/map_controller.dart +++ b/example/lib/pages/map_controller.dart @@ -48,7 +48,7 @@ class MapControllerPageState extends State { builder: (ctx) => Container( child: FlutterLogo( key: Key('green'), - colors: Colors.green, + textColor: Colors.green, ), ), ), @@ -58,7 +58,7 @@ class MapControllerPageState extends State { point: paris, builder: (ctx) => Container( key: Key('purple'), - child: FlutterLogo(colors: Colors.purple), + child: FlutterLogo(textColor: Colors.purple), ), ), ]; diff --git a/example/lib/pages/marker_anchor.dart b/example/lib/pages/marker_anchor.dart index c92dc08fa..f8dfb89c5 100644 --- a/example/lib/pages/marker_anchor.dart +++ b/example/lib/pages/marker_anchor.dart @@ -51,7 +51,7 @@ class MarkerAnchorPageState extends State { point: LatLng(53.3498, -6.2603), builder: (ctx) => Container( child: FlutterLogo( - colors: Colors.green, + textColor: Colors.green, ), ), anchorPos: anchorPos, @@ -61,7 +61,7 @@ class MarkerAnchorPageState extends State { height: 80.0, point: LatLng(48.8566, 2.3522), builder: (ctx) => Container( - child: FlutterLogo(colors: Colors.purple), + child: FlutterLogo(textColor: Colors.purple), ), anchorPos: anchorPos, ), diff --git a/example/lib/pages/offline_mbtiles_map.dart b/example/lib/pages/offline_mbtiles_map.dart deleted file mode 100644 index 7e62c4446..000000000 --- a/example/lib/pages/offline_mbtiles_map.dart +++ /dev/null @@ -1,53 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_map/flutter_map.dart'; -import 'package:latlong/latlong.dart'; - -import '../widgets/drawer.dart'; - -class OfflineMBTilesMapPage extends StatelessWidget { - static const String route = '/offline_mbtiles_map'; - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: Text('Offline Map (using MBTiles)')), - drawer: buildDrawer(context, OfflineMBTilesMapPage.route), - body: Padding( - padding: EdgeInsets.all(8.0), - child: Column( - children: [ - Padding( - padding: EdgeInsets.only(top: 8.0, bottom: 8.0), - child: Text( - 'This is an offline map of Berlin, Germany using a single MBTiles file. The file was built from the Stamen toner map data (http://maps.stamen.com).\n\n' - '(Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.)'), - ), - Flexible( - child: FlutterMap( - options: MapOptions( - center: LatLng( - 52.516144, - 13.404938, - ), - minZoom: 12.0, - maxZoom: 14.0, - zoom: 12.0, - swPanBoundary: LatLng(52.492205, 13.282081), - nePanBoundary: LatLng(52.540084, 13.527795), - ), - layers: [ - TileLayerOptions( - tileProvider: MBTilesImageProvider.fromAsset( - 'assets/berlin.mbtiles'), - maxZoom: 14.0, - backgroundColor: Colors.white, - tms: true), - ], - ), - ), - ], - ), - ), - ); - } -} diff --git a/example/lib/pages/on_tap.dart b/example/lib/pages/on_tap.dart index 5e9dad0c2..71ccb546f 100644 --- a/example/lib/pages/on_tap.dart +++ b/example/lib/pages/on_tap.dart @@ -48,7 +48,7 @@ class OnTapPageState extends State { )); }, child: FlutterLogo( - colors: Colors.green, + textColor: Colors.green, ), )), ), @@ -63,7 +63,7 @@ class OnTapPageState extends State { content: Text('Tapped on purple FlutterLogo Marker'), )); }, - child: FlutterLogo(colors: Colors.purple), + child: FlutterLogo(textColor: Colors.purple), )), ), ]; diff --git a/example/lib/widgets/drawer.dart b/example/lib/widgets/drawer.dart index 02766fb63..f51a56ded 100644 --- a/example/lib/widgets/drawer.dart +++ b/example/lib/widgets/drawer.dart @@ -10,7 +10,6 @@ import '../pages/map_controller.dart'; import '../pages/marker_anchor.dart'; import '../pages/moving_markers.dart'; import '../pages/offline_map.dart'; -import '../pages/offline_mbtiles_map.dart'; import '../pages/on_tap.dart'; import '../pages/overlay_image.dart'; import '../pages/plugin_api.dart'; @@ -127,12 +126,6 @@ Drawer buildDrawer(BuildContext context, String currentRoute) { OfflineMapPage.route, currentRoute, ), - _buildMenuItem( - context, - const Text('Offline Map (using MBTiles)'), - OfflineMBTilesMapPage.route, - currentRoute, - ), _buildMenuItem( context, const Text('OnTap'), diff --git a/example/pubspec.yaml b/example/pubspec.yaml index ba334d16f..1e5a4922f 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,6 +1,9 @@ name: flutter_map_example description: A new Flutter project. +environment: + sdk: '>=2.10.0 <3.0.0' + dependencies: flutter: sdk: flutter @@ -16,7 +19,6 @@ dev_dependencies: flutter: uses-material-design: true assets: - - assets/berlin.mbtiles - assets/map/anholt_osmbright/12/2177/ - assets/map/anholt_osmbright/12/2178/ - assets/map/anholt_osmbright/12/2179/ diff --git a/flutter_map.iml b/flutter_map.iml index c9d208a4e..84d5db537 100644 --- a/flutter_map.iml +++ b/flutter_map.iml @@ -16,4 +16,4 @@ - \ No newline at end of file + diff --git a/lib/flutter_map.dart b/lib/flutter_map.dart index cc2254036..31d4d3f87 100644 --- a/lib/flutter_map.dart +++ b/lib/flutter_map.dart @@ -22,7 +22,6 @@ export 'package:flutter_map/src/layer/overlay_image_layer.dart'; export 'package:flutter_map/src/layer/polygon_layer.dart'; export 'package:flutter_map/src/layer/polyline_layer.dart'; export 'package:flutter_map/src/layer/tile_layer.dart'; -export 'package:flutter_map/src/layer/tile_provider/mbtiles_image_provider.dart'; export 'package:flutter_map/src/layer/tile_provider/tile_provider.dart'; export 'package:flutter_map/src/plugins/plugin.dart'; @@ -128,6 +127,7 @@ class MapOptions { @deprecated final bool debug; // TODO no usage outside of constructor. Marked for removal? final bool interactive; + final bool allowPanning; final TapCallback onTap; final LongPressCallback onLongPress; final PositionCallback onPositionChanged; @@ -156,6 +156,7 @@ class MapOptions { this.maxZoom, this.debug = false, this.interactive = true, + this.allowPanning = true, this.onTap, this.onLongPress, this.onPositionChanged, diff --git a/lib/src/gestures/gestures.dart b/lib/src/gestures/gestures.dart index 56146d2a0..28e1dfc44 100644 --- a/lib/src/gestures/gestures.dart +++ b/lib/src/gestures/gestures.dart @@ -71,7 +71,11 @@ abstract class MapGestureMixin extends State final focalStartPt = map.project(_focalStartGlobal, newZoom); final newCenterPt = focalStartPt - focalOffset + map.size / 2.0; final newCenter = map.unproject(newCenterPt, newZoom); - map.move(newCenter, newZoom, hasGesture: true); + if (options.allowPanning) { + map.move(newCenter, newZoom, hasGesture: true); + } else { + map.move(map.center, newZoom, hasGesture: true); + } _flingOffset = _pointToOffset(_focalStartLocal - focalOffset); }); } @@ -79,6 +83,9 @@ abstract class MapGestureMixin extends State void handleScaleEnd(ScaleEndDetails details) { _resetDoubleTapHold(); + if (!options.allowPanning) { + return; + } var magnitude = details.velocity.pixelsPerSecond.distance; if (magnitude < _kMinFlingVelocity) { return; @@ -140,6 +147,10 @@ abstract class MapGestureMixin extends State void handleDoubleTap(TapPosition tapPosition) { _resetDoubleTapHold(); + if (!options.allowPanning) { + return; + } + final centerPos = _pointToOffset(map.size) / 2.0; final newZoom = _getZoomForScale(map.zoom, 2.0); final focalDelta = _getDoubleTapFocalDelta( diff --git a/lib/src/layer/polyline_layer.dart b/lib/src/layer/polyline_layer.dart index 1ac72d44c..b11c2172e 100644 --- a/lib/src/layer/polyline_layer.dart +++ b/lib/src/layer/polyline_layer.dart @@ -150,12 +150,15 @@ class PolylinePainter extends CustomPainter { : paint.color = polylineOpt.color; } - final filterPaint = Paint() - ..color = polylineOpt.borderColor.withAlpha(255) - ..strokeWidth = polylineOpt.strokeWidth - ..strokeCap = StrokeCap.round - ..strokeJoin = StrokeJoin.round - ..blendMode = BlendMode.dstOut; + Paint filterPaint; + if (polylineOpt.borderColor != null) { + filterPaint = Paint() + ..color = polylineOpt.borderColor.withAlpha(255) + ..strokeWidth = polylineOpt.strokeWidth + ..strokeCap = StrokeCap.round + ..strokeJoin = StrokeJoin.round + ..blendMode = BlendMode.dstOut; + } final borderPaint = polylineOpt.borderStrokeWidth > 0.0 ? (Paint() @@ -181,11 +184,13 @@ class PolylinePainter extends CustomPainter { canvas.restore(); } else { paint.style = PaintingStyle.stroke; - filterPaint.style = PaintingStyle.stroke; - borderPaint?.style = PaintingStyle.stroke; canvas.saveLayer(rect, Paint()); if (borderPaint != null) { - _paintLine(canvas, polylineOpt.offsets, borderPaint); + if (filterPaint != null) { + filterPaint.style = PaintingStyle.stroke; + _paintLine(canvas, polylineOpt.offsets, borderPaint); + } + borderPaint?.style = PaintingStyle.stroke; _paintLine(canvas, polylineOpt.offsets, filterPaint); } _paintLine(canvas, polylineOpt.offsets, paint); diff --git a/lib/src/layer/tile_provider/mbtiles_image_provider.dart b/lib/src/layer/tile_provider/mbtiles_image_provider.dart deleted file mode 100644 index 79979914c..000000000 --- a/lib/src/layer/tile_provider/mbtiles_image_provider.dart +++ /dev/null @@ -1,133 +0,0 @@ -import 'dart:io'; -import 'dart:typed_data'; -import 'dart:ui'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_map/flutter_map.dart'; -import 'package:flutter_map/src/layer/tile_provider/tile_provider.dart'; -import 'package:path_provider/path_provider.dart'; -import 'package:sqflite/sqflite.dart'; - -class MBTilesImageProvider extends TileProvider { - final String asset; - final File mbtilesFile; - - Future database; - Database _loadedDb; - bool isDisposed = false; - - MBTilesImageProvider._({this.asset, this.mbtilesFile}) { - database = _loadMBTilesDatabase(); - } - - factory MBTilesImageProvider.fromAsset(String asset) => - MBTilesImageProvider._(asset: asset); - - factory MBTilesImageProvider.fromFile(File mbtilesFile) => - MBTilesImageProvider._(mbtilesFile: mbtilesFile); - - Future _loadMBTilesDatabase() async { - if (_loadedDb == null) { - var file = mbtilesFile ?? await copyFileFromAssets(); - - _loadedDb = await openDatabase(file.path); - - if (isDisposed) { - await _loadedDb.close(); - _loadedDb = null; - throw Exception('Tileprovider is already disposed'); - } - } - - return _loadedDb; - } - - @override - void dispose() { - if (_loadedDb != null) { - _loadedDb.close(); - _loadedDb = null; - } - isDisposed = true; - } - - Future copyFileFromAssets() async { - var tempDir = await getTemporaryDirectory(); - var filename = asset.split('/').last; - var file = File('${tempDir.path}/$filename'); - - var data = await rootBundle.load(asset); - file.writeAsBytesSync( - data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes), - flush: true); - return file; - } - - @override - ImageProvider getImage(Coords coords, TileLayerOptions options) { - var x = coords.x.round(); - var y = options.tms - ? invertY(coords.y.round(), coords.z.round()) - : coords.y.round(); - var z = coords.z.round(); - - return MBTileImage( - database, - Coords(x, y)..z = z, - mbtilesFile?.path ?? asset, - ); - } -} - -class MBTileImage extends ImageProvider { - final Future database; - final Coords coords; - final String filePath; - - MBTileImage(this.database, this.coords, this.filePath); - - @override - ImageStreamCompleter load(MBTileImage key, decode) { - return MultiFrameImageStreamCompleter( - codec: _loadAsync(key), - scale: 1, - informationCollector: () sync* { - yield DiagnosticsProperty('Image provider', this); - yield DiagnosticsProperty('Image key', key); - }); - } - - Future _loadAsync(MBTileImage key) async { - assert(key == this); - - final db = await key.database; - List result = await db.rawQuery('select tile_data from tiles ' - 'where zoom_level = ${coords.z} AND ' - 'tile_column = ${coords.x} AND ' - 'tile_row = ${coords.y} limit 1'); - final Uint8List bytes = - result.isNotEmpty ? result.first['tile_data'] : null; - - if (bytes == null) { - return Future.error('Failed to load tile for coords: $coords'); - } - return await PaintingBinding.instance.instantiateImageCodec(bytes); - } - - @override - Future obtainKey(ImageConfiguration configuration) { - return SynchronousFuture(this); - } - - @override - int get hashCode => coords.hashCode; - - @override - bool operator ==(other) { - return other is MBTileImage && - coords == other.coords && - filePath == other.filePath; - } -} diff --git a/lib/src/layer/tile_provider/tile_provider.dart b/lib/src/layer/tile_provider/tile_provider.dart index 5428d055d..be9bac443 100644 --- a/lib/src/layer/tile_provider/tile_provider.dart +++ b/lib/src/layer/tile_provider/tile_provider.dart @@ -6,8 +6,6 @@ import 'package:flutter_image/network.dart'; import 'package:flutter_map/flutter_map.dart'; import 'package:flutter_map/src/core/util.dart' as util; -export 'package:flutter_map/src/layer/tile_provider/mbtiles_image_provider.dart'; - abstract class TileProvider { const TileProvider(); diff --git a/pubspec.yaml b/pubspec.yaml index c7fd1b029..88a8cec51 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_map description: A Dart implementation of Leaflet for Flutter apps -version: 0.10.1+1 +version: 0.10.2 homepage: https://github.com/johnpryan/flutter_map module: androidX: true @@ -19,7 +19,6 @@ dependencies: async: ^2.1.0 flutter_image: ^3.0.0 cached_network_image: ^2.0.0 - sqflite: ^1.1.5 path_provider: ^1.6.7 vector_math: ^2.0.0 proj4dart: ^1.0.4