I'm switching one of my projects over to use googles maps api v3 from v2.
In v2 I had a div appended to the map pane with the following code:
$("#marker_popup").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));
Is there any simple way to do that with v3? I've been searching around and I've found some things relating to implementing draw and onAdd, but I figure there has to be an easier way to do it than that.
Have a look at the answer to this question (and the corresponding v3 API documentation): google maps v3 translate map.getPane(G_MAP_FLOAT_SHADOW_PANE)
Related
Is there a google maps api way to display this exact kind of text label next to a marker? I know how to create the marker and a bad looking label, but I was hoping to create labels like the ones that appear on google maps already:
Montes Grill & Pub for instance, or is this some css/html/js stuff I have to do?
Edit: I am following this tutorial.
It looks like Google Embed API gives your that option when you do a search.
Is there a way to highlight areas with Google Map JS API v3?
I've seen some websites do it
here are some examples:
http://www.streetadvisor.com/new-allakaket-yukon-koyukuk-alaska
http://www.homely.com.au/werribee-wyndham-melbourne-greater-victoria
http://www.realestate.com.au/neighbourhoods/upwey-3158-vic
This is called a polygon.
See the Google Docs for information.
You can manually set polygon points in JS.
Does anyone know how to change the boundaries of a map with the google maps api? I have a map currently that shows the full world and if I zoom out it shows multiple copies of the full world. The problem is that I only want to show north america, and I only want to show it once. Can anybody help out? Thanks!
Duplicate: Google Maps API V3: limit map bounds
There's no API to restrict map boundary in Google Maps API. You may can accept external solution, or consider using other map library like OpenLayers or Leaflet, which supports max-extent feature.
I am migrating to Google maps V3 from V2. I need to add a G_MAP_MARKER_MOUSE_TARGET_PANE pane in the maps. following is the V2 code:
mapPanel = myMap.GMap.getPane(G_MAP_MARKER_MOUSE_TARGET_PANE);
AddItem(mapPanel);
I need the V3 code to get the MOUSE_TARGET_PANE. Can anyone help me?
I think you're looking for google.maps.MapPanes.overlayMouseTarget.
Here's a list of all the V3 Maps API overlay panes.
Naturally, the V3 overlays work a bit differently from the V2 ones. Here's a V3 example.
I made a demo using v2, and now I want to use v3.
But I found out that v3 has not as many methods as v2, e.g.:
map.enableGoogleBar();
map.enableScrollWheelZoom();
polyline.enableDrawing()
So, is v3 powerful enough to replace v2 ???
N.B. Three years later there is obviously no reason not to use v3 of the API. Google Maps v2 is now deprecated.
Google Maps v3 is the next iteration of the API and my initial reaction would be to suggest that you use it. However, v3 is still a Google Labs product and is not as mature as the v2 API.
The initial focus for v3 was optimized performance and user experience on mobile platforms and ,as a result, some of the v2 features haven't made it into the v3 library (this gap is getting smaller). However, the performance improvements that have been made in v3 are equally applicable on the desktop, so you are faced with a performance/feature set trade off.
If there is a specific feature that is in v2 and not v3 and you aren't developing for a mobile device (and it sounds like you aren't), then you may want to use v2 and migrate to v3 once your feature is available.
In addition to Cannonade's answer, note that the scroll wheel feature can be enabled and disabled in v3, and even polygon editing is possible:
How to disable mouse scroll-wheel scaling with Google Maps API
Google Maps v3 Samples: Polygon Edit
I couldn't find any reference for the Google Bar however.