Mappls Place Picker Plugin can be used to choose a specific location.
Add below dependency in app level build.gradle file
// When using the BoM, you don't specify versions in Mappls library dependencies
implementation("com.mappls.sdk:place-widget")
//Or Add Dependency with Version
implementation("com.mappls.sdk:place-widget:3.0.1")// When using the BoM, you don't specify versions in Mappls library dependencies
implementation 'com.mappls.sdk:place-widget'
//Or Add Dependency with Version
implementation("com.mappls.sdk:place-widget:3.0.1")To add the place picker widget
Intent intent = new PlacePicker.IntentBuilder()
.placeOptions(placePickerOptions).build(this);
startActivityForResult(intent, 101); val intent = PlacePicker.IntentBuilder()
.placeOptions(placePickerOptions).build(this)
startActivityForResult(intent, 101)You can use PlacePickerOptions to set the following properties:
toolbarColor(Integer): To set the toolbar color of place widgetstartingBounds(LatLngBounds): To open a map in a boundstatingCameraPosition(CameraPosition): To open a map that sets in camera poition you can set zoom, centre, bearing etc.,includeDeviceLocationButton(Boolean): To enable/ disable current location functionalitymarker(Integer): To change the marker image which is visible in the centre of a mapmapMaxZoom(Double): To set maximum zoom level of the mapmapMinZoom(Double): To set minimum zoom level of the mapincludeSearch(Boolean): To provide opions for search locationssearchPlaceOption(PlaceOptions): To set all the properties of search widget
The Place Picker widget has the capability to showcase certain premium features if they are provisioned within your project, like:
If the selected point on the map falls within a building, then Mappls Place Picker can also highlight the said building on the map. This visualization's color palette is configurable within the Mappls Map SDK.
In order to access this feature, please contact API support as well as your Business relationship manager.
Also, you need to use below properties to use this feature:
buildingFootprintsEnabled(Boolean): To display Building Foot Print of place picker areabuildingAppearanceFillColor(String): To set the footprint background colorbuildingAppearanceFillOpacity(Double):To set the footprint background color opacitybuildingAppearanceStrokeOpacity(Double):To set the footprint Stroke opacity colorbuildingAppearanceStrokeWidth(Integer): To set the footprint Stroke WidthbuildingAppearanceStrokeColor(String): To set the footprint Line Stroke Color
To get the pick place:
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 101 && resultCode == RESULT_OK) {
Place place = PlacePicker.getPlace(data);
}
}override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if(requestCode == 101 && resultCode == Activity.RESULT_OK) {
val place: Place? = PlacePicker.getPlace(data!!)
}
}For any queries and support, please contact:
Email us at apisupport@mappls.com
Support
Need support? contact us!
