Skip to content

Commit f0f3bb4

Browse files
committed
Improve polar projection example
1 parent 2772595 commit f0f3bb4

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

example/lib/pages/epsg3413_crs.dart

+27-8
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class _EPSG3413PageState extends State<EPSG3413Page> {
6969
point: LatLng(90, 0),
7070
radius: 20000,
7171
useRadiusInMeter: true,
72-
color: Colors.red,
72+
color: Colors.yellow,
7373
)
7474
];
7575
for (final lon in [-90.0, 0.0, 90.0, 180.0]) {
@@ -81,6 +81,18 @@ class _EPSG3413PageState extends State<EPSG3413Page> {
8181
));
8282
}
8383

84+
// Add latitude line at 80 degrees
85+
final distancePoleToLat80 =
86+
const Distance().distance(LatLng(90, 0), LatLng(80, 0));
87+
circles.add(CircleMarker(
88+
point: LatLng(90, 0),
89+
radius: distancePoleToLat80,
90+
useRadiusInMeter: true,
91+
color: Colors.transparent,
92+
borderColor: Colors.black,
93+
borderStrokeWidth: 1.0,
94+
));
95+
8496
return Scaffold(
8597
appBar: AppBar(title: const Text('EPSG:3413 CRS')),
8698
drawer: buildDrawer(context, EPSG3413Page.route),
@@ -91,7 +103,7 @@ class _EPSG3413PageState extends State<EPSG3413Page> {
91103
const Padding(
92104
padding: EdgeInsets.only(top: 8.0, bottom: 2.0),
93105
child: Text(
94-
'This map is in EPSG:3413',
106+
'This demonstrates some tricky edge-cases with polar projections',
95107
style: TextStyle(
96108
fontWeight: FontWeight.bold,
97109
color: Colors.blue,
@@ -101,8 +113,15 @@ class _EPSG3413PageState extends State<EPSG3413Page> {
101113
),
102114
const Padding(
103115
padding: EdgeInsets.only(top: 8.0, bottom: 2.0),
104-
child: Text(
105-
'This page demonstrates some tricky edge-cases for maps with a polar projection.',
116+
child: SizedBox(
117+
width: 500,
118+
child: Text(
119+
'• Northern and eastern directions are relative to where you are on the map:\n'
120+
' • A red dot moves north toward the yellow dot (North Pole).\n'
121+
' • A red dot moves east counter-clockwise along the black latitude line (80°).\n'
122+
'• The lower left and right corners of the overlay image are the northern corners.',
123+
//textAlign: TextAlign.center,
124+
),
106125
),
107126
),
108127
Flexible(
@@ -126,9 +145,6 @@ class _EPSG3413PageState extends State<EPSG3413Page> {
126145
layers: ['gebco_north_polar_view'],
127146
),
128147
),
129-
CircleLayerOptions(
130-
circles: circles,
131-
),
132148
OverlayImageLayerOptions(
133149
overlayImages: [
134150
OverlayImage(
@@ -141,7 +157,10 @@ class _EPSG3413PageState extends State<EPSG3413Page> {
141157
).image,
142158
)
143159
],
144-
)
160+
),
161+
CircleLayerOptions(
162+
circles: circles,
163+
),
145164
],
146165
),
147166
),

0 commit comments

Comments
 (0)