Maps Api v3: detect Ctrl+click on a marker - javascript

Is it possible to detect keyboard modifiers (ctrl, alt, shift) during a mouse event on a marker in a Google Maps v3 javascript map? If so, how?

You can, but it's nothing that's built in to the maps API.
This is back for the 2 API, but will work for three. There's some discussion of order of event problems with FireFox here, so you'll have to test a bit.
Hopefully that helps.

Related

Google Maps Javascript API new renderer (v3.32) infowindow displayed under controls

With the Google Maps JS API new renderer, as of v3.32, infowindows placement seems wrong. They are not panned outside of map controls areas. The best example is directly from Google Maps Platform docs. If you go here and click on the marker you'll see what I'm talking about: https://developers.google.com/maps/documentation/javascript/examples/infowindow-simple
See bottom of question for printscreen.
I searched a lot for some information on this change of behavior, if that's by design now, in case we'd have to handle this in code, but can't seem to find anything regarding this. What would be the API way to deal with this ?
Looks like it's partly been fixed in the weekly channel (current = 3.34). So you can load your map with https://maps.googleapis.com/maps/api/js?v=3.34&key=...
and the infowindow should move out of the map control's areas. It seems though it will not pan out of custom controls areas, which it used to do before the new renderer.

Why is there a difference in panning inertia between Google Maps API examples and Google Maps site?

I'm building out a map component in React and noticed that the panning inertia between my component and Google Maps is a bit different. e.g., in my React component, if the user drags the map a bit and lets the mouse button go off, the movement decelerates rather quickly.
However, if you go to Google Maps and do the same thing, there's quite a bit more movement the happens after the user releases the mouse button. Interestingly, I noticed the same behavior between the official Google Maps API examples and Google Maps.
API docs: https://developers.google.com/maps/documentation/javascript/interaction
If you pan on one of the examples, the movement quickly stops.
I've been unable to find anything in the official API docs -- is there a way to change how inertia behaves with the Google Maps JavaScript API so that it more closely matches what happens on maps.google.com? Or is this just how the API behaves?

Is there any way to maximize an InfoWindow in Google Maps v3

The old (v2) version of Google Maps API allowed infowindows to be maximized (see this example) but I can't find any equivalent feature in v3.
The same happens with tabbed infowindows too (they aren't supported anymore).
Is there any way to do that (even with a plugin)?
By looking at the documentation, it looks like there's no way to perform maximization on InfoWindow.

what about google map api v2 and v3, which is better

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.

Google Maps API V2: How to add markers which behave like the default google maps markers

I was wondering, with the free version... Can I plot the more default markers (from maps.google.com). The kind which when clicked, offer the option to enter driving directions and other tid-bits pulled from google's search of a business (eg: reviews).
Options like driving directions can be achieved by adding links to the infowindow that call the part of your code that does GDirections calls.
If you've got some reviews, then the Maps API provides you with the tools necessary to display them in the infowindow.
You need to code each of the other tid-bits you want individually. Almost all of them can be achieved with sufficient effort, but there's no shortcut. Be warned. Google are consstantly improving maps.google.com. If you get your site to work exactly like maps.google.com today, you may well find that when you look again a few months later, there are significant differences.
If you want something that does the whole lot exactly like Google, then you might consider using Google Maps itself, or an embedded Google Map, rather than using the API.

Categories