open_street_map_search_and_pick 0.0.2 open_street_map_search_and_pick: ^0.0.2 copied to clipboard
A flutter place search and location picker plugin that uses Open Street Map.
Map Picker Flutter #
A flutter place search and location picker plugin that uses Open Street Map. it is completely free and easy to use.
This works on: #
- ✅ Android;
- ✅ iOS;
- ✅ Web;
- ✅ Windows;
- ✅ Linux;
- ✅ MacOS;
Objective #
This lib was designed to use open street map to set location on Flutter applications for all platforms.
Getting Started #
Import the following package in your dart file
import 'package:open_street_map_search_and_pick/open_street_map_search_and_pick.dart';
To use is simple, just call the widget bellow. You need to pass the default center position of the map and a onPicked method to get the picked position from the map.
OpenStreetMapSearchAndPick(
center: LatLong(23, 89),
onPicked: (pickedData) {
})
Then Usage #
Now if you press Set Current Loatiion button, you will get the pinned location by onPicked method.
In the onPicked method you will receive pickedData.
pickedData has two properties.
- latLong
- address
latLong has two more properties.
- latitude
- longitude
For example
OpenStreetMapSearchAndPick(
center: LatLong(23, 89),
onPicked: (pickedData) {
print(pickedData.latLong.latitude);
print(pickedData.latLong.longitude);
print(pickedData.address);
})
You can get latitude, longitude and address like that.