I need to get mouse coordinates of MAP control on client side.
I can get them, can't I?
Not on server side.
I need to get mouse coordinates of MAP control on client side.
I can get them, can't I?
Not on server side.
Hi Artem,
The following JavaScript specifies how to register click event at client side, and alert current mouse coordinate in pixel and decimal degree, please paste it in the header tag of your ASPX page.
var tgMap = null;
var showScreenPosition = function(e) {
var lonlat = this.getLonLatFromViewPortPx(e.xy);
var result = '';
result += 'screenX = ' + e.xy.x + ',';
result += 'screenY = ' + e.xy.y + ',';
result += 'lon = ' + lonlat.lon + ',';
result += 'lat = ' + lonlat.lat;
alert(result);
}
var OnMapCreated = function(map) {
tgMap = map;
tgMap.events.register('click', tgMap, showScreenPosition);
}
If you have any more queries please let me know.
Thanks,
Howard