[Google Maps API v3] LatLng at pixel location?

2011-10-28 Thread pinksy
Hi I'm really sorry if this has been answered - I can't find a clear answer, and am struggling to figure it out from the documentation... I have a map with known dimensions, and one side of the map will be obscured by a DIV which will have a variable width, leaving a visible portion of the

Re: [Google Maps API v3] LatLng at pixel location?

2011-10-28 Thread pinksy
Thanks for the reply Jeremy. I don't want to resize the map when the variable-width DIV is resized, because (as far as I know) to resize a map's canvas means completely reloading it (i.e., instantiating a new google.maps.Map object, passing in the resized DIV). For my purposes, the dimensions

Re: [Google Maps API v3] LatLng at pixel location?

2011-10-28 Thread pinksy
Thanks for the reply Barry. I'm not quite sure I completely understand - do you mean something like this (which doesn't appear to work)?: overlay = new google.maps.OverlayView(); overlay.draw = function() {}; overlay.setMap(map); var x = (200 - divwidth) / 2; var y = 50; var latLng =

Re: [Google Maps API v3] LatLng at pixel location?

2011-10-28 Thread pinksy
This is work-in-progress, but... http://www.pinksy.co.uk/newsquare/index.php/tidysquare The DIV on the right is resizeable, exposing more or less of the map underneath as you resize it. As you resize it, the map is panned left or right by the same amount, so that the center of the visible area

Re: [Google Maps API v3] LatLng at pixel location?

2011-10-28 Thread pinksy
Here is a simplified example of the question: http://www.pinksy.co.uk/newsquare/overlaytest.html The map is 600px wide, 300px high. An overlay is created as suggested above. A click event is added. On click, it adds a marker at the LatLng at 300px,150px (i.e., what I expect to be the center of

[Google Maps API v3] Re: How to zoom to a specific LatLng, without re-centering

2011-10-16 Thread pinksy
Thanks Joseph. Is there any way of doing it without the scrollwheel? The zoom option from the context menu in http://maps.google.com/ does it without a scrollwheel. Ideally I want to be able to specify a LatLng point programmatically, and call a zoom function to zoom about that point. I

[Google Maps API v3] How to zoom to a specific LatLng, without re-centering

2011-10-15 Thread pinksy
Hi. Apologies if this has been asked before, but I can't find it. I want to find a way to zoom in to a location that isn't the center of the map, without having to re-center the map. For example, the maps at http://maps.google.com/ have a context menu, where you can select Zoom in on any