-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fde39d9
commit dac6a1d
Showing
5 changed files
with
129 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
custom: "https://docs.fleaflet.dev/supporters#support-us" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: "Branch & Fork CI/CD" | ||
on: | ||
push: | ||
branches: | ||
- '!master' | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
score-package: | ||
name: "Score Package" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- name: Run Dart Package Analyser | ||
uses: axel-op/dart-package-analyzer@master | ||
id: analysis | ||
with: | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Check Package Scores | ||
env: | ||
TOTAL: ${{ steps.analysis.outputs.total }} | ||
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }} | ||
run: | | ||
if (( $TOTAL < $TOTAL_MAX - 10 )) | ||
then | ||
echo Package score less than available score. Improve the score! | ||
exit 1 | ||
fi | ||
analyse-code: | ||
name: "Analyse Code" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Flutter Environment | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: "stable" | ||
- name: Get All Dependencies | ||
run: flutter pub get | ||
- name: Check Formatting | ||
run: dart format --output=none --set-exit-if-changed . | ||
- name: Check Lints | ||
run: dart analyze --fatal-infos --fatal-warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
# flutter_map_cancellable_tile_provider | ||
|
||
Plugin for [flutter_map](https://github.com/fleaflet/flutter_map) that provides a `TileProvider` with the capability to cancel unnecessary HTTP requests (on the web) | ||
Plugin for [flutter_map](https://github.com/fleaflet/flutter_map) that provides a `TileProvider` that fetches tiles from the network, with the capability to cancel unnecessary HTTP tile requests | ||
|
||
- Reduce tile loading durations | ||
Tiles that are removed/pruned before they are fully loaded do not need to complete (down)loading, and therefore do not need to complete the HTTP interaction. Cancelling these unnecessary tile requests early could: | ||
|
||
- Reduce tile loading durations (particularly on the web) | ||
- Reduce users' (cellular) data and cache space consumption | ||
- Reduce costly tile requests to tile servers* | ||
- Reduce (cellular) data consumption | ||
- Improve performance by reducing CPU and IO work | ||
|
||
--- | ||
This provider uses '[dio](https://pub.dev/packages/dio)', which supports aborting unnecessary HTTP requests in-flight, after they have already been sent. | ||
|
||
Unlike `NetworkTileProvider`, this uses '[dio](https://pub.dev/packages/dio)' to support cancelling/aborting unnecessary HTTP requests in-flight. Tiles that are removed/pruned before they are fully loaded do not need to complete loading, and therefore do not need to complete the request/download. This results in the tiles currently in the map's camera/viewport being loaded faster, as the tiles loaded whilst panning, zooming, or rotating are pruned, freeing up HTTP connections. It may also result in a reduction of costs, as there are less full tile requests to your tile server, but this will depend on their backend configuration and how quickly the tile is pruned. | ||
Although HTTP request abortion is supported on all platforms, it is especially useful on the web - and therefore recommended for web apps. This is because the web platform has a limited number of simulatous HTTP requests, and so closing the requests allows new requests to be made for new tiles. | ||
On other platforms, the other benefits may still occur, but may not be as visible as on the web. | ||
|
||
Note that these advantages only occur on the web, as only the web supports the abortion of HTTP requests. On other platforms, this acts equivalent to `NetworkTileProvider`, except using 'dio' instead of 'http'. | ||
Once HTTP request abortion is [added to Dart's 'native' 'http' package (which already has a PR opened)](https://github.com/dart-lang/http/issues/424), `NetworkTileProvider` will be updated to take advantage of it, replacing and deprecating this provider. This tile provider is currently a separate package and not the default due to the reliance on the additional Dio dependency. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters