I am wanting to remove all mouseover and mouseclick events for a polyline in Google maps API v3
How to I achive this?
google.maps.event.clearListeners() is the method you'll have to use, it removes all listeners for a particular event on a given instance.
Related
I can't seem to find the map event in Here that equals to Google Map "idle" event.
The definition of Google Map event "idle" is "This event is fired when the map becomes idle after panning or zooming."
So, when any of the map actions are done completely the map becomes idle and the idle event is fired — with this event i can guarantee all map's animations, actions and other stuff are done completely.
For example, if i zoom or pan the map with the animation option enabled zoom_changed and dragend events will be fired immediately but only after the idle event i can safely use getZoom or getBounds or getCenter methods and get correct values instead of some intermediate values (while animation is still running).
In Here maps i can see only pointer, drag and tap events. There is no any zoom change event at all. And all those events cannot guarantee the map is ready to give correct zoom/bounds/center/etc values after some interaction.
For example, Here dragend event is firing but drag animation is still running, so i cannot guarantee getBounds or getCenter will return correct values if i try to read them right in dragend callback.
In Yandex maps i have actionend event which is equivalent to the Google's "idle" event.
What i have in Here maps which is equal to the Google Map or Yandex Map "idle" event?
If you refer to the JavaScript API you may want to look at the mapviewchangeend event
I've recently created a website that display uses a Google map. I was wondering does the google.maps.event.trigger(map, 'resize') causes the map to be reloaded from Google? Or is it just plain UI redraw from local machine that doesn't call back to Google api?
from the documentation:
resize - None - Developers should trigger this event on the map when the div changes size: google.maps.event.trigger(map, 'resize').
This event informs the API that the map DIV has changed size, it will do what is needed, which may involve fetching additional tiles from the tile servers, but not necessarily (if the map got smaller, there shouldn't be any additional tiles required). It won't cause an additional load of the API.
I'm using this third party library, called Marker Clusterer with the Google Maps API. http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/docs/reference.html
I am trying to trigger an event when the map's zoom level is changed. The odd thing I've noticed though, is that when you click on a marker cluster, it calls the zoom event twice. Has anyone come across this odd error before? Why would it trigger the zoom callback twice? When I zoom normally without using clusters, the zoom callback is only called once.
Any ideas?
Looks like that behavior is a fix for an issue on IOS. You can download your own copy of the code and remove the additional call to fitBounds if you don't need it.
I am using google maps 3 api and am changing the icon of a marker when it is clicked. I am also registered for mouseover and mouseout events on the marker. I am finding that when the icon is changed because it has been clicked, it triggers a mouseout and then a mouseover. Is there a way to prevent these extra events from triggering?
edit: I'm changing the icon with the following code:
marker.setIcon(selecticon);
Thanks
How are you changing the icon? Are you sure you are not destroying the marker, and then recreating it.
We have no way of knowing because you haveing let us see your code (please include a link)
I can't find an answer for that simple question anywhere!
How on earth can we zoom in with one level (+1 from the current one) in google maps API V3?
I mean is there a function for that purpose? or a hack or whatever?
What I actually want to do is to zoom by one level onclick on a link located in a marker's infowindow and also the same result ondblclick on the marker but in both cases the zoom should increment only +1 at each event (click on link or dblclick on marker) and the zoom center should be the marker in question.
I'm open to any suggestion involving native Googlemaps methods, jQuery or plain Javascript.
Anyone who tickled the same problem?
map.setCenter(marker.getPosition()); //marker is marker to center on
map.setZoom(map.getZoom() + 1);