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

Fix EPSG4326 parameter difference with Leaflet.js #1135

Merged
merged 4 commits into from
Apr 10, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_map_example/pages/epsg4326_crs.dart';
import 'package:flutter_map_example/pages/map_inside_listview.dart';
import 'package:flutter_map_example/pages/network_tile_provider.dart';

Expand Down Expand Up @@ -75,7 +76,8 @@ class MyApp extends StatelessWidget {
StatefulMarkersPage.route: (context) => StatefulMarkersPage(),
MapInsideListViewPage.route: (context) => MapInsideListViewPage(),
ResetTileLayerPage.route: (context) => ResetTileLayerPage(),
MaxBoundsPage.route: (context) => MaxBoundsPage()
EPSG4326Page.route: (context) => EPSG4326Page(),
MaxBoundsPage.route: (context) => MaxBoundsPage(),
},
);
}
Expand Down
47 changes: 47 additions & 0 deletions example/lib/pages/epsg4326_crs.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart';

import '../widgets/drawer.dart';

class EPSG4326Page extends StatelessWidget {
static const String route = 'EPSG4326 Page';

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('EPSG4326')),
drawer: buildDrawer(context, route),
body: Padding(
padding: EdgeInsets.all(8.0),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(top: 8.0, bottom: 8.0),
child: Text('This is a map that is showing (42.58, 12.43).'),
),
Flexible(
child: FlutterMap(
options: MapOptions(
minZoom: 0,
crs: const Epsg4326(),
center: LatLng(0, 0),
zoom: 0.0,
),
layers: [
TileLayerOptions(
wmsOptions: WMSTileLayerOptions(
crs: const Epsg4326(),
baseUrl: 'http://ows.mundialis.de/services/service?',
layers: ['TOPO-OSM-WMS'],
),
)
],
),
),
],
),
),
);
}
}
8 changes: 8 additions & 0 deletions example/lib/widgets/drawer.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_map_example/pages/epsg4326_crs.dart';
import 'package:flutter_map_example/pages/map_inside_listview.dart';
import 'package:flutter_map_example/pages/marker_rotate.dart';
import 'package:flutter_map_example/pages/network_tile_provider.dart';
Expand Down Expand Up @@ -234,6 +235,13 @@ Drawer buildDrawer(BuildContext context, String currentRoute) {
Navigator.pushReplacementNamed(context, ResetTileLayerPage.route);
},
),
ListTile(
title: const Text('EPSG4326 Crs'),
selected: currentRoute == EPSG4326Page.route,
onTap: () {
Navigator.pushReplacementNamed(context, EPSG4326Page.route);
},
),
_buildMenuItem(
context,
const Text('Stateful markers'),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/geo/crs/crs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class Epsg4326 extends Earth {

const Epsg4326()
: projection = const _LonLat(),
transformation = const Transformation(1 / 180, 0.5, -1 / 180, 0.5),
transformation = const Transformation(1 / 180, 1, -1 / 180, 0.5),
super();
}

Expand Down