Skip to content

sohail2000/open_street_map_search_and_pick

 
 

Repository files navigation

A flutter place search and location picker plugin that uses Open Street Map. it is completely free and easy to use.

Features

  • Pick location from map
  • Search location by places
  • Easy to use

Demo

open street map search and pick

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),
        buttonColor: Colors.blue,
        buttonText: 'Set Current Location',
        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.

  1. latLong
  2. address

latLong has two more properties.

  1. latitude
  2. longitude

For example

OpenStreetMapSearchAndPick(
        center: LatLong(23, 89),
        buttonColor: Colors.blue,
        buttonText: 'Set Current Location',
        onPicked: (pickedData) {
          print(pickedData.latLong.latitude);
          print(pickedData.latLong.longitude);
          print(pickedData.address);
        })

You can get latitude, longitude and address like that.

Video Tutorial

Click on the image below to view a video tutorial. It will redirect you to a youtube video.

  • Video 1

Click here to view the tutorial

  • Video 2

Click here to view the tutorial

Contributors

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Makefile 87.0%
  • Dart 4.7%
  • C++ 4.0%
  • CMake 3.5%
  • HTML 0.3%
  • C 0.3%
  • Other 0.2%