Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Attribution #1487

Merged
merged 15 commits into from
Apr 18, 2023
Merged

Improved Attribution #1487

merged 15 commits into from
Apr 18, 2023

Conversation

JaffaKetchup
Copy link
Member

@JaffaKetchup JaffaKetchup commented Apr 12, 2023

Continuation and replacement of #1390, which aims to improve the attribution situation within 'flutter_map'.
Contains breaking changes, and addition of Windows support for the example app.

@JaffaKetchup JaffaKetchup marked this pull request as ready for review April 12, 2023 10:50
Shrunk flutter_map_logo asset to reduce overhead cost
@JaffaKetchup JaffaKetchup mentioned this pull request Apr 12, 2023
4 tasks
Copy link
Collaborator

@TesteurManiak TesteurManiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's my first feedbacks, I'll try to do a second pass on this when I have a bit more time.

pubspec.yaml Outdated Show resolved Hide resolved
lib/src/layer/attribution_layer.dart Outdated Show resolved Hide resolved
lib/src/layer/attribution_layer.dart Outdated Show resolved Hide resolved
lib/src/layer/attribution_layer.dart Outdated Show resolved Hide resolved
lib/flutter_map.dart Outdated Show resolved Hide resolved
lib/src/layer/attribution_layer.dart Outdated Show resolved Hide resolved
lib/src/layer/attribution_layer.dart Outdated Show resolved Hide resolved
lib/src/layer/attribution_layer.dart Outdated Show resolved Hide resolved
lib/src/layer/attribution_layer.dart Outdated Show resolved Hide resolved
Used `VoidCallback` instead of declaring the return type fully
Minor performance improvements
Removed redundant ESRI example page
Added attribution where required in the example app
Improved documentation
Internal refactoring and reorganization
JaffaKetchup added a commit to rorystephenson/flutter_map that referenced this pull request Apr 14, 2023
Copy link
Collaborator

@TesteurManiak TesteurManiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JaffaKetchup JaffaKetchup merged commit a051edb into fleaflet:master Apr 18, 2023
@JaffaKetchup JaffaKetchup deleted the jaffaketchup branch April 18, 2023 17:13
JaffaKetchup added a commit that referenced this pull request May 2, 2023
* 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 <github@jaffaketchup.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants