Thanks for the reply. I did find a way to do this (not as elegant as your example), however I was wondering if this was an issue itself. Not ever having used API 2, I wasn't sure if this was an API 3 problem or a math problem :)
Any insight into this? On Jan 29, 9:17 pm, Esa <[email protected]> wrote: > On Jan 29, 1:31 am, pete <[email protected]> wrote: > > > So seeing as the link you provided has no response either, is one to > > assume there is no work-around for this issue? > > map.panBy(0,-20); // or: > map.setZoom(map.getZoom()-1); > > But. First you should test if a marker is too close to map border. See > Pamela's technique in custom info window > script.http://gmaps-samples-v3.googlecode.com/svn/trunk/infowindow_custom/in... > You need degrees/pixel ratios. She calculates those: > > map.getBounds().toSpan().lat() / map.getDiv().offsetHeight; > map.getBounds().toSpan().lng() / map.getDiv().offsetWidth; > > Now you can do some more calculation to get how close the marker is to > the border. > > Second problem is how to perform zoomOut or panning. The asynchronous > nature of fitBounds() makes that your operation is presumably > overriden by DirectionsRenderer. > > The brand new addListenerOnce() offers a solution with 'idle' event. > It is triggered only once. > > Try putting inside the callback function of route(). (Just after > directionsDisplay.setDirections(response);) Even without any border > testing: > > google.maps.event.addListenerOnce(map, 'idle', function(){ > map.panBy(0,-20); > }); -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
