Skip to content

Commit 3aae677

Browse files
TileLayer Reimplementation (& v4 Release Preparation) (#1475)
* 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]>
1 parent 8c49bfa commit 3aae677

File tree

72 files changed

+3198
-1640
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+3198
-1640
lines changed

.github/ISSUE_TEMPLATE/bug-report.yaml

+31-70
Original file line numberDiff line numberDiff line change
@@ -8,63 +8,55 @@ body:
88
value: "
99
# Bug Report
1010
11-
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.
11+
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.
12+
13+
14+
---
15+
16+
17+
Before reporting a bug, please:
18+
19+
* Check if there is already an open or closed issue that is similar to yours
20+
21+
* Ensure that you have fully read the documentation (both the website and API docs) that pertains to the function you're having problems with
22+
23+
* Ensure that your Flutter environment is correctly installed & set-up
24+
25+
* Remember that we're volunteers trying our best to help, so please be polite
26+
27+
28+
---
1229
"
13-
- type: markdown
14-
attributes:
15-
value: ---
1630
- type: textarea
17-
id: description
31+
id: details
1832
attributes:
1933
label: What is the bug?
20-
description: What were you implementing when you found this issue? What happens when the bug triggers?
21-
validations:
22-
required: true
23-
- type: textarea
24-
id: expected-behaviour
25-
attributes:
26-
label: What is the expected behaviour?
27-
description: What do you think should have happened?
34+
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.
2835
validations:
2936
required: true
3037
- type: textarea
3138
id: reproduce
3239
attributes:
33-
label: How can we reproduce this issue?
40+
label: How can we reproduce it?
3441
description: |
35-
Please include a [minimal reproducible example](https://en.wikipedia.org/wiki/Minimal_reproducible_example) (preferable), otherwise detail the exact steps to reproduce this issue.
36-
If you do not include any information here, it will take longer for us to verify your issue.
37-
placeholder: Text automatically formatted as Dart code, on submission
38-
render: dart
42+
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.
43+
If you do not include any information here, it will take longer for us to verify your issue.
44+
validations:
45+
required: true
3946
- type: textarea
4047
id: solution
4148
attributes:
4249
label: Do you have a potential solution?
43-
description: "If so, please detail it: it will make it quicker for us to fix the issue"
44-
- type: textarea
45-
id: additional-info
46-
attributes:
47-
label: Can you provide any other information?
48-
description: |
49-
Please attach any other logs, screenshots, or screen recordings.
50-
Is there anything else you'd like to say?
50+
description: "If so, please detail it: it will make it quicker for us to fix the issue."
5151
- type: markdown
5252
attributes:
5353
value: ---
54-
- type: dropdown
54+
- type: input
5555
id: platform
5656
attributes:
57-
label: Platforms Affected
58-
description: What platforms does this issue affect?
59-
multiple: true
60-
options:
61-
- Android
62-
- iOS
63-
- Web
64-
- Windows
65-
- MacOS
66-
- Linux
67-
- Other
57+
label: Platforms
58+
description: Please detail the devices and operating systems you can reproduce this bug on, separated by commas.
59+
placeholder: eg. Android 13 (Samsung Galaxy S99), Windows 11 (x64)
6860
validations:
6961
required: true
7062
- type: dropdown
@@ -78,35 +70,4 @@ body:
7870
- "Erroneous: Prevents normal functioning and causes errors in the console"
7971
- "Fatal: Causes the application to crash"
8072
validations:
81-
required: true
82-
- type: dropdown
83-
id: frequency
84-
attributes:
85-
label: Frequency
86-
description: How often does this issue occur?
87-
options:
88-
- "Once: Occurred on a single occasion"
89-
- "Rarely: Occurs every so often"
90-
- "Often: Occurs more often than when it doesn't"
91-
- "Consistently: Always occurs at the same time and location"
92-
validations:
93-
required: true
94-
- type: markdown
95-
attributes:
96-
value: ---
97-
- type: checkboxes
98-
id: terms
99-
attributes:
100-
label: Requirements
101-
description: These are in place to prevent spam and unnecessary reports.
102-
options:
103-
- label: I agree to follow this project's [Code of Conduct](https://github.com/fleaflet/flutter_map/blob/master/CODE_OF_CONDUCT.md)
104-
required: true
105-
- label: My Flutter/Dart installation is unaltered, and `flutter doctor` finds no relevant issues
106-
required: true
107-
- label: I am using the [latest stable version](https://pub.dev/packages/flutter_map) of this package
108-
required: true
109-
- label: I have checked the FAQs section on the documentation website
110-
required: true
111-
- label: I have checked for similar issues which may be duplicates
112-
required: true
73+
required: true

.github/ISSUE_TEMPLATE/config.yml

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
blank_issues_enabled: false
22
contact_links:
3-
- name: Discord Server
3+
- name: Get Help
44
url: https://discord.gg/egEGeByf4q
5-
about: Need more generalised help, or just want to talk? Join the Discord server!
6-
- name: Common Issues
7-
url: https://docs.fleaflet.dev/usage/common-issues
8-
about: Check whether your issue is listed as a common issue in the documentation
9-
- name: Plugins
10-
url: https://docs.fleaflet.dev/plugins/list
11-
about: If you need help with a plugin, please ask on their issue tracker first
5+
about: Don't quite understand how to implement something, or just want to talk? Join the Discord server!
6+
- name: Documentation
7+
url: https://docs.fleaflet.dev/
8+
about: Before posting an issue, please ensure you read the documentation thoroughly

.github/ISSUE_TEMPLATE/feature-request.yaml

+21-41
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,24 @@ body:
88
value: "
99
# Feature Request
1010
11-
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.
11+
Thanks for taking the time to let us know what you want to see!
12+
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.
13+
14+
15+
---
16+
17+
18+
Before requesting a feature, please:
19+
20+
* Check if there is already an open or closed issue that is similar to yours
21+
22+
* Ensure that you're using the latest version of flutter_map
23+
24+
* Ensure that you've read the documentation (both the website and API docs) thoroughly
25+
26+
27+
---
1228
"
13-
- type: markdown
14-
attributes:
15-
value: ---
1629
- type: textarea
1730
id: description
1831
attributes:
@@ -25,32 +38,14 @@ body:
2538
attributes:
2639
label: What other alternatives are available?
2740
description: Have you used any workarounds, for example?
28-
- type: textarea
29-
id: additional-info
30-
attributes:
31-
label: Can you provide any other information?
32-
description: |
33-
Please attach any other logs, screenshots, or screen recordings.
34-
Is there anything else you'd like to say?
3541
- type: markdown
3642
attributes:
3743
value: ---
38-
- type: dropdown
39-
id: platform
44+
- type: textarea
45+
id: additional-info
4046
attributes:
41-
label: Platforms Affected
42-
description: What platforms does this issue affect?
43-
multiple: true
44-
options:
45-
- Android
46-
- iOS
47-
- Web
48-
- Windows
49-
- MacOS
50-
- Linux
51-
- Other
52-
validations:
53-
required: true
47+
label: Can you provide any other information?
48+
description: Is there anything else you'd like to say?
5449
- type: dropdown
5550
id: severity
5651
attributes:
@@ -62,18 +57,3 @@ body:
6257
- "Obtrusive: No workarounds are available, and this is essential to me"
6358
validations:
6459
required: true
65-
- type: markdown
66-
attributes:
67-
value: ---
68-
- type: checkboxes
69-
id: terms
70-
attributes:
71-
label: Requirements
72-
description: These are in place to prevent spam and unnecessary reports.
73-
options:
74-
- label: I agree to follow this project's [Code of Conduct](https://github.com/fleaflet/flutter_map/blob/master/CODE_OF_CONDUCT.md)
75-
required: true
76-
- label: I am using the [latest stable version](https://pub.dev/packages/flutter_map) of this package
77-
required: true
78-
- label: I have checked for similar feature requests which may be duplicates
79-
required: true

.github/workflows/flutter.yml

-119
This file was deleted.

0 commit comments

Comments
 (0)