Giter Site home page Giter Site logo

jaffaketchup / flutter_map_tile_caching Goto Github PK

View Code? Open in Web Editor NEW
113.0 4.0 70.0 3.76 MB

Plugin for flutter_map providing advanced & performant caching and bulk downloading functionality, with many options for region shapes and extra tools

Home Page: https://pub.dev/packages/flutter_map_tile_caching

License: GNU General Public License v3.0

Dart 93.67% Batchfile 0.02% Kotlin 0.02% CMake 1.85% C++ 3.47% C 0.13% Inno Setup 0.84%
flutter maps offline fmtc flutter-map

flutter_map_tile_caching's Introduction

Hey there ๐Ÿ‘‹

I'm currently in full-time education in the UK studying Computer Science, Geography, and Mathematics, and have been building my software development skills alongside my education for many years. I specialise in the Flutter and Dart technologies to build cross-platform applications, and have over 4 years of experience both from a hobby and commercial standpoint.

I've worked as a senior developer with a small team at WatchEnterprise to develop their Flutter-based WatchCrunch social media app for Android & iOS.

I'm one of a small team of maintainers for Flutter's โ„–1 non-commercially aimed mapping library 'flutter_map', for which we make internal contributions, regulate and collaborate with external contributors, and offer support to a large community. I also personally develop a multitude of extension libraries, such as 'flutter_map_tile_caching'. In addition, I regularly contribute to OpenStreetMap, and continously improve my skills with personal experimental projects.

I'm eager to earn other languages, and more than happy to talk about anything software development related!

flutter_map_tile_caching's People

Contributors

briannaandco avatar github-actions[bot] avatar jaffaketchup avatar sikandernoori avatar thexxturboxx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flutter_map_tile_caching's Issues

Switching layers during runtime [QUESTION]

Hi @JaffaKetchup, I've a question about switching between different layers. I also already checked #10 and #16, but that didn't helped me get it working.

I'm trying to implement a button on my map to switch the map layer from aerial style to streetmap style. This should work in online and offline mode.

So I defined two different TileProvider and TileLayerOptions objects:

final aerialTileProvider = StorageCachingTileProvider(cacheName: 'aerial');
  final streetTileProvider = StorageCachingTileProvider(cacheName: 'streetmap');
  final aerialTemplateUrl = Environment.env.mapboxAerialTemplateUrl +
      Environment.env.mapboxAccessToken;
  final streetTemplateUrl = Environment.env.mapboxStreetmapTemplateUrl +
      Environment.env.mapboxAccessToken;
  TileLayerOptions get aerialTileLayerOptions {
    return TileLayerOptions(
        urlTemplate: aerialTemplateUrl,
        tileProvider: aerialTileProvider,
        overrideTilesWhenUrlChanges: true,
        tileFadeInDuration: 0,
        tileFadeInStartWhenOverride: 1.0);
  }

  TileLayerOptions get streetTileLayerOptions {
    return TileLayerOptions(
        urlTemplate: streetTemplateUrl,
        tileProvider: streetTileProvider,
        overrideTilesWhenUrlChanges: true,
        tileFadeInDuration: 0,
        tileFadeInStartWhenOverride: 1.0);
  }

And try to switch them based on map style the user selected:

Observer(
      builder: (context) => FlutterMap(
        options: MapOptions(
            center: viewModel.currentLocation,
            minZoom: viewModel.minZoom,
            maxZoom: viewModel.maxZoom,
            zoom: viewModel.model.initialZoom,
            interactiveFlags: InteractiveFlag.pinchZoom |
                InteractiveFlag.doubleTapZoom |
                InteractiveFlag.drag),
        mapController: viewModel.model.mapController,
        children: [
          TileLayerWidget(
            options: viewModel.model.mapStyle == MapStyle.aerial
                ? viewModel.aerialMapLayer
                : viewModel.streetMapLayer
          )
        ],
        layers: [
          MarkerLayerOptions(markers: [
            Marker(
                point: viewModel.currentLocation,
                builder: (buildContext) => Container(
                    child: Image.asset('assets/images/my_location_circle.png')))
          ])
        ],
      ),
    );

The problem I'm facing right now is, if the style is switched, the current visible map region does not change the style. Only if the map is moved to tiles that have not been displayed before, these tiles are displayed in the correct style.

If I run the same code and just change the TileProvider to the standard flutter_map NonCahcingNetworkImageProvider it works fine.
So, is there any possibility to use the StorageCachingProvider and update the current displayed tiles after the map style has changed?

[BUG] Error: No named parameter with the name 'number'.

After upgrading to flutter_map_tile_caching: ^5.1.0 (also happens on ^5.1.1) I get an error while building for Android and iOS. I'm on a test branch upgrading to Flutter v_3... as well as some other packages so it could be something else but it seems like there is some type of issue.

../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_map_tile_caching-5.1.1/lib/src/internal/exts.dart:137:9: 
Error: No named parameter with the name 'number'.
        number: number ?? this.number,
        ^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-9.5.3+1/lib/src/platform_specifics/android/notification_details.dart:12:9: 
