Vishful thinking…

Drag & Drop support for graphics in the ESRI Silverlight API

Posted in Uncategorized by viswaug on June 30, 2010

I have recently added drag and drop support for graphics in the ESRI Silverlight API to the ESRI Silverlight API Contrib library. The library has also been upgraded to ESRI Silverlight API Beta 2. Will soon upgrade it to RC. The drag & drop functionality can be added to specific graphics or to all the graphics in a graphics layer. Enabling drag and drop is real easy. Just call the ‘MakeDraggable(map)’ method on either a Graphic object or a GraphicsLayer object. ‘MakeDraggable’ is an extension method that takes a reference to the ESRI Silverlight API map control to do it’s magic. The return from the method call is an ‘IDisposable’. To stop the graphic or the graphics on the graphics layer from being draggable, just call ‘Dispose’ on the ‘IDisposable’ object returned above. The map remains entirely usable when the graphics are draggable, so no worries there.

I am also currently looking into adding custom drawing tools to the library that will have the map be pannable when drawing and allow adding new drawing tools like circle etc if needed. If you want to see some new interesting features added to the ESRI Silverlight API Contrib library, let me know🙂

4 Responses

Subscribe to comments with RSS.

  1. Morten said, on July 1, 2010 at 6:22 pm

    VERY cool.

  2. Hasan said, on August 9, 2010 at 8:39 am

    i can not understand why esri didn’t include such a core functionality yet. Anyway, you started a good job, thanks for contribution.

    But it has a critical bug i think. if i use graphic.makedraggable instead of layer.makedraggable, d&d is losing graphics coordinates when the underlying map panned. (i tested this behaviour by downloading & running contrib source)

    this seems as can be fixed by a minor touch but i couldn’t find the solution yet. could you please provide some guidance on this?

  3. Mannus said, on September 8, 2010 at 9:25 am

    Hello!

    I saw your extensions and it seems to be pretty cool. I was interested in the make draggable. But can I only remove the graphic with it or even drag one vertex of a graphic?

    • viswaug said, on September 9, 2010 at 9:16 pm

      Currently, only the graphics themselves are draggable. I will think about adding drag & drop support for vertices if SL API 2.1 doesn’t already have it

      Thank You,
      Vish


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: