Questions tagged [google-maps-api-2]

The Google Maps API (v2) lets you embed Google Maps in your own web pages with JavaScript. Version 2 of the API has been officially deprecated as of May 19, 2010 and will be shut down on May 26, 2021.

The Google Maps API lets you embed Google Maps in your own web pages with JavaScript. The API provides a number of utilities for manipulating maps (just like on the http://maps.google.com web page) and adding content to the map through a variety of services, allowing you to create robust maps applications on your website.

Version 2 of the API has been officially deprecated as of May 19, 2010 and will be shut down on May 26, 2021. Version 2 has been withdrawn and stopped working in May 2013 (replaced with a wrapper for v3). Questions concerning legacy applications that still use version 2 should use this tag.

See Google's guide for how to transfer from using v2 to v3

1460 questions
315
votes
13 answers

Android map v2 zoom to show all the markers

I have 10 markers in the GoogleMap. I want to zoom in as much as possible and keep all markers in view? In the earlier version this can be achieved from zoomToSpan() but in v2 I have no idea how about doing that. Further, I know the radius of the…
199
votes
9 answers

How can I change the color of a Google Maps marker?

I'm using the Google Maps API to build a map full of markers, but I want one marker to stand out from the others. The simplest thing to do, I think, would be to change the color of the marker to blue, instead of red. Is this a simple thing to do or…
abeger
  • 6,766
  • 7
  • 41
  • 58
126
votes
11 answers

Google Maps v2 - set both my location and zoom in

My question is, does anyone know how to set google maps up, to open up both my location and in a zoomed-in view? Currently, the main view opens up to Africa, all the way zoomed out. And so I have been searching for days now, and all I can find…
Dustin
  • 1,283
  • 2
  • 9
  • 8
83
votes
6 answers

How to get center of map for v2 android maps?

In Google Maps for Android v1, MapView had a convenience method: getMapCenter(). Now I cannot figure out how to get map center with v2 of this api. I have perused the API documentation, but there is no mention of such a feature. Please…
IgorGanapolsky
  • 26,189
  • 23
  • 116
  • 147
75
votes
11 answers

Google Maps Android API v2 - detect touch on map

I can't find an example on how to intercept the map touch on the new Google Maps API v2. I need to know when the user touches the map in order to stop a thread (the centering of the map around my current location).
Gaucho
  • 1,328
  • 1
  • 17
  • 32
74
votes
16 answers

Find distance between two points on map using Google Map API V2

I am using google map api v2 in my android application, I am able to show the map and put markers on it, but now I am stuck with the problem in which I need to find out the distance between two markers or points placed on map, I have already gone…
Salman Khan
  • 2,822
  • 5
  • 32
  • 53
65
votes
12 answers

Set Google Maps Container DIV width and height 100%

I loaded Google Maps API v3 and print Google Map in div. But when set width & height to 100% and auto I can't see the Map. Here is HTML code snippet.
BBKing
  • 2,279
  • 8
  • 38
  • 44
61
votes
9 answers

Google map comes partially, grey area comes instead of images from google server

Sometimes google map comes partially with other area getting grayed out. There is one catch, if we start Firebug, images do come in that gray area. Dont know why this is happening. Anybody ever experienced this and found solution, Please share.
Vishwanath
  • 6,284
  • 4
  • 38
  • 57
41
votes
3 answers

onMapReady not calling even though the map display without any error

I'm trying to display a simple map using Google map API v2 in an Android application. I'm following the Map API Documentation instructions. But I think the onMapReady is not calling for some reason. I'm using google-play-services_lib version…
SAN
  • 959
  • 4
  • 11
  • 17
37
votes
4 answers

How to disable android map marker click auto center

I am looking for a way to disable my map fragment's auto centre on selected marker functionality. I still want the markers InfoWindow to show up, but just not centre the entire map on the marker I have selected.
FiniteRed
  • 810
  • 3
  • 10
  • 20
35
votes
8 answers

Google Maps API 3 fitBounds padding - ensure markers are not obscured by overlaid controls

I'd like to be able add padding to a map view after calling a map.fitBounds(), so all markers can be visible regardless of map controls or things like sliding panels that would cover markers when opened. Leaftlet has an option to add padding to…
jsurf
  • 575
  • 1
  • 8
  • 20
33
votes
6 answers

Google Place Autocomplete not showing in Bootstrap modal

FIX UPDATE: It seems that the way i was initializing the box was causing issues here is what fixed it