Questions tagged [google-maps-android-api-2]

Google Android Maps Api v2 is the next generation of Google Maps SDK available for Android developers.

Related tags:

Useful links:

3484 questions
30
votes
3 answers

Google Maps API v2 Android add shape drawable as marker

I've been trying to add a shape drawable as the marker icon for a marker I want to add on the map. shape looks like this (res/drawable/blue_circle.xml):
30
votes
7 answers

How do I know the map is ready to get used when using the SupportMapFragment?

In the onCreate method, I am making use of the SupportMapFragment to show a map. SupportMapFragment fragment = new SupportMapFragment(); getSupportFragmentManager().beginTransaction() .add(android.R.id.content,…
Aaron McIver
  • 24,527
  • 5
  • 59
  • 88
29
votes
11 answers

SupportMapFragment does not support AndroidX Fragment

import com.google.android.gms.maps.SupportMapFragment; import androidx.fragment.Fragment; ... private SupportMapFragment mMapFragment; ... mMapFragment = (SupportMapFragment)…
29
votes
4 answers

Android: how to notify Activity when Fragments views are ready?

I'm using Google Maps API V2 in an activity wih drop down navigation where the map is on the second position. I'm adding the map pragmatically like: mMapFragment = supportMapFragment.newInstance(); getSupportFragmentManager() …
Gal Ben-Haim
  • 17,433
  • 22
  • 78
  • 131
28
votes
4 answers

Google's NavigationDrawer not drawing correctly over map

I'm having this issue with Google's NavigationDrawer not drawing correctly over the map when I pull it out from the side of the screen, it's being drawn under the map instead of over it, when closing it from already being open it is shown correctly.…
28
votes
4 answers

Android Maps Library V2 zoom controls custom position

How can i customize the position of the builtin zoom controls in a GoogleMap V2 ? There are a lot of questions related to this topic for the Version 1 of Google Maps library. Placing Zoom Controls in a MapView How to reposition built-in zoom…
Robert Estivill
  • 12,369
  • 8
  • 43
  • 64
27
votes
5 answers

Google map for android my location custom button

How can I change google map my location default button? I set my location enable and map draw standard image to find location, is it possible to change default image?
Nininea
  • 2,671
  • 6
  • 31
  • 57
27
votes
9 answers

How to use google map V2 inside fragment?

I have a fragment which is a part of Viewpager, and I want to use Google Map V2 inside that fragment. This is what I have tried so far, In my fragment, private SupportMapFragment map; private GoogleMap mMapView; @Override public…
Basim Sherif
  • 5,384
  • 7
  • 48
  • 90
27
votes
1 answer

Android Gradle How to build for Android Google APIs 4.2.2 not for Android 4.2.2

Is it possible to build for Android Google APIs SDK instead of the general Android SDK with gradle? I need the Google Maps APIs in my project therefore I need to change the build target I can find only samples with the build version…
Sebastian
  • 776
  • 1
  • 7
  • 7
27
votes
8 answers

MapFragment in Fragment, alternatives?

I need your help... I work on it until 3 days. My app is working with fragments. One of these fragments has to display a map from the Google Maps V2 api for Android. Currently, I'm using a MapFragment, but no surprise, a fragment in a fragment is…
Kyu_
  • 800
  • 4
  • 10
  • 18
27
votes
2 answers

Android Google Maps get Boundary Co-ordinates

I am using Google Maps v2 in my application. When the user pans or zooms on the screen I would like to get the area of the map based on which I want to fetch the POI only in the screen view part. I went through the documentation but could not find…
Harsha M V
  • 54,075
  • 125
  • 354
  • 529
26
votes
3 answers

Create a custom info window in google maps V2

I'm trying to make a custom window that look like that (for map objects). But instead of the project following and follower I wanna place an image, but I can't figure out how to make one, any refferes? thanks in advance.
crazyPixel
  • 2,301
  • 5
  • 24
  • 48
25
votes
2 answers

How do I zoom in automatically to the current location in Google Maps API for Android?

I have integrated the Google Maps API in Android Studio, and it also finds the current location, but I want to increase the zoom level, so that I can view my current location more clearly and precised. How do I increase the zoom level? You can find…
Salman
  • 361
  • 1
  • 3
  • 6
25
votes
1 answer

What does map.setMyLocationEnabled(true) really do

I am setting: map.setMyLocationEnabled(true) But I am wondering what this really does. What I know: I get a locate me button in the upper right corner of the map I get a blue icon on the map that represents my current location Here is my…
lostintranslation
  • 23,756
  • 50
  • 159
  • 262
25
votes
2 answers

Google Maps V2 - Android - Get a list of Markers

I'm trying to get a list Markers(using GMaps V2 for Android) similar to the getOverlays() method I used in GMaps V1.1 for Android here: private MapView mapView; mapView.getOverlays().add(overlay); How can I do something similar to what I did…