flutter_osm_plugin 0.3.2+1 copy "flutter_osm_plugin: ^0.3.2+1" to clipboard
flutter_osm_plugin: ^0.3.2+1 copied to clipboard

outdated

openStreetMap plugin for flutter apps (only Android for now, iOS will be supported in future)

flutter_osm_plugin #

pub

osm plugin for flutter apps (only Android for now, iOS will be supported in future)

  • current position
  • change position
  • tracking user location
  • customize Icon Marker
  • draw Road

Getting Started #

Installing #

Add the following to your pubspec.yaml file:

dependencies:
  flutter_osm_plugin: ^0.3.2+1

Simple Usage #

Creating a basic OSMFlutter:

OSMFlutter( 
    key: osmKey,
    currentLocation: false,
    markerIcon: MarkerIcon(
    icon: Icon(
      Icons.person_pin_circle,
      color: Colors.blue,
      size: 56,
      ),
    ),
    initPosition: GeoPoint(latitude: 47.35387, longitude: 8.43609),
);

Declare GlobalKey #

GlobalKey<OSMFlutterState> osmKey = GlobalKey<OSMFlutterState>();

set map on user current position #

osmKey.currentState.currentPosition()

zoomIN #

osmKey.currentState.zoom(2.)

zoomOut #

osmKey.currentState.zoom(-2.)

track user current position or disable tracking #

osmKey.currentState.enableTracking()

initialise position #

osmKey.currentState.changeLocation(GeoPoint(latitude: 47.35387, longitude: 8.43609))

recuperation current position #

GeoPoint geoPoint = osmKey.currentState.myLocation()

select new position #

GeoPoint geoPoint = osmKey.currentState.selectPosition()

draw road #

osmKey.currentState.drawRoad( GeoPoint(latitude: 47.35387, longitude: 8.43609),GeoPoint(latitude: 47.4371, longitude: 8.6136));

OSMFlutter

Properties Description
currentLocation enable the current position.
trackMyPosition enbaled tracking user position.
showZoomController show default zoom controller.
initPosition set default position showing in map
markerIcon set icon Marker

NB: #

for now the map working only for android,iOS will be available soon

MIT LICENCE

387
likes
0
pub points
97%
popularity

Publisher

unverified uploader

openStreetMap plugin for flutter apps (only Android for now, iOS will be supported in future)

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, flutter_plugin_android_lifecycle, location_permissions

More

Packages that depend on flutter_osm_plugin