Skip to content

Commit 79b54e4

Browse files
JaffaKetchuprorystephensontlserver
authored
Multiple Improvements & v5 Release Preparation (#1532)
* Multiple changes, see PR body * Updated CHANGELOG * Added `offset` option to `FlutterMapState.move` and related methods (resolves #1460, #777, #952) Major refactoring and re-organization to improve understandibility * Updated CHANGELOG * Ensure `id` of `MapController.move` is passed through to the emitted `MapEventMove` Originally from #1534 (3eca34e) - thanks @rorystephenson! Co-Authored-By: Rory Stephenson <[email protected]> * Fixed regression in commit 2764747 where internal `MapController` state was not continuous * Added `rotateAroundPoint` - resolves #1460 Co-Authored-By: 6y <[email protected]> * Updated CHANGELOG * Added `TileLayer.fallbackUrl` support to `FileTileProvider` Improved performance of `AssetTileProvider` when `TileLayer.fallbackUrl` not specified (resolves #1436) Improved documentation about performance pitfalls of `TileLayer.fallbackUrl` * Updated CHANGELOG * Updated pubspec.yaml Updated CHANGELOG * Removed `saveLayers` property from `PolylineLayer` * Updated CHANGELOG * Updated MacOS configuration Removed unnecessary Java installation from Windows GitHub Actions builder * Added more position options to `AnchorAlign` Deprecated `AnchorAlign.none` in favour of `AnchorAlign.center` or `null` Improved response/emission time of `onTap`/`MapEventTap` when `InteractiveFlag.doubleTapZoom` is disabled Improved `MarkerLayer`/`Layer` interoperability Improved/reorganized example application Updated CHANGELOG * Simplified `Anchor` Improved documentation of marker anchor methods Improved CHANGELOG * Updated version numbers * Fixed bug in example application * Added automated publishing action for tags in format 'v_._._' * Updated CHANGELOG * Added credit to CHANGELOG --------- Co-authored-by: Rory Stephenson <[email protected]> Co-authored-by: 6y <[email protected]>
1 parent d8e52ac commit 79b54e4

File tree

79 files changed

+1614
-2130
lines changed

Some content is hidden

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

79 files changed

+1614
-2130
lines changed

.github/workflows/build-io.yml

-5
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ jobs:
3939
steps:
4040
- name: Checkout Repository
4141
uses: actions/checkout@v3
42-
- name: Setup Java 17 Environment
43-
uses: actions/setup-java@v3
44-
with:
45-
distribution: "temurin"
46-
java-version: "17"
4742
- name: Setup Flutter Environment
4843
uses: subosito/flutter-action@v2
4944
with:

.github/workflows/pr.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
name: PR CI/CD
1+
name: Branch Push & PR CI/CD
22
on:
3+
push:
4+
branches:
5+
- '!master'
36
pull_request:
47
workflow_dispatch:
58

.github/workflows/publish.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Publish To pub.dev
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
7+
8+
jobs:
9+
publish:
10+
name: "Publish"
11+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
12+
with:
13+
environment: 'pub.dev'

.github/workflows/push.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Push CI/CD
1+
name: Master Push CI/CD
22
on:
33
push:
44
branches:

CHANGELOG.md

+55
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,60 @@
11
# Changelog
22

3+
## [5.0.0] - 2023/06/XX
4+
5+
**"Dart The Third"**
6+
7+
Contains the following API changes:
8+
9+
- Migrated to Flutter 3.10 and Dart 3.0 minimums - [#1512](https://github.com/fleaflet/flutter_map/pull/1512) & [#1517](https://github.com/fleaflet/flutter_map/pull/1517)
10+
- Added offset capability to `FlutterMapState.move`/`MapController.move` methods - [#1532](https://github.com/fleaflet/flutter_map/pull/1532) for [#952](https://github.com/fleaflet/flutter_map/issues/952)
11+
- Added `MapController.rotateAroundPoint` method - [#1532](https://github.com/fleaflet/flutter_map/pull/1532) for [#1460](https://github.com/fleaflet/flutter_map/issues/1460)
12+
- Added `TileLayer.fallbackUrl` support to `FileTileProvider` - [#1532](https://github.com/fleaflet/flutter_map/pull/1532)
13+
- Added more position options to `AnchorAlign` - [#1532](https://github.com/fleaflet/flutter_map/pull/1532)
14+
- Improved `MarkerLayer`/`Layer` interoperability - [#1532](https://github.com/fleaflet/flutter_map/pull/1532)
15+
- Improved response/emission time of `onTap`/`MapEventTap` when `InteractiveFlag.doubleTapZoom` is disabled - [#1532](https://github.com/fleaflet/flutter_map/pull/1532)
16+
- Improved (stricter) typing of `CustomPoint` - [#1515](https://github.com/fleaflet/flutter_map/pull/1515)
17+
- Deprecated `TileUpdateTransformers.alwaysLoadAndPrune` in favour of `ignoreTapEvents` - [#1517](https://github.com/fleaflet/flutter_map/pull/1517)
18+
- Deprecated `AnchorAlign.none` in favour of `AnchorAlign.center` or `null` - [#1532](https://github.com/fleaflet/flutter_map/pull/1532)
19+
- Removed `NetworkNoRetryTileProvider` in favour of custom `NetworkTileProvider.httpClient` - [#1512](https://github.com/fleaflet/flutter_map/pull/1512)
20+
- Removed `FileTileProvider` fallback to `NetworkTileProvider` on web - [#1512](https://github.com/fleaflet/flutter_map/pull/1512)
21+
- Removed `saveLayers` property from `PolylineLayer` - [#1532](https://github.com/fleaflet/flutter_map/pull/1532) & [#1519](https://github.com/fleaflet/flutter_map/pull/1519)
22+
- Updated dependencies - [#1530](https://github.com/fleaflet/flutter_map/pull/1530)
23+
- Updated 'latlong2' to access `const` `LatLng` objects
24+
- Updated 'http'
25+
- Removed 'tuple' in favour of built-in `Record`s ([#1517](https://github.com/fleaflet/flutter_map/pull/1517))
26+
27+
Contains the following bug fixes:
28+
29+
- Polylines with translucent fills and borders now paint properly - [#1519](https://github.com/fleaflet/flutter_map/pull/1519) for [#1510](https://github.com/fleaflet/flutter_map/issues/1510) & [#1420](https://github.com/fleaflet/flutter_map/issues/1420)
30+
- Ensure `id` of `MapController.move` is passed through to the emitted `MapEventMove` - [#1534](https://github.com/fleaflet/flutter_map/pull/1534) in [#1532](https://github.com/fleaflet/flutter_map/pull/1532) for [#1542](https://github.com/fleaflet/flutter_map/issues/1542)
31+
- Fixed MacOS pinch zoom gesture issue - [#1543](https://github.com/fleaflet/flutter_map/pull/1543) for part of [#1354](https://github.com/fleaflet/flutter_map/issues/1354)
32+
- Removed potential for jitter/frame delay when painting `Polyline`s & `Polygon`s - [#1514](https://github.com/fleaflet/flutter_map/pull/1514)
33+
- Removed potential for un-`mounted` `setState` call in `RichAttributionWidget` - [#1532](https://github.com/fleaflet/flutter_map/pull/1532) for [#1538](https://github.com/fleaflet/flutter_map/issues/1538)
34+
35+
Contains the following performance improvements:
36+
37+
- Reduced unnecessary rebuilding in environments where `MediaQuery` changes frequently - [#1523](https://github.com/fleaflet/flutter_map/pull/1523)
38+
- Use Flutter's default `CachingAssetBundle` in `AssetTileProvider` when `TileLayer.fallbackUrl` is not specified - [#1532](https://github.com/fleaflet/flutter_map/pull/1532) for [#1436](https://github.com/fleaflet/flutter_map/issues/1436)
39+
- Improved performance of `TileProvider`s and `FlutterMapNetworkImageProvider` - [#1512](https://github.com/fleaflet/flutter_map/pull/1512)
40+
41+
In other news:
42+
43+
- You may have noticed some minor rebranding around the repo recently! The maintainers have finally gained full member access from the previous owner (thanks John :)) to the 'fleaflet' organisation and now have total control.
44+
- We've launched a Live Web Demo so you can experiment with flutter_map on the web without having to install any apps or build from source yourself! Visit [demo.fleaflet.dev](https://demo.fleaflet.dev).
45+
- We've made some big changes to the structure/organization of flutter_map internals, which we hope should make it easier for new contributors to add code due to the reduction of the scope of responsibility of each source file.
46+
47+
Many thanks to these contributors (in no particular order):
48+
49+
- @josxha
50+
- @ignatz
51+
- @rorystephenson
52+
- @tlserver
53+
- @JosefWN
54+
- ... and all the maintainers
55+
56+
And an additional special thanks to @josxha & @ignatz for investing so much of their time into this project recently - we appreciate it!
57+
358
## [4.0.0] - 2023/05/05
459

560
**"Out With The Old, In With The New"**

LICENSE

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Copyright (c) 2018-2023, the 'flutter_map' authors and maintainers
2-
Loosely based on the original works of 'leaflet.js' (c) by Vladimir Agafonkin & CloudMade
1+
Copyright (c) 2018-2023, the 'flutter_map' authors and maintainers, loosely based on the original works of 'leaflet.js' by Vladimir Agafonkin & CloudMade
32

43
All rights reserved.
54

README.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
# flutter_map
22

3-
A versatile mapping package for Flutter, based off of ['leaflet.js'](https://leafletjs.com/). Simple and easy to learn, yet completely customizable and configurable, it's the best choice for mapping in your Flutter app.
3+
A versatile mapping package for Flutter. Simple and easy to learn, yet completely customizable and configurable, it's the best choice for mapping in your Flutter app.
44

55
[![Pub.dev](https://img.shields.io/pub/v/flutter_map.svg?label=Latest+Version)](https://pub.dev/packages/flutter_map) [![Checks & Tests](https://badgen.net/github/checks/fleaflet/flutter_map?label=Checks+%26+Tests&color=orange)](https://github.com/fleaflet/flutter_map/actions?query=branch%3Amaster) [![points](https://img.shields.io/pub/points/flutter_map?logo=flutter)](https://pub.dev/packages/flutter_map/score)
66
[![stars](https://badgen.net/github/stars/fleaflet/flutter_map?label=stars&color=green&icon=github)](https://github.com/fleaflet/flutter_map/stargazers) [![likes](https://img.shields.io/pub/likes/flutter_map?logo=flutter)](https://pub.dev/packages/flutter_map/score)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![Open Issues](https://badgen.net/github/open-issues/fleaflet/flutter_map?label=Open+Issues&color=green)](https://GitHub.com/fleaflet/flutter_map/issues) [![Open PRs](https://badgen.net/github/open-prs/fleaflet/flutter_map?label=Open+PRs&color=green)](https://GitHub.com/fleaflet/flutter_map/pulls)
77

88
---
99

10-
## [Discord Server](https://discord.gg/egEGeByf4q)
10+
## [Documentation](https://docs.fleaflet.dev/)
1111

12-
Join the Discord server: <https://discord.gg/egEGeByf4q>!
12+
Visit our [documentation website](https://docs.fleaflet.dev/), for all information about how to use this library.
13+
Additional documentation can be found in-code/whilst you type and over at the [pub.dev package](https://pub.dev/documentation/flutter_map/latest/flutter_map/flutter_map-library.html).
1314

14-
Talk about 'flutter_map', get and give help, and receive notifications about new 'flutter_map' updates! More additions planned in the future.
15+
## [Live Web Demo](https://demo.fleaflet.dev/)
1516

16-
## [Documentation](https://docs.fleaflet.dev/)
17+
> Please don't abuse the web demo! It runs on limited bandwidth and won't hold up to thousands of loads.
18+
If you're going to be straining the application, please see the [Examples page in the docs](https://docs.fleaflet.dev/getting-started/examples), for information about building/using the application locally.
19+
20+
Want to see how flutter_map looks and works quickly? Just visit our [demo site](https://demo.fleaflet.dev/) that gets updated automatically with every new commit to 'master'!
1721

18-
Visit the [documentation website here](https://docs.fleaflet.dev/), for all information about how to use this library, including setup and usage instructions.
22+
## [Get Help](https://docs.fleaflet.dev/#get-help)
1923

20-
Some documentation is also provided within the code and can be view inside your favourite editor. These docs are also over at the [pub.dev package](https://pub.dev/documentation/flutter_map/latest/flutter_map/flutter_map-library.html), and can be viewed from within your favourite editor.
24+
Not sure about how to do something, or just want to chat? Pop over to our [Discord server](https://discord.gg/BwpEsjqMAH) to get support quickly, and to get notified about new releases!
25+
Think you've found a bug, or would like to see a new feature? We'd love to hear about it! Please see the [Get Help section of our docs](https://docs.fleaflet.dev/#get-help) for information about what to do.

example/android/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ if (flutterRoot == null) {
1313

1414
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1515
if (flutterVersionCode == null) {
16-
flutterVersionCode = '4'
16+
flutterVersionCode = '5'
1717
}
1818

1919
def flutterVersionName = localProperties.getProperty('flutter.versionName')
2020
if (flutterVersionName == null) {
21-
flutterVersionName = '4.0.0'
21+
flutterVersionName = '5.0.0'
2222
}
2323

2424
apply plugin: 'com.android.application'

example/lib/main.dart

+11-23
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,15 @@ import 'package:flutter_map_example/pages/custom_crs/custom_crs.dart';
66
import 'package:flutter_map_example/pages/epsg3413_crs.dart';
77
import 'package:flutter_map_example/pages/epsg4326_crs.dart';
88
import 'package:flutter_map_example/pages/fallback_url_network_page.dart';
9-
import 'package:flutter_map_example/pages/fallback_url_offline_page.dart';
109
import 'package:flutter_map_example/pages/home.dart';
1110
import 'package:flutter_map_example/pages/interactive_test_page.dart';
1211
import 'package:flutter_map_example/pages/latlng_to_screen_point.dart';
13-
import 'package:flutter_map_example/pages/live_location.dart';
1412
import 'package:flutter_map_example/pages/many_markers.dart';
1513
import 'package:flutter_map_example/pages/map_controller.dart';
1614
import 'package:flutter_map_example/pages/map_inside_listview.dart';
17-
import 'package:flutter_map_example/pages/marker_anchor.dart';
18-
import 'package:flutter_map_example/pages/marker_rotate.dart';
19-
import 'package:flutter_map_example/pages/max_bounds.dart';
15+
import 'package:flutter_map_example/pages/markers.dart';
2016
import 'package:flutter_map_example/pages/moving_markers.dart';
21-
import 'package:flutter_map_example/pages/network_tile_provider.dart';
2217
import 'package:flutter_map_example/pages/offline_map.dart';
23-
import 'package:flutter_map_example/pages/on_tap.dart';
2418
import 'package:flutter_map_example/pages/overlay_image.dart';
2519
import 'package:flutter_map_example/pages/plugin_scalebar.dart';
2620
import 'package:flutter_map_example/pages/plugin_zoombuttons.dart';
@@ -31,47 +25,44 @@ import 'package:flutter_map_example/pages/reset_tile_layer.dart';
3125
import 'package:flutter_map_example/pages/secondary_tap.dart';
3226
import 'package:flutter_map_example/pages/sliding_map.dart';
3327
import 'package:flutter_map_example/pages/stateful_markers.dart';
34-
import 'package:flutter_map_example/pages/tap_to_add.dart';
3528
import 'package:flutter_map_example/pages/tile_builder_example.dart';
3629
import 'package:flutter_map_example/pages/tile_loading_error_handle.dart';
37-
import 'package:flutter_map_example/pages/widgets.dart';
3830
import 'package:flutter_map_example/pages/wms_tile_layer.dart';
31+
import 'package:url_strategy/url_strategy.dart';
3932

40-
void main() => runApp(const MyApp());
33+
void main() {
34+
setPathUrlStrategy();
35+
runApp(const MyApp());
36+
}
4137

4238
class MyApp extends StatelessWidget {
4339
const MyApp({Key? key}) : super(key: key);
4440

45-
// This widget is the root of your application.
4641
@override
4742
Widget build(BuildContext context) {
4843
return MaterialApp(
4944
title: 'flutter_map Demo',
50-
theme: ThemeData.light(useMaterial3: true),
45+
theme: ThemeData(
46+
useMaterial3: true,
47+
colorSchemeSeed: const Color(0xFF8dea88),
48+
),
5149
home: const HomePage(),
5250
routes: <String, WidgetBuilder>{
53-
NetworkTileProviderPage.route: (context) =>
54-
const NetworkTileProviderPage(),
55-
WidgetsPage.route: (context) => const WidgetsPage(),
56-
TapToAddPage.route: (context) => const TapToAddPage(),
5751
PolylinePage.route: (context) => const PolylinePage(),
5852
MapControllerPage.route: (context) => const MapControllerPage(),
5953
AnimatedMapControllerPage.route: (context) =>
6054
const AnimatedMapControllerPage(),
61-
MarkerAnchorPage.route: (context) => const MarkerAnchorPage(),
55+
MarkerPage.route: (context) => const MarkerPage(),
6256
PluginScaleBar.route: (context) => const PluginScaleBar(),
6357
PluginZoomButtons.route: (context) => const PluginZoomButtons(),
6458
OfflineMapPage.route: (context) => const OfflineMapPage(),
65-
OnTapPage.route: (context) => const OnTapPage(),
66-
MarkerRotatePage.route: (context) => const MarkerRotatePage(),
6759
MovingMarkersPage.route: (context) => const MovingMarkersPage(),
6860
CirclePage.route: (context) => const CirclePage(),
6961
OverlayImagePage.route: (context) => const OverlayImagePage(),
7062
PolygonPage.route: (context) => const PolygonPage(),
7163
SlidingMapPage.route: (_) => const SlidingMapPage(),
7264
WMSLayerPage.route: (context) => const WMSLayerPage(),
7365
CustomCrsPage.route: (context) => const CustomCrsPage(),
74-
LiveLocationPage.route: (context) => const LiveLocationPage(),
7566
TileLoadingErrorHandle.route: (context) =>
7667
const TileLoadingErrorHandle(),
7768
TileBuilderPage.route: (context) => const TileBuilderPage(),
@@ -82,14 +73,11 @@ class MyApp extends StatelessWidget {
8273
ResetTileLayerPage.route: (context) => const ResetTileLayerPage(),
8374
EPSG4326Page.route: (context) => const EPSG4326Page(),
8475
EPSG3413Page.route: (context) => const EPSG3413Page(),
85-
MaxBoundsPage.route: (context) => const MaxBoundsPage(),
8676
PointToLatLngPage.route: (context) => const PointToLatLngPage(),
8777
LatLngScreenPointTestPage.route: (context) =>
8878
const LatLngScreenPointTestPage(),
8979
FallbackUrlNetworkPage.route: (context) =>
9080
const FallbackUrlNetworkPage(),
91-
FallbackUrlOfflinePage.route: (context) =>
92-
const FallbackUrlOfflinePage(),
9381
SecondaryTapPage.route: (context) => const SecondaryTapPage(),
9482
},
9583
);

example/lib/pages/fallback_url_network_page.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_map/flutter_map.dart';
3-
import 'package:flutter_map_example/pages/fallback_url/fallback_url.dart';
3+
import 'package:flutter_map_example/pages/fallback_url.dart';
44
import 'package:latlong2/latlong.dart';
55

66
class FallbackUrlNetworkPage extends StatelessWidget {

example/lib/pages/fallback_url_offline_page.dart

-29
This file was deleted.

0 commit comments

Comments
 (0)