Bouncy marker in Google Maps v3 - google-maps

In Google Maps API v2 we can set to marker an option bouncy:true. It adds to marker eye-candy ability - after dragging this marker, it is bouncing.
Is it possible to do in API v3 ?

Here's how you do it in V3
google.maps.event.addListener(marker, "dragend", function(){
marker.setAnimation(google.maps.Animation.BOUNCE);
});

I just had a quick look at the API v3 spec for Markers - it doesn't look like the 'bouncy' option is available right now but I wouldn't be surprised to see this get implemented into the v3 API at some point - it's still in Beta and bound to change quite a bit.
Here is a link to the API v3 Reference on the available Marker Options
If you really wanted the behavior in a V3 Map now you could tie an event to the 'dragend' method on the Marker Object. Have the function called alter the anchor point of the MarkerImage object - check out the MarkerImage object in the API too.

Well, I was looking for a way for implementing bouncy markers in V3 of google maps so that if we are showing a cluster of markers, the currently selected marker should be visible clearly.
We used the z-index property of the marker to set the z-index of the current marker at a relatively higher value than the rest.

Related

jquery goMap plugin and google maps api V3 fitBounds to a country

I am using goMap jQuery plugin for integrating Google Maps api v3. I have some external controls overlapped on the map - list of countries and I would like to fit bounds off a map to a clicked country.
goMap has fitBounds function but it only fits to the bounds of markers on the map. I found another question and answer regarding how to fit bounds of a map to a country with Google maps api v2 and v3 here, but I don't know how to combine this with goMap plugin.
I haven't used goMap, but it appears you can access the Google Maps API Map object with $.goMap.map. You can then use the Google API fitBounds (or whatever) function directly. Again, I'm not sure one way or the other if there would be any bad side-effects related to the state of the goMap object.

How to find the boundary points with center and zoom level given?

The LatLngBounds function needs the corner points!
How to find the boundary points with center and zoom level given?
Is there Google API V3 which achieves this?
Or can this be done someway with the static maps?
Are you referring to the boundary points of the visible map? If so, you can use the getBounds method of the map object.
var llb = map.getBounds();
If you are using the geocoder, it returns a suggested viewort (that is a google.maps.LatLngBounds() object).
See this similar question:
Google Maps API zoom after setcenter
If you only have the center coordinates and the zoom, use them to initialize the map, listen for the bounds_changed event, then use the map.getBounds() function.
All of the above are described in the documentation

google map v3 dragging marker issue

I am using Google map api V3, and in my application i m making gradable marker. Every thing is working fine except the marker icon while dragging.
What happens in Google Map V2 was it changes marker icon automatically when it was being dragged but in Google Map V3 when dragging the marker its icon doesn't change like it used to change in V2.
The answer is simple: in V3 they removed it, since they considered the animation to be of little use in mobile devices. They are trying to aim this V3 release to be as lightweight as possible.

Getting the bounds of a polyline in Google Maps API v3

Is there any easy ways to find the bounding box of a polyline using Google Maps API v3? I'm working on a project where I need to update the bounds as data is added and removed from the map. This is pretty easy by just doing bd.extend(point) where bd is the bound object and point is a LatLng object. The problem is when I start removing data I would like it to change the bounds and zoom back in. Are there any built in functions that can do this or will I need to write something for myself?
Expanding on oenpelli's solution, this is the extended getBounds() method that I am using to recreate the functionality from V2 API. This is working perfectly in my project.
google.maps.Polyline.prototype.getBounds = function() {
var bounds = new google.maps.LatLngBounds();
this.getPath().forEach(function(item, index) {
bounds.extend(new google.maps.LatLng(item.lat(), item.lng()));
});
return bounds;
};
Just remember that this needs to be added AFTER the API javascript is loaded, so in your init method.
The v2 API had the GPolyline.getBounds() method to do exactly this. However it appears that there is no equivalent method in the v3 API.
You may want to handle this by overriding the changed property of your Polyline MVCObject in order to be notified when the object changes state. Then you can calculate the bounding box using the LatLngBounds.extend() method that you suggested.
I think Google intentionally omitted such methods from the v3 API in an attempt to keep the API lightweight. A similar omission discussed a couple of days ago on Stack Overflow was the GMap2.clearOverlays() method.
You can also extend the Polyline class to add your own getBounds method. Refer to google maps api v3: add point on polyline beetwen two existing points on click polyline event for how to do this.

InfoWindow replacement for Google Maps v3

I'm looking for an InfoWindow replacement for Google Maps v3. I want to use it for popping up on marker mouseover. The standard InfoWindow is wholly unusable because it pans and makes itself a nuisance. Google Maps v2 had the excellent GxMarker (doesn't work with the new API): http://code.toeat.com/gxmarker.html
Does anyone know of a similar plugin for Google Maps v3, or other ways to work around the bossy behaviour of InfoWindow?
In the InfoWindow options you can disable the panning by setting disableAutoPan to be true, you can read more on the reference page.
But there is also a InfoBox utility library that can be found here
http://econym.org.uk/gmap/ebubble.htm was what I used for V2 and when you glance at the code you can see it's fairly simply and may work with V3 if altered slightly.
Hope it helps.
var infowindow2 = new google.maps.InfoWindow({
disableAutoPan: true
});