Context: Found this candidate, but the arguments don't match.
  const AndroidNotificationDetails(
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.

* Where:
Script '/Users/userName/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1156

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/userName/Developer/flutter/bin/flutter'' finished with non-zero exit value 1

Doctors Report

[โœ“] Flutter (Channel stable, 3.0.5, on macOS 12.5 21G72 darwin-arm, locale en-CA)
[โœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[โœ“] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[โœ“] Android Studio (version 2021.2)
[โœ“] VS Code (version 1.69.2)
[โœ“] Connected device (3 available)
[โœ“] HTTP Host Availability

Severity
This will help us to label the issue quicker and decide what needs attention first. Only choose fatal if the entire app crashes, otherwise choose non-fatal.

  • Non-Fatal
  • Fatal / App Crashes

Frequency/Rarity
This will help us to label the issue quicker and decide what needs attention first.

  • Once
  • Uncommon
  • Common
  • Always

Applicable Platforms
Only select those that you've tested on - one or more. If possible, test on a variety of platforms.

  • Android
  • iOS
  • Web
  • Windows
  • Others (beta platforms)

[BUG] Missing Additional Setup Instructions

What is the bug?

Library affects uploading to Testflight. I hope it's happened because of the permission handler or file picker, maybe.

Predication:

  1. Apple for me now doesn't send emails with warnings and doesn't display builds with warnings for me (Apple side issue).

I think flutter_map_tile_caching provoke some warning on Apple side.

What is the expected behaviour?

The project appears on Testflight without warnings.

How can we reproduce this issue?

1. Add [flutter_map_tile_caching](https://github.com/JaffaKetchup/flutter_map_tile_caching) to project
2. Projects don't appear on Testflight. (for me, for others I think it will be a warning)

Do you have a potential solution?

Maybe we need to document that we need to annotate something in Info.plist according to the permission handler.

Can you provide any other information?

No response

Platforms Affected

iOS

Severity

Obtrusive: Prevents normal functioning but causes no errors in the console

Frequency

Consistently: Always occurs at the same time and location

Requirements

  • I agree to follow this project's Code of Conduct
  • My Flutter/Dart installation is unaltered, and flutter doctor finds no relevant issues
  • I am using the latest stable version of this package
  • I have checked the FAQs section on the documentation website
  • I have checked for similar issues which may be duplicates

More region selection options

Describe the solution you'd like
Cache tiles for a specific area given map center and radius in kilometers.

Is your feature request related to a problem? Please describe.
I am trying to apply some caching to a map so it would not have to load all the tiles, let's say, for a specific small city. The goal is to have the map pre-cached for an area of around 10km.

Describe alternatives you've considered
So far what I have thought of doing was to get the 4 corners of the current area and cache tiles surrounding those NW, SE, SW and SW points but it seems like too much work and error prone for something it seems to me it would be a very common use case.

Is there any better way of achieving this with the current state of the plugin? Am I missing something?

Thanks a lot for the plugin and all the good work.

Ability to pre-load surrounding tiles when browsing

Hi, thank you for the effort in making this plugin.

I would like to get some clarification:

  • Do I need to explicitly call downloadRegion to download a new Area, it does not cache automatically when a tile is downloaded when the map is moved?
  • If I call downloadRegion on every map move, do tiles get downloaded again regardless if they are already downloaded and cached?

[BUG] Cannot reset map tiles

What is the bug?
As of v4.0.0-dev.7, resetting the map after changing the templateURL no longer works to reset all displayed tiles and use the new source.
Since v4.0.0-dev.7, some jank still occurs when loading new tiles in a map, although this is greatly reduced by running on a physical device in release mode.

What do you expect to happen?
The map should briefly show blank, then load tiles from a new store/source; as seen in v4.0.0-dev.6.

Reproduction
Steps to reproduce the behaviour:

  1. Define two template URLs and initiate two cache stores.
  2. At the same time of changing the template URL, change the cache store.
  3. Call a reset method on the map
  4. Tiles do not reset

Additional context
Due to latest performance improvements in v4.0.0-dev.7, likely because of the custom ImageProvider caching images too heavily.

[FEATURE] Add ability to retrieve raw bytes from internal `ImageProvider` (to enable partial compatibilty with vector tiles)

What do you want implemented?

I would be able to use vector tiles (.pbf) instead of Raster Tiles (.png).
Indeed my company is rendering our map ourselves, and Vector tile takes much less computation power to render.

The idea is to be able to use url links like :
"https://tiles.stadiamaps.com/data/openmaptiles/{z}/{x}/{y}.pbf?"

To provide the style in a json like file, and to have all the features the library already provide (cache & bulk dowloading).

What other alternatives are available?

There is already another library that handle Vector tiles, but the way it works I am pretty sure it is not compatible with this one.

I'll be happy to be wrong and that both library could be used at the same time.

The library is :
https://github.com/greensopinion/flutter-vector-map-tiles

It does handle caching, but not bulk dowloading.

Can you provide any other information?

No response

Platforms Affected

Android, iOS

Severity

Annoying: Currently have to use workarounds

Requirements

Null-safe support

Thanks for the great work with this plugin. Is a null-safe version in the near future plans or should I just go ahead an convert it? I assume we are waiting for a official null safe flutter_map package first.

FLUTTER_MAP RELATIONS: New Documentation

This message has been sent to multiple plugin authors, so it is not personalised

As part of fleaflet/flutter_map#992 & fleaflet/flutter_map#927 (reply in thread), I (a documentation author) am contacting plugin authors to ensure the information about this plugin on the new documentation is correct; or alternatively, if this plugin is not yet on the existing list, to check whether you would like to add your plugin to the new documentation.

I would also like you to check you conform to these new rules:

  • this plugin is available via a pub.dev installation to make it easier for developers - if your plugin does not currently have a pub.dev page, please add one or let me know otherwise,
  • the plugin documentation includes enough information for installation and basic setup/functionality,
  • the plugin includes a runnable example and/or screenshots,
  • the plugin description contains the words ' - IN BETA' after the author link on the same line if your plugin is in beta,

Currently I have copied over the existing plugin descriptions, and you can see these here: https://flutter-map.vercel.app/plugins/list. Please note that this documentation is currently unapproved and should not be used unless otherwise directed, as some information may be incorrect or missing, or might change in the future. There is no ETA at the moment, but things seem to be moving along.

Should you wish for the description to remain the same as current on the page linked above, you do not have to reply, you can close this issue.

If you wish to change any information, please leave this issue open and add your reply as a comment.

flutter_map maintainers do not take any responsibility for this message, I am the sole author.

On behalf of myself and the flutter_map community thank you for your excellent plugin :).

[FEATURE] [v5.0.0] General Questions & Ideas

Hi

I have implemented the v5 in my project and it looks great on android and ios.

However here are some questions / suggestions :

  • #31 is present, but solved with PaintingBinding.instance?.imageCache?.clear();
  • Headers should be implemented as in flutter_map, maybe : await httpClient.get(Uri.parse(url), headers: options.tileProvider.headers); in image_provider.dart.
  • The bulk download requires several permissions for its dependencies (background_fetch, battery_info, connectivity_plus, flutter_local_notifications). Would it be possible to split flutter_map_tile_catching between the cache manager and the bulk download and thus avoid these dependencies if they are not useful ?
  • In my project I would like to display a map and a layer. Is it possible to have 2 FMTC.instance based on 2 different stores ? Is there a trick to implement this ?

Thanks

[BUG] 'flutter_local_notifications' Integration Error

Versions

Flutter versionL: 2.10.1
Dart 2.16.1
DevTools 2.9.2

Getting below error:

../../../.pub-cache/hosted/pub.dartlang.org/flutter_map_tile_caching-3.0.3/lib/src/main.dart:182:45: Error: Too many positional arguments: 2 allowed, but 3 found.
Try removing the extra positional arguments.
                  AndroidNotificationDetails(
                                            ^
../../../.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-9.2.0/lib/src/platform_specifics/android/notification_details.dart:12:9: Context: Found this candidate, but the arguments don't match.
  const AndroidNotificationDetails(

Issue us related to flutter_local_notifications function AndroidNotificationDetails, description parameter has been changed to named parameter.

For details, have a look documentation

downloadRegion() method only stores in 'mainCache'

Hi, I have 2 tile providers with different cacheName and when I navigate with them on the map, they are saved correctly in their respective storage. However when I try to download regions for each with downloadRegion(), they are always saved in 'mainCache' instead of the specified one.
Is this intentional? If not, is there any way to download maps into separate storages?

[BUG] Example app auto-updater broken on Android

What is the bug?

I changed the version of the application to an older one,
installed the application on the device (Samsung S21 , Android 13),
saw the possibility of updating on the update page,
the update was downloaded, then the application was unloaded, and that's it.

What should happen next?

What is the expected behaviour?

Updater starts

How can we reproduce this issue?

Change the app version to an older one and try to update app

Do you have a potential solution?

No response

Can you provide any other information?

No response

Platforms Affected

Android

Severity

Minimum: Allows normal functioning

Frequency

Consistently: Always occurs at the same time and location

Requirements

  • I agree to follow this project's Code of Conduct
  • My Flutter/Dart installation is unaltered, and flutter doctor finds no relevant issues
  • I am using the latest stable version of this package
  • I have checked the FAQs section on the documentation website
  • I have checked for similar issues which may be duplicates

[BUG] [v5.0.0-dev.2] `startForeground` doesn't trigger `onDone` event

Describe The Bug
startForeground stream won't tigger onDone event.

Expected Behaviour
onDone event should be triggered like 4.xx version.

Additional Information

Version: 5.0.0 dev2


Doctors Report

[โœ“] Flutter (Channel stable, 3.0.2, on Microsoft Windows [Version 10.0.22000.739], locale en-US)
[โœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2)
[โœ“] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.2)
[โœ“] Android Studio (version 2020.3)
[โœ“] VS Code, 64-bit edition (version 1.68.1)
[โœ“] Connected device (2 available)
[โœ“] HTTP Host Availability

To Reproduce

 FMTC.instance["test"].download.startForeground(region: cacheRegion).listen(
        (dp) {
            debugPrint("Dowloading..."); // Works
        },
        onDone: () async {
            debugPrint("onDone"); // Won't trigger
        },
        onError: (err) {
             debugPrint("onError");
        },
);

Severity
This will help us to label the issue quicker and decide what needs attention first. Only choose fatal if the entire app crashes, otherwise choose non-fatal.

  • Non-Fatal
  • Fatal / App Crashes

Frequency/Rarity
This will help us to label the issue quicker and decide what needs attention first.

  • Once
  • Uncommon
  • Common
  • Always

Applicable Platforms
Only select those that you've tested on - one or more. If possible, test on a variety of platforms.

  • Android
  • iOS
  • Web
  • Windows
  • Others (beta platforms)

[BUG] Example app on Windows desktop throws when starting download

Describe The Bug
When running the example app on Windows desktop, an exception is thrown when clicking the arrow to start the download. No window appears to set the download settings and choosing to download in foreground.

PlatformException (PlatformException(notAndroid, The background download feature is only available on Android due to internal limitations., null, null))

Expected Behaviour
I would expect the download settings page to appear and being able to download in foreground.

Screenshots & Recordings
If possible, add screenshots or recordings to help explain your problem. This can quickly improve diagnosis of the issue.

Additional Information
Add any other context about the problem here, or remove this section.


Doctors Report

Paste your report from `flutter doctor` inside here

To Reproduce
Steps to reproduce the behaviour:

  1. Open app in Windows desktop
  2. Open download
  3. Select region
  4. Hit arrow button to open download page
  5. Exception thrown...

Severity
This will help us to label the issue quicker and decide what needs attention first. Only choose fatal if the entire app crashes, otherwise choose non-fatal.

  • Non-Fatal
  • [ x] Fatal / App Crashes

Frequency/Rarity
This will help us to label the issue quicker and decide what needs attention first.

  • Once
  • Uncommon
  • Common
  • [ x] Always

Applicable Platforms
Only select those that you've tested on - one or more. If possible, test on a variety of platforms.

  • Android
  • iOS
  • Web
  • [ x] Windows
  • Others (beta platforms)

[BUG] Unsupported operation: Watching is not supported on the current platform

Describe The Bug
App crashes in first run on iOS. using the official example with all dependencies installed.

Expected Behaviour
App should run and (i do not know what is next, i just wanted to try out the package)

Screenshots & Recordings

Launching lib/main.dart on iPhone 13 in debug mode...
Running pod install...
Running Xcode build...
Xcode build done.                                            5.4s
Debug service listening on ws://127.0.0.1:51342/bKfPVmvulqU=/ws
Syncing files to device iPhone 13...
../lib/src/internal/image_provider.dart:75:23: Warning: Operand of null-aware operation '?.' has type 'PaintingBinding' which excludes null.
 - 'PaintingBinding' is from 'package:flutter/src/painting/binding.dart' ('../../../SDKs/flutter/packages/flutter/lib/src/painting/binding.dart').
      PaintingBinding.instance?.imageCache?.evict(this);
                      ^
../lib/src/internal/image_provider.dart:88:27: Warning: Operand of null-aware operation '?.' has type 'PaintingBinding' which excludes null.
 - 'PaintingBinding' is from 'package:flutter/src/painting/binding.dart' ('../../../SDKs/flutter/packages/flutter/lib/src/painting/binding.dart').
          PaintingBinding.instance?.imageCache?.evict(this);
                          ^
../lib/src/internal/image_provider.dart:98:27: Warning: Operand of null-aware operation '?.' has type 'PaintingBinding' which excludes null.
 - 'PaintingBinding' is from 'package:flutter/src/painting/binding.dart' ('../../../SDKs/flutter/packages/flutter/lib/src/painting/binding.dart').
          PaintingBinding.instance?.imageCache?.evict(this);
                          ^
../lib/src/internal/image_provider.dart:140:23: Warning: Operand of null-aware operation '?.' has type 'PaintingBinding' which excludes null.
 - 'PaintingBinding' is from 'package:flutter/src/painting/binding.dart' ('../../../SDKs/flutter/packages/flutter/lib/src/painting/binding.dart').
      PaintingBinding.instance?.imageCache?.evict(this);
                      ^
lib/pages/store_manager/store_manager.dart:124:55: Warning: Operand of null-aware operation '?.' has type 'PaintingBinding' which excludes null.
 - 'PaintingBinding' is from 'package:flutter/src/painting/binding.dart' ('../../../SDKs/flutter/packages/flutter/lib/src/painting/binding.dart').
                                      PaintingBinding.instance?.imageCache
                                                      ^
../../../SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/feature_discovery-0.14.1/lib/src/widgets/layout.dart:92:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../SDKs/flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
../../../SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/feature_discovery-0.14.1/lib/src/widgets/layout.dart:112:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../SDKs/flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
../../../SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/backdrop-0.7.2/lib/src/scaffold.dart:713:22: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../SDKs/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((_) => _notify());
                     ^
../../../SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/backdrop-0.7.2/lib/src/scaffold.dart:716:26: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../SDKs/flutter/packages/flutter/lib/src/scheduler/binding.dart').
        SchedulerBinding.instance!.addPostFrameCallback((_) => _notify());
                         ^

======== Exception caught by widgets library =======================================================
The following UnsupportedError was thrown building Consumer<GeneralProvider>(dirty, dependencies: [_InheritedProviderScope<GeneralProvider?>]):
Unsupported operation: Watching is not supported on the current platform

The relevant error-causing widget was: 
  Consumer<GeneralProvider> Consumer:file:///Users/azat/Developer/Flutter/flutter_map_tile_caching/example/lib/pages/home/components/panel/panel.dart:26:16
When the exception was thrown, this was the stack: 
#0      MapCachingManager.watchStoreChanges (package:flutter_map_tile_caching/src/storage_managers/storage_manager.dart:201:7)
#1      Panel.build.<anonymous closure> (package:fmtc_example/pages/home/components/panel/panel.dart:32:27)
#2      Consumer.buildWithChild (package:provider/src/consumer.dart:179:19)
#3      SingleChildStatelessWidget.build (package:nested/nested.dart:259:41)
#4      StatelessElement.build (package:flutter/src/widgets/framework.dart:4876:49)
#5      SingleChildStatelessElement.build (package:nested/nested.dart:279:18)
#6      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4806:15)
#7      Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#8      ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4787:5)
#9      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4781:5)
#10     SingleChildWidgetElementMixin.mount (package:nested/nested.dart:222:11)
...     Normal element mounting (51 frames)
#61     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3817:16)
#62     MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6350:36)
#63     MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6362:32)
...     Normal element mounting (9 frames)
#72     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3817:16)
#73     Element.updateChild (package:flutter/src/widgets/framework.dart:3545:20)
#74     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4832:16)
#75     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4977:11)
#76     Element.rebuild (package:flutter/src/widgets/framework.dart:4529:5)
#77     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2659:19)
#78     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:891:21)
#79     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:370:5)
#80     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1146:15)
#81     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1083:9)
#82     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:997:5)
#86     _invoke (dart:ui/hooks.dart:151:10)
#87     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:308:5)
#88     _drawFrame (dart:ui/hooks.dart:115:31)
(elided 3 frames from dart:async)
====================================================================================================

Additional Information
Add any other context about the problem here, or remove this section.

I think we need to implement some platform-aware methods for platform specific cases.


Doctors Report

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[โœ“] Flutter (Channel stable, 3.0.4, on macOS 12.4 21F79 darwin-arm, locale en-TR)
[โœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[โœ“] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[โœ“] Chrome - develop for the web
[โœ“] Android Studio (version 2021.2)
[โœ“] VS Code (version 1.69.0)
[โœ“] Connected device (3 available)
[โœ“] HTTP Host Availability

โ€ข No issues found!

To Reproduce
Steps to reproduce the behaviour:

Just build the project and launch it on iOS


Severity
This will help us to label the issue quicker and decide what needs attention first. Only choose fatal if the entire app crashes, otherwise choose non-fatal.

  • Non-Fatal
  • Fatal / App Crashes

Frequency/Rarity
This will help us to label the issue quicker and decide what needs attention first.

  • Once
  • Uncommon
  • Common
  • Always

Applicable Platforms
Only select those that you've tested on - one or more. If possible, test on a variety of platforms.

  • Android
  • iOS
  • Web
  • Windows
  • Others (beta platforms)

Cannot update share_plus to the latest version (6.0.0)

What is the bug?

The following error occurs when updating the share_plus plugin to version 6.0.0:

Because myApp depends on flutter_map_tile_caching ^6.1.0 which depends on share_plus ^4.1.0, share_plus ^4.1.0 is required.

What is the expected behaviour?

It should be possible to update share_plus to 6.0.0.

How can we reproduce this issue?

Try to build an app that depends on both flutter_map_tile_caching and share_plus 6.0.0.

Do you have a potential solution?

No response

Can you provide any other information?

No response

Platforms Affected

Android, iOS

Severity

Erroneous: Prevents normal functioning and causes errors in the console

Frequency

Consistently: Always occurs at the same time and location

Requirements

  • I agree to follow this project's Code of Conduct
  • My Flutter/Dart installation is unaltered, and flutter doctor finds no relevant issues
  • I am using the latest stable version of this package
  • I have checked the FAQs section on the documentation website
  • I have checked for similar issues which may be duplicates

Ability to cache multiple tile sets (same coordinates but different style)

I have a button for toggling between two distinct map styles (street and satellite). However, because of the (awesome) map caching when I switch styles the map layer will stay the same because it's already been cached (which is the correct and expected behaviour). Would it be possible to add a parameter to the TileLayerOptions that allowed for additional caches (like a subfolder) so if there was a value passed in it would store/retrieve the tiles to/from that "sub cache". And if you didn't need this functionality the parameter could just be left empty and it would default to the main cache.

My current solution is to use the NonCachingNetworkTileProvider whenever the user toggles for the second style (satellite in my case) which works fine but obviously if they end up using that style primarily they lose out on the tile caching benefits.

I suspect I won't be the only person with this issue and if there is a better way of doing this then please suggest it!

[BUG] With map downloading

What is the bug?

I downloaded a map with this code.

final region = RectangleRegion(
  LatLngBounds(
    LatLng(49.04939038046036, 8.761878343788906), // North West
    LatLng(48.41420735271916, 9.885473628398131), // South East
  ),
);

final downloadable = region.toDownloadable(
  5, // Minimum Zoom
  8, // Maximum Zoom
  TileLayer(
    urlTemplate: 'http://tile.openstreetmap.org/{z}/{x}/{y}.png',
    userAgentPackageName: 'exampleUser',
  ),
);

print(downloadable.toString());

FMTC.instance('storeName').download.check(downloadable).then((value) {print(value);});

Stream<DownloadProgress> stream = FMTC.instance('storeName').download.startForeground(region: downloadable);

stream.forEach((element) {print(element.percentageProgress);});
print("gespeicher!");`

With console output:

I/flutter ( 6268): gespeicher!
I/flutter ( 6268): 10
D/libc-netbsd( 6268): [getaddrinfo]: mtk hostname=tile.openstreetmap.org; servname=(null); netid=0; mark=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk hostname=tile.openstreetmap.org; servname=(null); netid=0; mark=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk hostname=tile.openstreetmap.org; servname=(null); netid=0; mark=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk hostname=tile.openstreetmap.org; servname=(null); netid=0; mark=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk hostname=tile.openstreetmap.org; servname=(null); netid=0; mark=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk hostname=tile.openstreetmap.org; servname=(null); netid=0; mark=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk hostname=tile.openstreetmap.org; servname=(null); netid=0; mark=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk hostname=tile.openstreetmap.org; servname=(null); netid=0; mark=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk hostname=tile.openstreetmap.org; servname=(null); netid=0; mark=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk hostname=tile.openstreetmap.org; servname=(null); netid=0; mark=0
D/libc-netbsd( 6268): [getaddrinfo]: mtk ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0
D/libc-netbsd( 6268): getaddrinfo: tile.openstreetmap.org get result from proxy gai_error = 0
D/libc-netbsd( 6268): getaddrinfo: tile.openstreetmap.org get result from proxy gai_error = 0
D/libc-netbsd( 6268): getaddrinfo: tile.openstreetmap.org get result from proxy gai_error = 0
D/libc-netbsd( 6268): getaddrinfo: tile.openstreetmap.org get result from proxy gai_error = 0
D/libc-netbsd( 6268): getaddrinfo: tile.openstreetmap.org get result from proxy gai_error = 0
D/libc-netbsd( 6268): getaddrinfo: tile.openstreetmap.org get result from proxy gai_error = 0
D/libc-netbsd( 6268): getaddrinfo: tile.openstreetmap.org get result from proxy gai_error = 0
D/libc-netbsd( 6268): getaddrinfo: tile.openstreetmap.org get result from proxy gai_error = 0
D/libc-netbsd( 6268): getaddrinfo: tile.openstreetmap.org get result from proxy gai_error = 0
D/libc-netbsd( 6268): getaddrinfo: tile.openstreetmap.org get result from proxy gai_error = 0
I/flutter ( 6268): 10.0
I/flutter ( 6268): 20.0
I/flutter ( 6268): 30.0
I/flutter ( 6268): 40.0
I/flutter ( 6268): 50.0
I/flutter ( 6268): 60.0
I/flutter ( 6268): 70.0
I/flutter ( 6268): 80.0
I/flutter ( 6268): 90.0
I/flutter ( 6268): 100.0

But the map only shows white screen. For the map I use this code:

FlutterMap(
    options: MapOptions(
      center: LatLng(auf.alt??0.0, auf.lang??0.0),
      zoom: 8,
      keepAlive: true,
      interactiveFlags: InteractiveFlag.all & ~InteractiveFlag.rotate,
    ),
    nonRotatedChildren: [],
    children: [
      TileLayer(
        tileProvider: FMTC.instance('storeName').getTileProvider(),
        //urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
        //userAgentPackageName: 'com.example.app',
      ),
      MarkerLayer(
        markers: [
          Marker(
            point: LatLng(auf.alt??0.0, auf.lang??0.0),
            width: 50,
            height: 50,
            builder: (context) => buildIcon(),
          ),
          Marker(
            point: LatLng(auf.alt??0.0, auf.alt??0.0),
            width: 40,
            height: 40,
            builder: (context) => logoIcon(),
          ),
        ],
      ),
      CurrentLocationLayer(),
    ],
  ),

What is the expected behaviour?

show Map

How can we reproduce this issue?

No response

Do you have a potential solution?

I don't know why

D/libc-netbsd( 6268): getaddrinfo: tile.openstreetmap.org get result from proxy gai_error = 0

is thrown.

Can you provide any other information?

No response

Platforms Affected

Android

Severity

Erroneous: Prevents normal functioning and causes errors in the console

Frequency

Consistently: Always occurs at the same time and location

Requirements

  • I agree to follow this project's Code of Conduct
  • My Flutter/Dart installation is unaltered, and flutter doctor finds no relevant issues
  • I am using the latest stable version of this package
  • I have checked the FAQs section on the documentation website
  • I have checked for similar issues which may be duplicates

Cannot compile android version of the app "Could not find any matches for com.transistorsoft:tsbackgroundfetch:+"

What is the bug?
Whenever the plugin is added in the pubspec.yaml file the app will not compile (tested in a clean/new project)

What do you expect to happen?
the app should compile when the plugin is added in the pubspec.yaml file....

Reproduction
Steps to reproduce the behaviour:

  1. Create a new flutter project
  2. add the plugin in the pubspec.yaml file like this flutter_map_tile_caching: ^3.0.1
  3. run the app on a real device or emulator
  4. notice the error

Screenshots and recordings
build error:
image

Additional context
error message: Launching lib\main.dart on SM T860 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find any matches for com.transistorsoft:tsbackgroundfetch:+ as no versions of com.transistorsoft:tsbackgroundfetch are available.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/transistorsoft/tsbackgroundfetch/maven-metadata.xml
- https://jcenter.bintray.com/com/transistorsoft/tsbackgroundfetch/maven-metadata.xml
- https://storage.googleapis.com/download.flutter.io/com/transistorsoft/tsbackgroundfetch/maven-metadata.xml
- file:/D:/coren/PROGRAMMING/FLUTTER/Metar-Viewer/android/app/libs/com/transistorsoft/tsbackgroundfetch/maven-metadata.xml
- https://repo.maven.apache.org/maven2/com/transistorsoft/tsbackgroundfetch/maven-metadata.xml
Required by:
project :app > project :background_fetch

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 23s
Exception: Gradle task assembleDebug failed with exit code 1

[BUG] v4: File system watching is not supported on this platform (iOS)

Hello! When I run the v4 example on iPad Air 4th gen (iOS 14.5) it returns this

โ•โ•โ•โ•โ•โ•โ• Exception caught by widgets library โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
The following FileSystemException was thrown building Consumer<GeneralProvider>(dirty, dependencies: [_InheritedProviderScope<GeneralProvider?>]):
File system watching is not supported on this platform, path = ''

The relevant error-causing widget was
Consumer<GeneralProvider> Consumer:[file:///Users/melissavillalobos/Downloads/flutter_map_tile_caching-4/example/lib/pages/home/components/panel/panel.dart:26:16]()
When the exception was thrown, this was the stack
.....

I already added the background_fetch and permission_handler configurations.
I am not sure if I did something wrong , hope someone can help, thanks.

[BUG] Cannot delete statistic cache file

What is the bug?

Exception occurs when deleting attempting to delete a file. This happened after upgrading Flutter to 3.3.7 and running in debug mode.

I/flutter (22291): ----------------FIREBASE CRASHLYTICS----------------
I/flutter (22291): FileSystemException: Cannot delete file, path = '/data/user/0/com.mycompany.myapp/app_flutter/fmtc/stores/OsmStoreDirectory/stats/length.cache' (OS Error: No such file or directory, errno = 2)
I/flutter (22291):
I/flutter (22291): #0 _File._delete. (dart:io/file_impl.dart:283:9)
I/flutter (22291): #1 _rootRunUnary (dart:async/zone.dart:1399:47)
I/flutter (22291): #2 _CustomZone.runUnary (dart:async/zone.dart:1300:19)
I/flutter (22291):
I/flutter (22291): #3 Future.wait. (dart:async/future.dart:522:21)
I/flutter (22291):
I/flutter (22291): ----------------------------------------------------

What is the expected behaviour?

No exception should happen. I can catch the error in my root zone and log it, so this is not a showstopper for me.

How can we reproduce this issue?

This happened after upgrading Flutter from 3.3.6 to 3.3.7, and then running my app in debug mode. I saw this also after the previous update but did not report it then.

Do you have a potential solution?

Don't know, maybe check for the file/directory existence before attempting to delete?

Can you provide any other information?

No response

Platforms Affected

Android

Severity

Minimum: Allows normal functioning

Frequency

Rarely: Occurs every so often

Requirements

  • I agree to follow this project's Code of Conduct
  • My Flutter/Dart installation is unaltered, and flutter doctor finds no relevant issues
  • I am using the latest stable version of this package
  • I have checked the FAQs section on the documentation website
  • I have checked for similar issues which may be duplicates

v4: [BUG] Illegal argument in isolate message

Call of tileProvider.downloadRegion() lead to the following error:
Illegal argument in isolate message : (object is a closure - Function 'close':.)
#0 spawnFunction (dart:_internal-patch/internal_patch.dart:190:54)
#1 Isolate.spawn (dart:isolate-patch/isolate_patch.dart:362:7)
#2 StorageCachingTileProvider._spawnDownloadIsolate (package:flutter_map_tile_caching/src/main.dart:531:30)

Version*
flutter_map_tile_caching: ^4.0.0-dev.5
flutter_map: ^0.14.0

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[โˆš] Flutter (Channel stable, 2.5.2, on Microsoft Windows [Version 10.0.19042.1237], locale de-DE)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
X cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[โˆš] Chrome - develop for the web
[โˆš] Android Studio (version 4.1)
[โˆš] VS Code (version 1.61.0)
[โˆš] Connected device (3 available)

Ability to delete a downloaded region

Describe the solution you'd like
An option to delete a region from the database when it is no longer needed.

Is your feature request related to a problem? Please describe.
There is currently no method to delete a region. The only viable option is to clear data/re-download the app which is not sustainable.

Describe alternatives you've considered
No options currently available other than clearing the app data.

Additional context
Add any other context or screenshots about the feature request here.

FMTC storename error

What is the bug?

I am unable to find any information about FMTC.instance parameter storename

Here is the error that i am getting:
[StoreDirectory(rootDirectory: RootDirectory(_rootDirectory: Directory: '/data/user/0/co.appname/app_flutter/fmtc'), storeName: storeName), StoreDirectory(rootDirectory: RootDirectory(_rootDirectory: Directory: '/data/user/0/co.appname/app_flutter/fmtc'), storeName: openstreetmap)]

Even if run example app, there are no stores to download from, the list is empty
Screenshot_1673631023

Please explain me from where i can get this storename. right now i have followed everything from your given documentation. I am looking forward for your response.

What is the expected behaviour?

Right now the application is not saving the tiles, which it should. and there is no explanation about the above parameter.

How can we reproduce this issue?

Right now i am using 
- flutter_map: ^3.0.0
- flutter_map_tile_caching: ^6.2.0

Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.19044.2486], locale en-US)
Checking Android licenses is taking an unexpectedly long time...[โˆš] Android toolchain - develop for Android devices (Android SDK version 30.0.3)

And with this configuration your example application is having some problems

Do you have a potential solution?

No response

Can you provide any other information?

Please let me know if you need anything else from my side

Platforms Affected

Android, iOS

Severity

Erroneous: Prevents normal functioning and causes errors in the console

Frequency

Consistently: Always occurs at the same time and location

Requirements

  • I agree to follow this project's Code of Conduct
  • My Flutter/Dart installation is unaltered, and flutter doctor finds no relevant issues
  • I am using the latest stable version of this package
  • I have checked the FAQs section on the documentation website
  • I have checked for similar issues which may be duplicates

[HELP] Ability to cache multiple regions at the same time

I want to download multiple regions at the same time, I have tried merging downloadRegion stream but only the latest stream is downloaded and the other streams throws error ERROR Bad state: Stream has already been listened to..
Any Help ?
And thanks for this awesome plugin.

Multiple Layers Not Working

Great plugin, thanks. My question (and maybe a feature suggestion) is: What's the best approach to cache multiple layers (from different servers/sources)?

Offline side loading

Describe the solution you'd like
I would like to be able to prepare offline pack beforehand on my server and side-load or download it in runtime, enabling and disabling this offline pack on demand.

[BUG] v4: Lost connection to device

The app frequently crashes while (debug mode) moving the map around or shortly after moving around. Seems like zooming in and out can increase the likelihood that it happens.

*Important! This could be a flutter_map issue. I'm going to post this there as well.

Environment: M1 Macbook Pro - Android Studio Arctic Fox - 2020.3.1 Patch 4.
Using flutter_map_tile_caching v_4.0.0-dev.9

The most recent crash running on an emulator (Pixel 4a API 30) included this:

The following IsolateSpawnException was thrown while resolving an image:
Unable to spawn isolate: Could not prepare the child isolate to run.

When the exception was thrown, this was the stack: 
Image provider: FMTCImageProvider()
Image configuration: ImageConfiguration()
Image key: FMTCImageProvider()
====================================================================================================
Lost connection to device.```

Here is a more typical looking crash using an iPhone 7 running 14.7.1:

``` * thread #62, name = 'DartWorker', stop reason = EXC_BAD_ACCESS (code=1, address=0x680)
    frame #0: 0x0000000103cd247c Flutter`dart::Message::~Message() + 160
Flutter`dart::Message::~Message:
->  0x103cd247c <+160>: ldr    x8, [x8, #0x680]
    0x103cd2480 <+164>: ldr    x20, [x8, #0x400]
    0x103cd2484 <+168>: ldr    x21, [x19, #0x18]
    0x103cd2488 <+172>: mov    x0, x20
Target 0: (Runner) stopped.
Lost connection to device. ```

Do not download tiles if are already saved

If we call downloadRegion it will download all tiles. Can we add extra functionality to download only not downloaded tiles?

Describe the solution you'd like
Get from database saved tiles, do not download this tiles

Describe alternatives you've considered
If we have hard coded region in app, we can check if amount of saved tiles is equal to tiles for specific region. When is equal do not download. Problem in this case is if some tiles are saved on database, because we start downloading all tiles again.

[BUG] Unhandled Exception: Instance of `QueueCancelledException`

What is the bug?

When I run the following code to cancel the download๏ผŒ the following exception is reported

await FMTC
        .instance(provider.selectedStore!.storeName)
        .download
        .cancel();
 [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Instance of 'QueueCancelledException'

What is the expected behaviour?

catch this exception or else ?

How can we reproduce this issue?

No response

Do you have a potential solution?

No response

Can you provide any other information?

No response

Platforms Affected

Android

Severity

Obtrusive: Prevents normal functioning but causes no errors in the console

Frequency

Consistently: Always occurs at the same time and location

Requirements

  • I agree to follow this project's Code of Conduct
  • My Flutter/Dart installation is unaltered, and flutter doctor finds no relevant issues
  • I am using the latest stable version of this package
  • I have checked the FAQs section on the documentation website
  • I have checked for similar issues which may be duplicates

[QUESTION] How to cache specific area?

What is the easiest way to cache specific areas in detail? I want not just to cache one layer of the area, but also have the ability to observe map details.

Implement Caching

Hello, I have a project in a very advanced stage already, and I wanted to implement caching in it, so I can use your api, will I need to redo all of it? Or do you have one that you don't need? I saw that your api is for Flutter_map, and I'm using flutter_map. Do I need to redo it all to be able to use your api?

WMS layer download not working

When using WMS layers the tiles are cached correctly when manually panning around the map, however if you attempt to download and area the download screen flashes very quickly and no new tiles are downloaded. I've confirmed this with the example app by using the following TileLayerOptions:

final tileLayerOptions = TileLayerOptions(
tileProvider: tileProvider,
wmsOptions: WMSTileLayerOptions(
  baseUrl: 'https://{s}.s2maps-tiles.eu/wms/?',
  layers: ['s2cloudless-2018_3857'],
  ),
subdomains: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'],
);

I've confirmed this with the following steps:

  • Replace the TileLayerOptions in the example app
  • Start the application and letting the application load the map
  • Defining my download area and zoom levels
  • Clearing the cache, then re-entering the clear cache dialog to confirm cached tiles are at 0
  • Press the download button
  • Re-enter the clear cache dialog

You'll find that the number of cached tiles has not increased and remains 0. Changing back to the original TileLayerOptions in the example restored the expected behavior.

I've confirmed this both with the Pub.Dev package as well as the code here on GitHub. Tried my hand at debugging this but I'm only a few days into my Flutter journey, so I'm affraid I was not able to get very far...

Do let me know if you need any additional information.

[FEATURE] Prevent duplication of tiles between stores

What do you want implemented?

The ability to delete a downloaded region, either BaseRegion or DownloadableRegion, by name, and delete any of its contained tiles, assuming they do not also belong to another region.

  • A region can be downloaded with a name
  • A tile has multiple owning region names, plus a special region that signifies the tile has been browse cached
  • Deleting a region by name will remove it's name from all it's tiles
  • A tile with no owning regions (and one that is not browse cached) will be deleted

What other alternatives are available?

At the moment, users can use multiple Stores to achieve similar functionality. However, this means that tiles can be duplicated between regions, which is not ideal.

Can you provide any other information?

This is a formalised request for #24.

Platforms Affected

Android, iOS, Windows, MacOS, Linux

Severity

Annoying: Currently have to use workarounds

Requirements

[BUG] `checkTileCached` method appears broken

What do you want implemented?

Download cached map tiles as image file permanently, so that i can use map when offline.

What other alternatives are available?

No response

Can you provide any other information?

No response

Platforms Affected

Android

Severity

Annoying: Currently have to use workarounds

Requirements

Duration and tile amount settings not used

This is more a question on how the package work. I would like to know if there is a way to increase the caching time (i believe currently is 30 or 31 days) also can I increase the number of tiles that could be downloaded to the phone. Thank you so much for the package :)

[FEATURE] Add method to catch tile retrieval error

What is the bug?

I sometimes see this error in Crashlytics. I have added exception handling, but the error somehow still slips through to Crashlytics. What is the proper way to catch this, so it is not reported to Crashlytics?

Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: FMTCBrowsingError: Failed to load the tile from the cache or the network because it was missing from the cache and the server responded with a HTTP code other than 200 OK.. Error thrown Instance of 'ErrorDescription'.
at FMTCImageProvider._loadAsync.finish(image_provider.dart:106)
at FMTCImageProvider._loadAsync(image_provider.dart:166)

What is the expected behaviour?

I think the error is expected, but I should be able to catch it, so it is not reported to Crashlytics. I am using the errorTileCallback on the TileLayer:

                tileBuilder:
                    (BuildContext context, Widget tileWidget, Tile tile) {
                  if (tile.loadError) {
                    // apply red colorFilter or wrap widget with another custom Widget
                    return Container(color: AppColors.mapBadTile);
                  }
                  return ColorFiltered(
                      colorFilter: notifier.isMapDarkModeEnabled
                          ? MapUtils.colorFilterDark
                          : MapUtils.colorFilterNone,
                      child: tileWidget);
                },
                evictErrorTileStrategy: EvictErrorTileStrategy.dispose,
                errorTileCallback: (Tile tile, error) {
                  if (error != null) {
                    debugPrint(error.toString());
                  }
                },

How can we reproduce this issue?

Seems to happen sometimes when there is no internet connection, but I do not know how to reliably force the error.

Do you have a potential solution?

No response

Can you provide any other information?

No response

Platforms Affected

Android

Severity

Minimum: Allows normal functioning

Frequency

Rarely: Occurs every so often

Requirements

  • I agree to follow this project's Code of Conduct
  • My Flutter/Dart installation is unaltered, and flutter doctor finds no relevant issues
  • I am using the latest stable version of this package
  • I have checked the FAQs section on the documentation website
  • I have checked for similar issues which may be duplicates

[BUG] 'flutter_background' blocking build

What is the bug?

Due to outdated gradle version in currentrly published flutter_background plugin, this plugin cannot be built.
There's an issue for this.

That was fixed in fcce0d57525802b6f720dee0a080a10a0feaca4b, but published version of that plugin does not contain this commit.

> Could not resolve com.google.jimfs:jimfs:1.1. Required by: project :flutter_background > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0 > com.android.tools:sdklib:26.5.0 > com.android.tools:repository:26.5.0 > Could not resolve com.google.jimfs:jimfs:1.1. > Could not get resource 'https://jcenter.bintray.com/com/google/jimfs/jimfs/1.1/jimfs-1.1.pom'. > Could not HEAD 'https://jcenter.bintray.com/com/google/jimfs/jimfs/1.1/jimfs-1.1.pom'. > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5.1/userguide/build_environment.html#gradle_system_properties > PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed

What is the expected behaviour?

Build successful

How can we reproduce this issue?

No response

Do you have a potential solution?

No response

Can you provide any other information?

No response

Platforms Affected

Android

Severity

Fatal: Causes the application to crash

Frequency

Consistently: Always occurs at the same time and location

Requirements

  • I agree to follow this project's Code of Conduct
  • My Flutter/Dart installation is unaltered, and flutter doctor finds no relevant issues
  • I am using the latest stable version of this package
  • I have checked the FAQs section on the documentation website
  • I have checked for similar issues which may be duplicates

[BUG] v4: Example app (randomly?) crashes

I load the example app on the Emulator. After some time switching to cache application stopped with this error:

Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x304 in tid 3084 (DartWorker), pid 2710 (le.fmtc_example)

[BUG]

What is the bug?

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Exception: No value provided for variable id

What is the expected behaviour?

It should download the tiles from mapbox server.

How can we reproduce this issue?

I am suing example app, the only change I did is I am suing mapbox instead of openstreet.

Endpoint: https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}

Also passing additional options in TileLayer under FlutterMap children[].

 additionalOptions: {
                      'accessToken': model.mapToken,
                      'id': satelliteMode ? model.mapStyleSatellite : model.mapStyleStreets,
                      },

Do you have a potential solution?

No response

Can you provide any other information?

No response

Platforms Affected

iOS

Severity

Erroneous: Prevents normal functioning and causes errors in the console

Frequency

Consistently: Always occurs at the same time and location

Requirements

  • I agree to follow this project's Code of Conduct
  • My Flutter/Dart installation is unaltered, and flutter doctor finds no relevant issues
  • I am using the latest stable version of this package
  • I have checked the FAQs section on the documentation website
  • I have checked for similar issues which may be duplicates

[BUG] iOS - Filename too long

The tileserver we are using returns very long filename. On iOS this makes caching fails with the following exception:

FileSystemException (FileSystemException: Cannot open file, path = '/var/mobile/Containers/Data/Application/5649CAC6-88DA-4FA5-8E59-C982E99F69CC/Documents/mapCache/Test/https___testmaps-v2.metria.se_geoserver_metria_wms_&service=WMS&request=GetMap&layers=metria%3AMetriaFastighetLafayette&styles=&format=image%2Fpng&srs=EPSG%3A3857&version=1.1.1&transparent=true&width=256&height=256&bbox=2392631.859382587,9689463.453542082,2392784.7334391577,9689616.327598657' (OS Error: File name too long, errno = 63))

@ line 80 downloader.dart

File(path).writeAsBytesSync(
      (await client.get(Uri.parse(url))).bodyBytes,
      flush: true,
    );

[QUESTION] Parameter to disable caching while browsing?

What is the main problem?
Is there a way to limit the costs of the tile server download by disabling caching while browsing? Because with caching while browsing enabled every tile that's displayed will be downloaded. And the higher the amount of downloaded tiles the higher the costs.

Give more detail about what you need help with or what your question is
I didn't find any flag or parameter to disable the caching while browsing. Is there anything implemented?

Is there a potential for this question to turn into a feature request?
If it's not implemented is that even possible? To add e.g. a bool enableBrowseCaching that defaults to true, but if it's set to false and the device is online, tiles that have not been pre-downloaded will be loaded from the internet but not be cached.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.