VEMap Pan triggers VEMap.onclick
Posted
by Jason
on Stack Overflow
See other posts from Stack Overflow
or by Jason
Published on 2009-07-29T19:12:21Z
Indexed on
2010/05/12
5:04 UTC
Read the original article
Hit count: 390
I'm using the Virtual Earth (or Bing!...) SDK and need to attach an event when someone clicks the map. Unfortunately panning the map also triggers the onclick event. Does anyone know of a work around?
function GetMap(){
map = new VEMap('dvMap');
map.LoadMap(new VELatLong(35.576916524038616,-80.9410858154297), 11, 'h',false);
mapIsInit = true;
map.AttachEvent('onclick', MapClick);
} function MapClick(e){ var clickPnt = map.PixelToLatLong(new VEPixel(e.mapX,e.mapY)); Message('Map X: ' + clickPnt.Longitude + '\nMap Y: ' + clickPnt.Latitude + '\nZoom: ' + e.zoomLevel); }
© Stack Overflow or respective owner