Zoom In/Out goes to original center of map after panning.

I have custom controls for panning (north, south, east, west) and zooming in/out. When panning the map using the controls and then zooming in, the map zooms in using the default center and not the current center. If the user drags the map and then zooms in/out the center is correct.

my code for panning is used with an onclick function (this is for north):

function PanMapNorth() {
var map_div = document.getElementById('myMap');
var h = map_div.style.height;
var h_val = -1*(parseInt(h.substring(0, h.length-2))/2);
map.Pan(0,h_val);
getDisplayCount();
}

Why is the current center of the map not being used for zooming after using the panning controls I created?

[722 byte] By [okiiyama] at [2007-12-27]
# 1

Thanks for all of the replies... jk

I found a "work around". after map.Pan(0, h_val) in my function, I call map.StartContinuousPan(0,0); map.EndContinuousPan(); . This saves the current center of the map and the zoom is zooming about the correct center.

okiiyama at 2007-9-4 > top of Msdn Tech,Windows Live Developer Forums,Virtual Earth: Map Control Development...

Windows Live Developer Forums

Site Classified