Adds a latitude / longitude grid as plugin to the flutter_map.
Supported flutter_map versions:
Notes for new flutter_map 6.0.0 release:
Example application under /example/
:
<img src="https://github.com/matthiasdittmer/lat_lon_grid_plugin/blob/master/lat_lon_grid_plugin_example.png?raw=true" alt="screenshot" height="1000"/>
dependencies:
flutter_map: any
lat_lon_grid_plugin: any
Include the FlutterMap
into your widget tree.
FlutterMap(
mapController: _mapController,
options: MapOptions(
center: LatLng(51.814, -2.170),
zoom: 6.15,
rotation: 0.0,
),
children: [
TileLayer(
urlTemplate:
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c'],
),
LatLonGridLayer(
options: LatLonGridLayerOptions(
lineWidth: 0.5,
// apply alpha for grid lines
lineColor: Color.fromARGB(100, 0, 0, 0),
labelStyle: TextStyle(
color: Colors.white,
backgroundColor: Colors.black,
fontSize: 12.0,
),
showCardinalDirections: true,
showCardinalDirectionsAsPrefix: false,
showLabels: true,
rotateLonLabels: true,
placeLabelsOnLines: true,
offsetLonLabelsBottom: 20.0,
offsetLatLabelsLeft: 20.0,
),
),
],
),