Skip to content

Commit

Permalink
Multiple Improvements & v5 Release Preparation (#1532)
Browse files Browse the repository at this point in the history
* 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 <3683599+rorystephenson@users.noreply.github.com>

* Fixed regression in commit 2764747 where internal `MapController` state was not continuous

* Added `rotateAroundPoint` - resolves #1460

Co-Authored-By: 6y <tlserver@yahoo.com>

* 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 <3683599+rorystephenson@users.noreply.github.com>
Co-authored-by: 6y <tlserver@yahoo.com>
  • Loading branch information
3 people authored Jun 4, 2023
1 parent d8e52ac commit 79b54e4
Show file tree
Hide file tree
Showing 79 changed files with 1,614 additions and 2,130 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build-io.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Java 17 Environment
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: Setup Flutter Environment
uses: subosito/flutter-action@v2
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: PR CI/CD
name: Branch Push & PR CI/CD
on:
push:
branches:
- '!master'
pull_request:
workflow_dispatch:

Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Publish To pub.dev

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

jobs:
publish:
name: "Publish"
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
environment: 'pub.dev'
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Push CI/CD
name: Master Push CI/CD
on:
push:
branches:
Expand Down
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,60 @@
# Changelog

## [5.0.0] - 2023/06/XX

**"Dart The Third"**

Contains the following API changes:

- 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)
- 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)
- Added `MapController.rotateAroundPoint` method - [#1532](https://github.com/fleaflet/flutter_map/pull/1532) for [#1460](https://github.com/fleaflet/flutter_map/issues/1460)
- Added `TileLayer.fallbackUrl` support to `FileTileProvider` - [#1532](https://github.com/fleaflet/flutter_map/pull/1532)
- Added more position options to `AnchorAlign` - [#1532](https://github.com/fleaflet/flutter_map/pull/1532)
- Improved `MarkerLayer`/`Layer` interoperability - [#1532](https://github.com/fleaflet/flutter_map/pull/1532)
- Improved response/emission time of `onTap`/`MapEventTap` when `InteractiveFlag.doubleTapZoom` is disabled - [#1532](https://github.com/fleaflet/flutter_map/pull/1532)
- Improved (stricter) typing of `CustomPoint` - [#1515](https://github.com/fleaflet/flutter_map/pull/1515)
- Deprecated `TileUpdateTransformers.alwaysLoadAndPrune` in favour of `ignoreTapEvents` - [#1517](https://github.com/fleaflet/flutter_map/pull/1517)
- Deprecated `AnchorAlign.none` in favour of `AnchorAlign.center` or `null` - [#1532](https://github.com/fleaflet/flutter_map/pull/1532)
- Removed `NetworkNoRetryTileProvider` in favour of custom `NetworkTileProvider.httpClient` - [#1512](https://github.com/fleaflet/flutter_map/pull/1512)
- Removed `FileTileProvider` fallback to `NetworkTileProvider` on web - [#1512](https://github.com/fleaflet/flutter_map/pull/1512)
- Removed `saveLayers` property from `PolylineLayer` - [#1532](https://github.com/fleaflet/flutter_map/pull/1532) & [#1519](https://github.com/fleaflet/flutter_map/pull/1519)
- Updated dependencies - [#1530](https://github.com/fleaflet/flutter_map/pull/1530)
- Updated 'latlong2' to access `const` `LatLng` objects
- Updated 'http'
- Removed 'tuple' in favour of built-in `Record`s ([#1517](https://github.com/fleaflet/flutter_map/pull/1517))

Contains the following bug fixes:

- 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)
- 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)
- 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)
- Removed potential for jitter/frame delay when painting `Polyline`s & `Polygon`s - [#1514](https://github.com/fleaflet/flutter_map/pull/1514)
- 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)

Contains the following performance improvements:

- Reduced unnecessary rebuilding in environments where `MediaQuery` changes frequently - [#1523](https://github.com/fleaflet/flutter_map/pull/1523)
- 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)
- Improved performance of `TileProvider`s and `FlutterMapNetworkImageProvider` - [#1512](https://github.com/fleaflet/flutter_map/pull/1512)

In other news:

- 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.
- 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).
- 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.

Many thanks to these contributors (in no particular order):

- @josxha
- @ignatz
- @rorystephenson
- @tlserver
- @JosefWN
- ... and all the maintainers

And an additional special thanks to @josxha & @ignatz for investing so much of their time into this project recently - we appreciate it!

## [4.0.0] - 2023/05/05

**"Out With The Old, In With The New"**
Expand Down
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Copyright (c) 2018-2023, the 'flutter_map' authors and maintainers
Loosely based on the original works of 'leaflet.js' (c) by Vladimir Agafonkin & CloudMade
Copyright (c) 2018-2023, the 'flutter_map' authors and maintainers, loosely based on the original works of 'leaflet.js' by Vladimir Agafonkin & CloudMade

All rights reserved.

Expand Down
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# flutter_map

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.
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.

[![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)
[![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)

---

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

Join the Discord server: <https://discord.gg/egEGeByf4q>!
Visit our [documentation website](https://docs.fleaflet.dev/), for all information about how to use this library.
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).

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

## [Documentation](https://docs.fleaflet.dev/)
> Please don't abuse the web demo! It runs on limited bandwidth and won't hold up to thousands of loads.
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.

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'!

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

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.
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!
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.
4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ if (flutterRoot == null) {

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '4'
flutterVersionCode = '5'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '4.0.0'
flutterVersionName = '5.0.0'
}

apply plugin: 'com.android.application'
Expand Down
34 changes: 11 additions & 23 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,15 @@ import 'package:flutter_map_example/pages/custom_crs/custom_crs.dart';
import 'package:flutter_map_example/pages/epsg3413_crs.dart';
import 'package:flutter_map_example/pages/epsg4326_crs.dart';
import 'package:flutter_map_example/pages/fallback_url_network_page.dart';
import 'package:flutter_map_example/pages/fallback_url_offline_page.dart';
import 'package:flutter_map_example/pages/home.dart';
import 'package:flutter_map_example/pages/interactive_test_page.dart';
import 'package:flutter_map_example/pages/latlng_to_screen_point.dart';
import 'package:flutter_map_example/pages/live_location.dart';
import 'package:flutter_map_example/pages/many_markers.dart';
import 'package:flutter_map_example/pages/map_controller.dart';
import 'package:flutter_map_example/pages/map_inside_listview.dart';
import 'package:flutter_map_example/pages/marker_anchor.dart';
import 'package:flutter_map_example/pages/marker_rotate.dart';
import 'package:flutter_map_example/pages/max_bounds.dart';
import 'package:flutter_map_example/pages/markers.dart';
import 'package:flutter_map_example/pages/moving_markers.dart';
import 'package:flutter_map_example/pages/network_tile_provider.dart';
import 'package:flutter_map_example/pages/offline_map.dart';
import 'package:flutter_map_example/pages/on_tap.dart';
import 'package:flutter_map_example/pages/overlay_image.dart';
import 'package:flutter_map_example/pages/plugin_scalebar.dart';
import 'package:flutter_map_example/pages/plugin_zoombuttons.dart';
Expand All @@ -31,47 +25,44 @@ import 'package:flutter_map_example/pages/reset_tile_layer.dart';
import 'package:flutter_map_example/pages/secondary_tap.dart';
import 'package:flutter_map_example/pages/sliding_map.dart';
import 'package:flutter_map_example/pages/stateful_markers.dart';
import 'package:flutter_map_example/pages/tap_to_add.dart';
import 'package:flutter_map_example/pages/tile_builder_example.dart';
import 'package:flutter_map_example/pages/tile_loading_error_handle.dart';
import 'package:flutter_map_example/pages/widgets.dart';
import 'package:flutter_map_example/pages/wms_tile_layer.dart';
import 'package:url_strategy/url_strategy.dart';

void main() => runApp(const MyApp());
void main() {
setPathUrlStrategy();
runApp(const MyApp());
}

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

// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'flutter_map Demo',
theme: ThemeData.light(useMaterial3: true),
theme: ThemeData(
useMaterial3: true,
colorSchemeSeed: const Color(0xFF8dea88),
),
home: const HomePage(),
routes: <String, WidgetBuilder>{
NetworkTileProviderPage.route: (context) =>
const NetworkTileProviderPage(),
WidgetsPage.route: (context) => const WidgetsPage(),
TapToAddPage.route: (context) => const TapToAddPage(),
PolylinePage.route: (context) => const PolylinePage(),
MapControllerPage.route: (context) => const MapControllerPage(),
AnimatedMapControllerPage.route: (context) =>
const AnimatedMapControllerPage(),
MarkerAnchorPage.route: (context) => const MarkerAnchorPage(),
MarkerPage.route: (context) => const MarkerPage(),
PluginScaleBar.route: (context) => const PluginScaleBar(),
PluginZoomButtons.route: (context) => const PluginZoomButtons(),
OfflineMapPage.route: (context) => const OfflineMapPage(),
OnTapPage.route: (context) => const OnTapPage(),
MarkerRotatePage.route: (context) => const MarkerRotatePage(),
MovingMarkersPage.route: (context) => const MovingMarkersPage(),
CirclePage.route: (context) => const CirclePage(),
OverlayImagePage.route: (context) => const OverlayImagePage(),
PolygonPage.route: (context) => const PolygonPage(),
SlidingMapPage.route: (_) => const SlidingMapPage(),
WMSLayerPage.route: (context) => const WMSLayerPage(),
CustomCrsPage.route: (context) => const CustomCrsPage(),
LiveLocationPage.route: (context) => const LiveLocationPage(),
TileLoadingErrorHandle.route: (context) =>
const TileLoadingErrorHandle(),
TileBuilderPage.route: (context) => const TileBuilderPage(),
Expand All @@ -82,14 +73,11 @@ class MyApp extends StatelessWidget {
ResetTileLayerPage.route: (context) => const ResetTileLayerPage(),
EPSG4326Page.route: (context) => const EPSG4326Page(),
EPSG3413Page.route: (context) => const EPSG3413Page(),
MaxBoundsPage.route: (context) => const MaxBoundsPage(),
PointToLatLngPage.route: (context) => const PointToLatLngPage(),
LatLngScreenPointTestPage.route: (context) =>
const LatLngScreenPointTestPage(),
FallbackUrlNetworkPage.route: (context) =>
const FallbackUrlNetworkPage(),
FallbackUrlOfflinePage.route: (context) =>
const FallbackUrlOfflinePage(),
SecondaryTapPage.route: (context) => const SecondaryTapPage(),
},
);
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion example/lib/pages/fallback_url_network_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_example/pages/fallback_url/fallback_url.dart';
import 'package:flutter_map_example/pages/fallback_url.dart';
import 'package:latlong2/latlong.dart';

class FallbackUrlNetworkPage extends StatelessWidget {
Expand Down
29 changes: 0 additions & 29 deletions example/lib/pages/fallback_url_offline_page.dart

This file was deleted.

Loading

0 comments on commit 79b54e4

Please sign in to comment.