Skip to content

Commit

Permalink
TileLayer Reimplementation (& v4 Release Preparation) (#1475)
Browse files Browse the repository at this point in the history
* Remove broken updateInterval option

In passing I have also reduced the amount of calls to _setView() during
build.

* Remove Level since it had become a wrapper for CustomPoint

It was also storing zoom but the same zoom value was used to look up the
Level in TransformationCalculator.

* Tile layer cleanup and simplification

Simplified tile layer calculations. Tile layer is still very much a WIP.

* TileRange and TileBounds abstractions implemented

Still working on adding tests.

* Working with all example app CRSes

* Remove unnecessary _tileZoom and clean up some variables

* Make TileImage a ChangeNotifier

This avoids the need for TileLayer to rebuild the whole layer with
setState when a tile finishes loading. In fact TileLayer no longer
calls setState at all.

* Rename TileManager to TileImageManager

Also made a minor tidy-up in TileLayer build().

* Add TileUpdateTransformer to tile layer options

This allows debouncing/filtering/modifying tile updates triggered by map
movement.

* Avoid notifying listeners once a tile has been disposed

* Remove note about maybe needing to enable super mixins

Super mixins are enabled by default since flutter 2.1 which is below
flutter_map's package minimum requirement. See this comment and thread
for why this note was there and why it can be removed.

flutter/flutter#14317 (comment)

* Remove TileCoordinate export. I don't see why it would be needed outside of this project.

* Revert changes which were no longer needed

* Ignore Podfile in example since it gets generated when running the app

* Add tile scale calculations to the cache

* Create missing TileImages during build

See the code comments, this avoids a scenario where tiles are missing
because a given map movement triggers a TileLayer rebuild before the
tile loading is triggered.

I added a lot of comments in passing.

* Remove TilesContainer option since wrapping the TileLayer with the desired widget has the same behaviour

* Remove TilesContainer option since wrapping the TileLayer with the desired widget has the same behaviour

* Export TileCoordinate

* Rename TileCoordinate to TileCoordinates

* Add tileOpacity option

* Add an example TileUpdateTransformer

* Updated CHANGELOG and versioning throughout
Renamed `tileOpacity` to `opacity`
Removed deprecated features

* Avoid reloading images when opacity changes

* Combine opacity/fastReplace/tileFadeIn with a single tileDisplay option

* Privatized `TileDisplay` extender's constructors
Minor documentation fixes

* Unified `TileDisplay`'s `.map` and `.when` methods

* Simplified `TileProvider._getTileUrl` method

* Make default TileUpdateTransformer ignore taps

Given that we now default to using the TileUpdateTransformer removed
listening to the move stream directly and we now always listen to the
move stream mapped to TileLayerUpdate. This cleans up the TileLayer a
bit and simplified implementation/combination for
TileUpdateTransformers.

* Add a throttling tile update transformer

* Remove overrideTilesWhenUrlChanges option

Now we will always hold on to old tiles until the new tiles have loaded
to prevent flickering.

* Updated CHANGELOG
Updated GitHub Workflow

* Applied formatting to 'gestures.dart'

* Updated version
Updated LICENSE to better represent copyright claims
Removed 'CONTRIBUTING.md'

* Updated CHANGELOG to include #1487

* Updated CHANGELOG to include #1495

* Fixed Android build warning in example app

* Updated GitHub configuration

* Added example app building to workflow
Improvements to the example app and runner

* Merged workflow files to enable building  of example application

* Attempted fix workflow issues

* Changed incorrect path in workflow

* Fix tile provider import

It was always using the web tile provider. Now it correctly uses the io
tile provider when not on web.

* Remove unnecessary load/prune

* Formatting

* Avoid concurrent modification error when reloading tiles

* Include UrlLauncherPlugin registration

* Prevent map buttons from rotating

* Remove unnecessary argument

* Tidy up MapEvents

 - Remove MapEventSource.initialized since it is no longer used.
 - Make MapEvents const classes.
 - Use super parameters syntax.

* Add MapEventNonRotatedSizeChange

This new event is triggered when the map's non-rotated size is changed,
it is not called when the map is initialized. This will fix TileLayer
not loading new tiles when the map size changes.

In passing I made some other improvements:

 - Expose nonRotatedSize’s full type (CustomPoint<double>? instead of
   CustomPoint?) to avoid unnecessary type casts.
 - Improve the check for the constraints being ready before setting initial
   zoom/center based on MapOptions bounds.
 - Remove unnecessary setState in FlutterMapState’s emitMapEvent. The
   event emitting does not change the map's state and was causing double
   calls to setState in some code paths.
 - FlutterMapState tidy ups.
 - Removed the workaround for the initial map size being zero in TileLayer
   which caused tiles to not be loaded. The new MapEventNonRotatedSizeChange
   event removes the need for this workaround as during startup either:
     - The platform has already set flutter's resolution and thus all
       tiles are successfully loaded.
     - The platform has not set flutter's resolution but when it does it
       will cause LayoutBuilder to rebuild with the new size which will
       trigger a MapEventNonRotatedSizeChange event. This event will in
       turn trigger a tile load in TileLayer.

---------

Co-authored-by: JaffaKetchup <[email protected]>
  • Loading branch information
rorystephenson and JaffaKetchup committed May 2, 2023
1 parent 8c49bfa commit 3aae677
Show file tree
Hide file tree
Showing 72 changed files with 3,198 additions and 1,640 deletions.
101 changes: 31 additions & 70 deletions .github/ISSUE_TEMPLATE/bug-report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,63 +8,55 @@ body:
value: "
# Bug Report
Thanks for taking the time to fill out this bug report! It helps us to improve the experience for you and other developers that may be facing a similar problem. We aim to respond to bug reports as soon as possible, but it may take longer to resolve this issue depending on its complexity and severity. To help us verify the issue quicker, please include as much information as you can.
Thanks for taking the time to fill out this bug report! To help us verify the issue quicker, please include as much information as you can.
---
Before reporting a bug, please:
* Check if there is already an open or closed issue that is similar to yours
* Ensure that you have fully read the documentation (both the website and API docs) that pertains to the function you're having problems with
* Ensure that your Flutter environment is correctly installed & set-up
* Remember that we're volunteers trying our best to help, so please be polite
---
"
- type: markdown
attributes:
value: ---
- type: textarea
id: description
id: details
attributes:
label: What is the bug?
description: What were you implementing when you found this issue? What happens when the bug triggers?
validations:
required: true
- type: textarea
id: expected-behaviour
attributes:
label: What is the expected behaviour?
description: What do you think should have happened?
description: What were you implementing when you found this issue? What happens when the bug triggers? What do you think should have happened instead? Please include as much detail as possible, including screenshots and screen-recordings if you can.
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: How can we reproduce this issue?
label: How can we reproduce it?
description: |
Please include a [minimal reproducible example](https://en.wikipedia.org/wiki/Minimal_reproducible_example) (preferable), otherwise detail the exact steps to reproduce this issue.
If you do not include any information here, it will take longer for us to verify your issue.
placeholder: Text automatically formatted as Dart code, on submission
render: dart
Please include a fully formatted [minimal reproducible example](https://en.wikipedia.org/wiki/Minimal_reproducible_example) wrapped in a [Dart code block](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting), otherwise, detail the exact steps to reproduce this issue.
If you do not include any information here, it will take longer for us to verify your issue.
validations:
required: true
- type: textarea
id: solution
attributes:
label: Do you have a potential solution?
description: "If so, please detail it: it will make it quicker for us to fix the issue"
- type: textarea
id: additional-info
attributes:
label: Can you provide any other information?
description: |
Please attach any other logs, screenshots, or screen recordings.
Is there anything else you'd like to say?
description: "If so, please detail it: it will make it quicker for us to fix the issue."
- type: markdown
attributes:
value: ---
- type: dropdown
- type: input
id: platform
attributes:
label: Platforms Affected
description: What platforms does this issue affect?
multiple: true
options:
- Android
- iOS
- Web
- Windows
- MacOS
- Linux
- Other
label: Platforms
description: Please detail the devices and operating systems you can reproduce this bug on, separated by commas.
placeholder: eg. Android 13 (Samsung Galaxy S99), Windows 11 (x64)
validations:
required: true
- type: dropdown
Expand All @@ -78,35 +70,4 @@ body:
- "Erroneous: Prevents normal functioning and causes errors in the console"
- "Fatal: Causes the application to crash"
validations:
required: true
- type: dropdown
id: frequency
attributes:
label: Frequency
description: How often does this issue occur?
options:
- "Once: Occurred on a single occasion"
- "Rarely: Occurs every so often"
- "Often: Occurs more often than when it doesn't"
- "Consistently: Always occurs at the same time and location"
validations:
required: true
- type: markdown
attributes:
value: ---
- type: checkboxes
id: terms
attributes:
label: Requirements
description: These are in place to prevent spam and unnecessary reports.
options:
- label: I agree to follow this project's [Code of Conduct](https://github.com/fleaflet/flutter_map/blob/master/CODE_OF_CONDUCT.md)
required: true
- label: My Flutter/Dart installation is unaltered, and `flutter doctor` finds no relevant issues
required: true
- label: I am using the [latest stable version](https://pub.dev/packages/flutter_map) of this package
required: true
- label: I have checked the FAQs section on the documentation website
required: true
- label: I have checked for similar issues which may be duplicates
required: true
required: true
13 changes: 5 additions & 8 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Discord Server
- name: Get Help
url: https://discord.gg/egEGeByf4q
about: Need more generalised help, or just want to talk? Join the Discord server!
- name: Common Issues
url: https://docs.fleaflet.dev/usage/common-issues
about: Check whether your issue is listed as a common issue in the documentation
- name: Plugins
url: https://docs.fleaflet.dev/plugins/list
about: If you need help with a plugin, please ask on their issue tracker first
about: Don't quite understand how to implement something, or just want to talk? Join the Discord server!
- name: Documentation
url: https://docs.fleaflet.dev/
about: Before posting an issue, please ensure you read the documentation thoroughly
62 changes: 21 additions & 41 deletions .github/ISSUE_TEMPLATE/feature-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,24 @@ body:
value: "
# Feature Request
Thanks for taking the time to let us know what you want to see! It helps us to improve the experience for you and other developers that may be facing a similar problem. Unfortunately, response times for feature requests are longer than bug reports, as they are lower priority. If you want this functionality implemented quickly, please make a Pull Request to go alongside this feature request.
Thanks for taking the time to let us know what you want to see!
Unfortunately, response times for feature requests are longer than bug reports, as they are lower priority. If you want this functionality implemented quickly, please make a Pull Request to go alongside this feature request.
---
Before requesting a feature, please:
* Check if there is already an open or closed issue that is similar to yours
* Ensure that you're using the latest version of flutter_map
* Ensure that you've read the documentation (both the website and API docs) thoroughly
---
"
- type: markdown
attributes:
value: ---
- type: textarea
id: description
attributes:
Expand All @@ -25,32 +38,14 @@ body:
attributes:
label: What other alternatives are available?
description: Have you used any workarounds, for example?
- type: textarea
id: additional-info
attributes:
label: Can you provide any other information?
description: |
Please attach any other logs, screenshots, or screen recordings.
Is there anything else you'd like to say?
- type: markdown
attributes:
value: ---
- type: dropdown
id: platform
- type: textarea
id: additional-info
attributes:
label: Platforms Affected
description: What platforms does this issue affect?
multiple: true
options:
- Android
- iOS
- Web
- Windows
- MacOS
- Linux
- Other
validations:
required: true
label: Can you provide any other information?
description: Is there anything else you'd like to say?
- type: dropdown
id: severity
attributes:
Expand All @@ -62,18 +57,3 @@ body:
- "Obtrusive: No workarounds are available, and this is essential to me"
validations:
required: true
- type: markdown
attributes:
value: ---
- type: checkboxes
id: terms
attributes:
label: Requirements
description: These are in place to prevent spam and unnecessary reports.
options:
- label: I agree to follow this project's [Code of Conduct](https://github.com/fleaflet/flutter_map/blob/master/CODE_OF_CONDUCT.md)
required: true
- label: I am using the [latest stable version](https://pub.dev/packages/flutter_map) of this package
required: true
- label: I have checked for similar feature requests which may be duplicates
required: true
119 changes: 0 additions & 119 deletions .github/workflows/flutter.yml

This file was deleted.

Loading

0 comments on commit 3aae677

Please sign in to comment.