How do I force redraw with Google Maps API v3.0?

google.maps.event.trigger(MapInstance,’resize’) is working fine for me, put it at the begin of the function fitMap . What you are missing: currently(not in the code posted above, in your live-code), you call resizeWindow on each step . When you call this function on step the function will be called before the animation for the current step … Read more

Detecting Google Maps streetview mode

Detect the visible_changed event on the StreetViewPanorama associated with your Map object. You can get the panorama from the map by calling its getStreetView() method and bind the handler to that object’s event. You will have to test the StreetViewPanorama‘s visibility by calling its getVisible() method. For instance: var map = new google.maps.Map(document.getElementById(“theMap”), {streetViewControl: true}); … Read more

how to change the color of route in google maps v3

You can specify the color of the line when you create the DirectionsRenderer, using the optional DirectionsRendererOptions struct. This works for me, simply changing the line where the DirectionsRenderer object is created: <!DOCTYPE html> <html> <head> <meta name=”viewport” content=”initial-scale=1.0, user-scalable=no”> <meta charset=”utf-8″> <title>Directions service</title> <link href=”https://google-developers.appspot.com/maps/documentation/javascript/examples/default.css” rel=”stylesheet”> <script src=”https://maps.googleapis.com/maps/api/js?v=3″></script> <script> var directionsDisplay; var directionsService = … Read more

Google Maps API OVER QUERY LIMIT per second limit

The geocoder has quota and rate limits. From experience, you can geocode ~10 locations without hitting the query limit (the actual number probably depends on server loading). The best solution is to delay when you get OVER_QUERY_LIMIT errors, then retry. See these similar posts: OVER_QUERY_LIMIT in Google Maps API v3: How do I pause/delay in … Read more

Rotating image / marker image on Google map V3

My js class for solving this problem is: var RotateIcon = function(options){ this.options = options || {}; this.rImg = options.img || new Image(); this.rImg.src = this.rImg.src || this.options.url || ”; this.options.width = this.options.width || this.rImg.width || 52; this.options.height = this.options.height || this.rImg.height || 60; var canvas = document.createElement(“canvas”); canvas.width = this.options.width; canvas.height = this.options.height; this.context … Read more

Google Javascript API Geocoding Limits

I work in Maps for Business support at Google. The following is my personal opinion, not Google’s, but let’s just say I’m rather familiar with this topic! First, it’s important to distinguish between client-side geocoding (JavaScript calls to google.maps.Geocoder) and server-side geocoding (HTTP requests to /maps/api/geocode). This question and answer are specifically about client-side geocoding; … Read more