How to draw dashed polyline with android google map sdk v2?

Now in Polyline you can set the pattern to be Dash, Dot or Gap simply apply the following public static final int PATTERN_DASH_LENGTH_PX = 20; public static final int PATTERN_GAP_LENGTH_PX = 20; public static final PatternItem DOT = new Dot(); public static final PatternItem DASH = new Dash(PATTERN_DASH_LENGTH_PX); public static final PatternItem GAP = new … Read more

Android Maps API v2 draw circle

Google made is simple in maps v2. The snippet below demonstrates both drawing markers and circles along with updating their positions together. private Circle mCircle; private Marker mMarker; private GoogleMap mGoogleMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mGoogleMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.mapFragment)).getMap(); mGoogleMap.setMyLocationEnabled(true); mGoogleMap.setOnMyLocationChangeListener(new GoogleMap.OnMyLocationChangeListener() { @Override public void onMyLocationChange(Location location) { LatLng latLng … Read more

Ensure that the “Google Maps Android API v2” is enabled. I am getting this error when I try to Implement Google Maps

From error it is clear that You did not enable google map api for android. To enable, Login google developer console Select Library option from left side panel. Now you can see all API list and go to Google Maps APIs and select Google Maps Android API . Now you can see option to enable/disable … Read more

Android: Google Maps location with low battery usage

FINALLY FOUND THE SOLUTION!!! thanks to Tristan for his answer! By default, GoogleMap uses its on location provider, which is not the Fused Location Provider. In order to use the Fused Location Provider (which allows you to control the location accuracy and power consumption) you need to explicitely set the map location source with GoogleMap.setLocationSource() … Read more

Getting results of nearby places from User’s Location using Google Maps API in Android

For Android, I tried to use Place picker for Android. It can add the built-in place picker UI widget to your app, so users can choose from a set of nearby places displayed on a map. It easy to use, you just need to do is: int PLACE_PICKER_REQUEST = 1; PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder(); … Read more

Android: Google Maps API – Change position of maps toolbar

This is an answer that i came across before as to how to move the toolbar to the bottom of the page. I hope this helps you. //get reference to my location icon View locationButton = ((View) mapFragment.getView().findViewById(Integer.parseInt(“1”)). getParent()).findViewById(Integer.parseInt(“2”)); // and next place it, for example, on bottom right (as Google Maps app) RelativeLayout.LayoutParams rlp … Read more

AndroidRuntime: FATAL EXCEPTION: androidmapsapi-ZoomTableManager

Edit: following is the official solution from Google (link) Summary Google Maps SDK thread crashes App (ArrayIndexOutOfBoundsException) – Solution Offered Description On April 23 2020 starting at 11:30 PDT, Google served for 4 hours an update to the configuration of a Maps mobile component, triggering crashes in Maps SDKs for Android and iOS. Applications on … Read more