Drag bing map pushpin outside of map
-
Thursday, June 14, 2012 7:02 AMHi,
I am working on bing map. And the scenario is that user drag pushpin and drop it to
gridview.
On IE you can drag pushpin anywhere in page means pushpin is not showing outside map but mouse coordinates are changing so you can find out that on which element mouse is on. I am doing this
var target = (window.event) ? window.event.srcElement : event.target;
if ($(target).closest("table").attr("id") == "dtgDrivers")
{ }
else { }
But in case of chrome or firefox you can't drag it to outside map or mouse coordinate are not changed, so closest is also not working.
How can I make it drag outside map or by anyway find that mouse is on gridview?
All Replies
-
Tuesday, June 19, 2012 9:14 AM
Above code is inside of ondrag event of pushpin and only works on IE.
Now for chrome you have to use document mousemove event and code is same.
But in case of firefox you have to use closest with elementFromPoint like this
var target=document.elementFromPoint(event.clientX,event.clientY);
if ($(target).closest("table").attr("id") == "dtgDrivers")
{ }
else { }and event is document mousemove.
As soon as mouse goes to dtgDrivers show a div on mouse pointer and mouse it with pointer, use this link
http://stackoverflow.com/questions/7143806/make-an-image-follow-mouse-pointer
- Marked As Answer by mayank.karki Tuesday, June 19, 2012 9:14 AM

