Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ linter:
flutter_style_todos: false
cascade_invocations: false
sort_pub_dependencies: false
deprecated_member_use_from_same_package: false
deprecated_member_use_from_same_package: false
discarded_futures: false
2 changes: 0 additions & 2 deletions example/lib/flutter_map_cache/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ class _FlutterMapCachePageState extends State<FlutterMapCachePage> {
),
if (!kIsWeb)
FutureBuilder<Directory>(
// future does not get discarded
// ignore: discarded_futures
future: getTemporaryDirectory(), // not available on web
builder: (context, snapshot) {
if (snapshot.hasData) {
Expand Down
4 changes: 2 additions & 2 deletions example/lib/flutter_map_maplibre/page2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class _FlutterMapMapLibrePageState extends State<FlutterMapMapLibrePage> {
),
body: MapLibreMap(
onMapCreated: (controller) => _controller = controller,
options: MapOptions(
initCenter: Position(0, 0),
options: const MapOptions(
initCenter: Geographic(lon: 0, lat: 0),
initZoom: 3,
maxPitch: 0, // flutter_map doesn't support pitch, disable it here
initStyle:
Expand Down
3 changes: 2 additions & 1 deletion example/lib/flutter_map_pmtiles/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const String tileSource =
'https://raw.githubusercontent.com/protomaps/PMTiles/main/spec/v3/stamen_toner(raster)CC-BY%2BODbL_z3.pmtiles';

class _FlutterMapPmTilesPageState extends State<FlutterMapPmTilesPage> {
final _futureTileProvider = PmTilesTileProvider.fromSource(tileSource);
final Future<PmTilesTileProvider> _futureTileProvider =
PmTilesTileProvider.fromSource(tileSource);

@override
Widget build(BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/vector_map_tiles_mbtiles/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class _VectorMapTilesMbTilesPageState extends State<VectorMapTilesMbTilesPage> {
final Future<MbTiles> _futureMbtiles = _initMbTiles();
MbTiles? _mbtiles;

final _theme = vtr.ProvidedThemes.lightTheme();
final vtr.Theme _theme = vtr.ProvidedThemes.lightTheme();

static Future<MbTiles> _initMbTiles() async {
// This function copies an asset file from the asset bundle to the temporary
Expand Down
3 changes: 2 additions & 1 deletion example/lib/vector_map_tiles_pmtiles/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class VectorMapTilesPmTilesPage extends StatelessWidget {
logger: kDebugMode ? const vtr.Logger.console() : null,
);

final _futureTileProvider = PmTilesVectorTileProvider.fromSource(tileSource);
final Future<PmTilesVectorTileProvider> _futureTileProvider =
PmTilesVectorTileProvider.fromSource(tileSource);

@override
Widget build(BuildContext context) {
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
sdk: flutter
latlong2: ^0.9.0
url_launcher: ^6.2.4
connectivity_plus: ^6.0.0
connectivity_plus: ^7.0.0
path_provider: ^2.0.15
dio: ^5.2.0+1
dio_cache_interceptor: ^4.0.0
Expand All @@ -26,7 +26,7 @@ dependencies:
vector_map_tiles: ^9.0.0-beta.8
vector_tile_renderer: ^6.0.0
mbtiles: ^0.4.0
maplibre: ^0.2.0
maplibre: ^0.3.0

flutter_map_cache:
path: ../flutter_map_cache
Expand All @@ -44,7 +44,7 @@ dependencies:
path: ../vector_map_tiles_pmtiles

dev_dependencies:
very_good_analysis: ^7.0.0
very_good_analysis: ^10.0.0

flutter:
uses-material-design: true
Expand Down
1 change: 0 additions & 1 deletion flutter_map_cache/lib/src/cached_image_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class CachedImageProvider extends ImageProvider<CachedImageProvider> {
final chunkEvents = StreamController<ImageChunkEvent>();

return MultiFrameImageStreamCompleter(
// ignore: discarded_futures, not actually but the lint thinks so
codec: loadAsync(key, chunkEvents, decode),
chunkEvents: chunkEvents.stream,
scale: 1,
Expand Down
2 changes: 1 addition & 1 deletion flutter_map_cache/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ dev_dependencies:
http_mock_adapter: ^0.6.1
latlong2: ^0.9.0
test: ^1.24.9
very_good_analysis: ^7.0.0
very_good_analysis: ^10.0.0
2 changes: 1 addition & 1 deletion flutter_map_compass/lib/src/utils.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'dart:math';

/// Saved calculation
const deg2Rad = pi / 180.0;
const double deg2Rad = pi / 180.0;
2 changes: 1 addition & 1 deletion flutter_map_compass/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ dev_dependencies:
sdk: flutter
latlong2: ^0.9.0
test: ^1.24.9
very_good_analysis: ^7.0.0
very_good_analysis: ^10.0.0
4 changes: 4 additions & 0 deletions flutter_map_maplibre/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.5

- Update `maplibre` to `^0.3.0`

## 0.0.4

- Update docs
Expand Down
12 changes: 6 additions & 6 deletions flutter_map_maplibre/lib/src/extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import 'package:flutter_map/flutter_map.dart' as fm;
import 'package:latlong2/latlong.dart';
import 'package:maplibre/maplibre.dart';

/// Extension methods on [Position];
extension PositionExt on Position {
/// Convert [Position] to [LatLng].
LatLng toLatLng() => LatLng(lat.toDouble(), lng.toDouble());
/// Extension methods on [Geographic];
extension PositionExt on Geographic {
/// Convert [Geographic] to [LatLng].
LatLng toLatLng() => LatLng(lat, lon);
}

/// Extension methods on [LatLng];
extension LatLngExt on LatLng {
/// Convert [LatLng] to [Position].
Position toPosition() => Position(longitude, latitude);
/// Convert [LatLng] to [Geographic].
Geographic toPosition() => Geographic(lon: longitude, lat: latitude);
}

/// Extension methods on [MapController];
Expand Down
6 changes: 3 additions & 3 deletions flutter_map_maplibre/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_map_maplibre
description: "Performant Mapbox Vector Tiles (MVT) support for flutter_map powered by native MapLibre SDKs."
version: 0.0.4
version: 0.0.5
topics: [ flutter-map, map, vector, maplibre, mvt ]
repository: https://github.com/josxha/flutter_map_plugins
issue_tracker: https://github.com/josxha/flutter_map_plugins/issues
Expand All @@ -18,9 +18,9 @@ dependencies:
sdk: flutter
flutter_map: ^8.0.0
latlong2: ^0.9.1
maplibre: ^0.2.1
maplibre: ^0.3.0

dev_dependencies:
flutter_test:
sdk: flutter
very_good_analysis: ^7.0.0
very_good_analysis: ^10.0.0
1 change: 0 additions & 1 deletion flutter_map_mbtiles/lib/src/mbtiles_image_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class MbTilesImageProvider extends ImageProvider<MbTilesImageProvider> {
final chunkEvents = StreamController<ImageChunkEvent>();

return MultiFrameImageStreamCompleter(
// ignore: discarded_futures, not actually but the lint thinks so
codec: _loadAsync(key, chunkEvents, decode),
chunkEvents: chunkEvents.stream,
scale: 1,
Expand Down
2 changes: 1 addition & 1 deletion flutter_map_mbtiles/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ dev_dependencies:
latlong2: ^0.9.0
mockito: ^5.4.4
test: ^1.24.9
very_good_analysis: ^7.0.0
very_good_analysis: ^10.0.0
1 change: 0 additions & 1 deletion flutter_map_pmtiles/lib/src/pmtiles_image_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class PmTilesImageProvider extends ImageProvider<PmTilesImageProvider> {
final chunkEvents = StreamController<ImageChunkEvent>();

return MultiFrameImageStreamCompleter(
// ignore: discarded_futures, not actually but the lint thinks so
codec: _loadAsync(key, chunkEvents, decode),
chunkEvents: chunkEvents.stream,
scale: 1,
Expand Down
2 changes: 1 addition & 1 deletion flutter_map_pmtiles/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ dev_dependencies:
mockito: ^5.4.4
build_runner: ^2.4.8
latlong2: ^0.9.0
very_good_analysis: ^7.0.0
very_good_analysis: ^10.0.0
2 changes: 1 addition & 1 deletion vector_map_tiles_mbtiles/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ dev_dependencies:
build_runner: ^2.4.8
latlong2: ^0.9.0
flutter_map: ^8.0.0
very_good_analysis: ^7.0.0
very_good_analysis: ^10.0.0
vector_tile_renderer: ^6.0.0
3 changes: 0 additions & 3 deletions vector_map_tiles_pmtiles/lib/src/themes/v3/_package.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Altering format because it got pasted from json.
// ignore_for_file: prefer_single_quotes, require_trailing_commas

part 'black.dart';
part 'dark.dart';
part 'grayscale.dart';
Expand Down
2 changes: 1 addition & 1 deletion vector_map_tiles_pmtiles/lib/src/themes/v3/black.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part of '_package.dart';
// ignore_for_file: prefer_single_quotes, require_trailing_commas

/// https://docs.protomaps.com/basemaps/themes#black
const themeBlack = [
const themeBlack = <Map<String, Object>>[
{
"id": "background",
"type": "background",
Expand Down
2 changes: 1 addition & 1 deletion vector_map_tiles_pmtiles/lib/src/themes/v3/dark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part of '_package.dart';
// ignore_for_file: prefer_single_quotes, require_trailing_commas

/// https://docs.protomaps.com/basemaps/themes#dark
const themeDark = [
const themeDark = <Map<String, Object>>[
{
"id": "background",
"type": "background",
Expand Down
2 changes: 1 addition & 1 deletion vector_map_tiles_pmtiles/lib/src/themes/v3/grayscale.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part of '_package.dart';
// ignore_for_file: prefer_single_quotes, require_trailing_commas

/// https://docs.protomaps.com/basemaps/themes#grayscale
const themeGrayscale = [
const themeGrayscale = <Map<String, Object>>[
{
"id": "background",
"type": "background",
Expand Down
2 changes: 1 addition & 1 deletion vector_map_tiles_pmtiles/lib/src/themes/v3/light.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part of '_package.dart';
// ignore_for_file: prefer_single_quotes, require_trailing_commas

/// https://docs.protomaps.com/basemaps/themes#light
const themeLight = [
const themeLight = <Map<String, Object>>[
{
"id": "background",
"type": "background",
Expand Down
2 changes: 1 addition & 1 deletion vector_map_tiles_pmtiles/lib/src/themes/v3/white.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part of '_package.dart';
// ignore_for_file: prefer_single_quotes, require_trailing_commas

/// https://docs.protomaps.com/basemaps/themes#white
const themeWhite = [
const themeWhite = <Map<String, Object>>[
{
"id": "background",
"type": "background",
Expand Down
7 changes: 4 additions & 3 deletions vector_map_tiles_pmtiles/lib/src/themes/v4/_package.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Keep the original format.
// ignore_for_file: prefer_single_quotes, require_trailing_commas

part 'black.dart';

part 'dark.dart';

part 'grayscale.dart';

part 'light.dart';

part 'white.dart';
2 changes: 1 addition & 1 deletion vector_map_tiles_pmtiles/lib/src/themes/v4/black.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part of '_package.dart';
// ignore_for_file: prefer_single_quotes, require_trailing_commas

/// https://docs.protomaps.com/basemaps/themes#black
const themeBlack = [
const themeBlack = <Map<String, Object>>[
{
"id": "background",
"type": "background",
Expand Down
2 changes: 1 addition & 1 deletion vector_map_tiles_pmtiles/lib/src/themes/v4/dark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part of '_package.dart';
// ignore_for_file: prefer_single_quotes, require_trailing_commas

/// https://docs.protomaps.com/basemaps/themes#dark
const themeDark = [
const themeDark = <Map<String, Object>>[
{
"id": "background",
"type": "background",
Expand Down
2 changes: 1 addition & 1 deletion vector_map_tiles_pmtiles/lib/src/themes/v4/grayscale.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part of '_package.dart';
// ignore_for_file: prefer_single_quotes, require_trailing_commas

/// https://docs.protomaps.com/basemaps/themes#grayscale
const themeGrayscale = [
const themeGrayscale = <Map<String, Object>>[
{
"id": "background",
"type": "background",
Expand Down
2 changes: 1 addition & 1 deletion vector_map_tiles_pmtiles/lib/src/themes/v4/light.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part of '_package.dart';
// ignore_for_file: prefer_single_quotes, require_trailing_commas

/// https://docs.protomaps.com/basemaps/themes#light
const themeLight = [
const themeLight = <Map<String, Object>>[
{
"id": "background",
"type": "background",
Expand Down
2 changes: 1 addition & 1 deletion vector_map_tiles_pmtiles/lib/src/themes/v4/white.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part of '_package.dart';
// ignore_for_file: prefer_single_quotes, require_trailing_commas

/// https://docs.protomaps.com/basemaps/themes#white
const themeWhite = [
const themeWhite = <Map<String, Object>>[
{
"id": "background",
"type": "background",
Expand Down
2 changes: 1 addition & 1 deletion vector_map_tiles_pmtiles/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ dev_dependencies:
latlong2: ^0.9.0
mockito: ^5.4.4
test: ^1.24.9
very_good_analysis: ^7.0.0
very_good_analysis: ^10.0.0
Loading