ThinkGeo.com    |     Documentation    |     Premium Support

Drag Multiple Features

I am looking for an example in WPF Edition that allows me to drag multiple shapes on the EditInteractiveOverlay. I find several examples in Desktop Edition, but the DrawCore() method is different and I don’t see an example of what is necessary when overriding DrawCore in WPF Edition.

In the end, I want to be able to select multiple features, move them to the edit layer, then drag them all. There are a couple example that are close to what I want in Desktop Edition, but nothing close in WPF Edition.

Hi Jake,

Why not create a MultipolygonShape, add all your polygons into it, then add the MultipolygonShape to EditOverlay?

You can split them after you complete your operation.

Regards,

Don

That loses all my column values for the individual shapes. They have ties to data that I need to keep. What I really want is an example of how to override DrawCore for the InteractiveOverlay.

Hi Jake,

The DrawCore for EditInteractiveOverlay in WPF DesktopEdition is more complex for Winform version, I am not sure whether it’s a professional service level problem.

Sorry I hadn’t found the sample you mentioned in our wiki samples, could you please let me know the link you viewed? Compare the winform version I can help you look into it to see whether it can be moved to the WPF edition.

Regards,

Don

As I said, there is no example that fits what I need. You can find several Desktop Edition samples that override the DrawCore function to get close, the one where you can select and drag multiple vertices for example. But none that deal with moving multiple features. This post is what I find right away when searching for Dragging Multiple Features:

In that conversation Val says you have done exactly what I am looking for in WPF already:

She goes on to say that Damian has several other requirements that push this into Professional Services, however, all I want is what she showed in the video. Drag multiple features. How did that video get created? You can tell me it requires professional services, but I see examples of it already created.

The Wiki page: http://wiki.thinkgeo.com/wiki/thinkgeo.mapsuite.wpfdesktopedition.editinteractiveoverlay is pretty unhelpful in this regard. As are all the samples you have built which appear to be built mostly in desktop edition.

The drawcore function may not even be where I am supposed to do this work, I see the DrawTileCore that at least takes a canvas that I am used to seeing. What I need is help figuring out what is necessary to build the custom overlay that in all other cases you tell us to build.

SelectFeaturesEditInteractiveOverlay.cs (11.6 KB)

I tried several things today and wanted to post this before I left work. This is far from complete, but it allows me to add point features to this edit overlay and then select multiple ones I want to move as a group. It needs some enhancements for other shapetypes, but it gets me started. This allows me to customize the FeatureEdited event so I can loop through the set of features on the edit layer and update any data attached to the features as well.

Hi Jake,

Thanks for your upload, sorry it looks the sample in Val’s reply is provided to another user and we hadn’t saved it. What you did now is in the correct way, we can implement that by override the MouseDownCore, MouseMoveCore and MouseUpCore.

It looks you want to move many features into the EditOverlay, then when you click all the features selected and you can move them as one feature. In fact I tried to make my workaround work for you, but it looks after the feature into Multiply polygon the id have been modified, so you cannot find back your columnvalues after you modified them. So the work around I mentioned before cannot works.

Because your requirement here like to implement a new function and we mainly reply more simpler questions in forum, so I mentioned it should be a professional service level task. But I still will look into your class and see whether I can provide some suggestions. If you have any question when you override the function, please discuss with us.

Regards,

Don

Hi Jake,

Today our developer takes some hours on your issue and help you complete this class, please view the sample attached: SelectFeaturesEditInteractiveOverlay.zip (3.0 KB)

This video shows how it works now: http://screencast.com/t/Zeadm2ge6ePP

Regards,

Don

it seems that some null pointer exception on V12 i just added this line to the MouseUpCore to fix the problem.

    protected override InteractiveResult MouseUpCore(InteractionArguments interactionArguments)
    {
        EndEditing(new PointShape(interactionArguments.WorldX, interactionArguments.WorldY));
        return base.MouseUpCore(interactionArguments);
    }

Hi, could you give us more description about this null pointer exception or send us a demo to recreate it, so we can really fix it? Have no clue how this would fix a null pointer issue from your code snippet.

Ben

i dont know either why this solves the null pointer exception. but maybe because it cannot call the EndEditing properly. to reproduce the same error you got to remove the MouseUpCore using ethan code with a v12.

Hi, this issue has been fixed in the latest wpf package 13.0.0-beta358, thanks for reporting it!