This is a discussion on Developer news for Virtual Earth: Dragging Map Elements and Web.Maps.VE updated within the Bing Maps Blogs & Tweets forums, part of the Blogs category; Dragging entities on the map object A common request from developers is how to implement dragable map objects on the ...

Dragging entities on the map objectA common request from developers is how to implement dragable map objects on the VE map Control. Virtual Earth supports a number of events on the map object (onmousedown, onmouseup, onmousemove in particular) that make it easy to implement dragging of elements on the map. Grayson Myers and Derrick Quan contributed some nice code samples to illustrate how to use these three events together for seamless drag of pushpins and polygons. Here are the samples -

Simple Drag - Draws a default and a custom pushpin and allows re-positioning of either of them

Collection Drag - Loads a Collection of travel destinations, each member of which is dragable

Shape Drag - Shows how to drag shapes and lines. slightly more complex in that the onmousemove event needs to recalculate the new pixel coordinate of each vertex for the shape being dragged

In each example, there's basically 2 pieces of code that are interesting. first, register the 3 events when initializing the map control like this:

Web.Maps.VE ASP.NET Ajax library updatedA new version of this Server control for your ASP.NET apps is out. Read about the latest version here featuring support for .NET 3.5 and visit the Simplovation website to download it and view demos. If you want to keep most of your VE coding server-side this should be a helpful library.