simple_location_picker

A Simple Location Picker using Openstreetmaps. This is a very basic and simple package for picking a location from a map. There is no places search or shortcut for the home location. The location pickers centers on the initial coordinates passed to it.
The picker also operates in a 'Display Only' mode to display a location on the map.

Usage

Navigate to the Simple Location Picker to display the picker.

Navigator.push(
              context,
              MaterialPageRoute(
                  builder: (context) => SimpleLocationPicker(
                        initialLatitude: latitude,
                        initialLongitude: longitude,
                      ))).then((value) {
            if (value != null) {
              setState(() {
                _selectedLocation = value;
              });
            }
          });

The response is a 'SimpleLocationResult' object that contains the latitude and longitude of the selected location, or null if the picker was cancelled.

Parameters

ParameterTypeDescription
initialLatitudedoubleThe latitude of the initial position on which the maps focuses and places a marker on.
initialLongitudedoubleThe longitude of the initial position on which the maps focuses and places a marker on.
zoomLevelintThe initial zoom level of the map.
displayOnlyboolIf true, sets the picker to display only mode. Default is false.
appBarColorColorThe background color of the appbar.
markerColorColorThe background color of the map marker icon.
appBarTextColorColorThe text color of the appbar title.
appBarTitleStringThe appbar title.

Libraries

simple_location_picker_screen
simple_location_result
slp_constants