maplibre_geolocator 0.1.0
maplibre_geolocator: ^0.1.0 copied to clipboard
Shows the positions of the geolocator package with the UserLocationLayer of the maplibre package.
Show the location of the device on a MapLibreMap with a UserLocationLayer:
import 'package:maplibre/maplibre.dart';
import 'package:maplibre_geolocator/maplibre_geolocator.dart';
MapLibreMap(
options: MapOptions(
style: MapStyle.url('https://demotiles.maplibre.org/style.json'),
),
children: [
UserLocationLayer(locations: geolocatorUserLocations()),
],
)
Ask for the location permission first, for example with
Geolocator.requestPermission(). The
User Location chapter
of the documentation covers permissions, platform setup and tracking, and the
example app
has a complete page.