ThinkGeo.com    |     Documentation    |     Premium Support

Losing the Tag value of a feature while editing vertexes

Hi,
I’m using the Tag of a feature to store some rendering related information.
Now I have to let the user edit these features. No big deal and when the user drags a vertex the value of Tag is still there. Even after inserting a new vertex by clicking on the border of the shape is the value still there. But when the user now drags a vertex (any vertex not just the new one) is the value of the Tag property NULL.
The value of Tag is checked using the EditOverlayOnFeatureEdited event.

What can I do, to secure the value of Tag?

Thanks.
Peter

Update 09/12/16

The same effect happens when a shape is rotated. The value of the Tag is lost.
But resizing works. The value of the Tag remains.

Hi Peter,

It turns out to be a bug which has been fixed and it will be available in Development version 9.0.449.0 or later. Please get it from Product Center when it’s available and have a try again.

Thanks,
Peter

Hi Peter,

The version 9.0.452.0 is available now, please get it and have a try again.

Thanks,
Peter

Hi,

I reported this bug last year and it appeared to be fixed.
But unfortunately the problem still exists in the most current production build 9.0.0.848.
Why?

When can I get a production version where this problem will be fixed?

Thanks,
Peter

Hi Peter,

I think the better solution is move this change to release version, please try to get 9.0.0.854 or higher version from product center in one or two days.

And we suggest you upgrade your version to V10, because all the new fix and enhancement can be only found in V10.

Regards,

Ethan

Hi Ethan,

thanks for your answer.
The problem looked fixed on the outside but unfortunately it is not.

The tag value remains stable while moving a vertex of scaling/rotating/moving a shape. But when I try to insert or delete a vertex of a shape the tag value of the shape is still lost.

Please fix this bug in V9 as a switch to V10 is not feasible for us at the moment. Too much has changed to make this switch an easy one.

Thanks.

Regards,
Peter

Hi Peter,

In fact we have a quickly solution for that:

 public class CustomEditInteractiveOverlay : EditInteractiveOverlay
{
    public CustomEditInteractiveOverlay() : base()
    {

    }

    protected override Feature RemoveVertexCore(Feature editShapeFeature, Vertex selectedVertex, double searchingTolerance)
    {
        Feature feature = base.RemoveVertexCore(editShapeFeature, selectedVertex, searchingTolerance);

        BaseShape shape = feature.GetShape();
        shape.Tag = base.OriginalEditingFeature.Tag;

        Feature returnFeature = new Feature(shape, f.ColumnValues);

        return returnFeature;
    }
}

Map1.EditOverlay = new CustomEditInteractiveOverlay();

If you found any operation miss some information, you can assign that back like this, this sample only handle the remove vertex operation, wish that’s helpful.

Regards,

Ethan

Hi Ethan,

thanks for the quick reply.
The solution you provided looked very promising but unfortunately is the value of base.OriginalEditingFeature always null.
Do I have to set this value manually?

Regards,
Peter

HI Peter,

It looks the code have some problem, the OriginalEditingFeature only works after the feature get selected.

So please try the code as below and please let me know whether it’s helpful.

  protected override Feature RemoveVertexCore(Feature editShapeFeature, Vertex selectedVertex, double searchingTolerance)
    {
        Feature feature = base.RemoveVertexCore(editShapeFeature, selectedVertex, searchingTolerance);

        if (editShapeFeature.Tag != null)
        {
            feature.Tag = editShapeFeature.Tag;
        }

        return feature;
    }

Regards,

Ethan

Hi Ethan,

thank you very much.
This works for AddVertex too.

Best regards,
Peter

Hi Peter,

I am glad to hear that works for you.

Regards,

Ethan