I have created a custom interactive overlay, inherited from the EditInteractiveOverlay. We insert the editor into the InteractiveOverlays collection at position 0, intending it to the frist editor to have a crack at the mouse events.
I'm running build 331.
In the MouseClickCore, we clear the internal EditShapesLayer and then search in an attached layer for a containing shape. If found, we load that shape into the editor. This is working fine. My selected shape shows up, with vertices highlighted, a drag symbol, rotate symbol, etc. The problem that I'm having is that none of the edit action is actually working. When I click on the drag symbol, the entire map drags. When I click on the rotate button and move it, the entire map moves. When I click on a vertex and drag it, the vertex turns red, but the entire map moves. When I double-click a vertex, the map zooms in.
Also, if I set CanResize, CanRotate, etc to false, I was expecting that I would NOT see their respective sizing and rotating symbols. But they symbols are always there, no matter what. Do I need to explicitly recalculate only the vertex control points, for instance, if I don't want resizing and rotation symbols?
I don't know where to start on resolving this. Here is my MouseClickCore code:
protected override InteractiveResult MouseClickCore(InteractionArguments interactionArguments) { try { this.Lock.EnterWriteLock(); bool hadShape = (this.EditShapesLayer.InternalFeatures.Count > 0); this.EditShapesLayer.InternalFeatures.Clear(); _attachmentsLayer.FeatureSource.Projection.Open(); Collection<feature> features = _attachmentsLayer.QueryTools.GetFeaturesContaining(new PointShape(interactionArguments.WorldX, interactionArguments.WorldY), ReturningColumnsType.AllColumns); if (features.Count >= 1) { foreach (Feature f in features) { this.EditShapesLayer.InternalFeatures.Add(f); } this.CalculateAllControlPoints(); return new InteractiveResult(InteractiveOverlayDrawType.Draw, ProcessOtherOverlaysMode.DoNotProcessOtherOverlays); } else { InteractiveResult r = base.MouseClickCore(interactionArguments); if (hadShape) r.DrawThisOverlay = InteractiveOverlayDrawType.Draw; return r; } } catch (Exception ex) { logger.Error("MouseClickCore", ex); return new InteractiveResult(InteractiveOverlayDrawType.Draw, ProcessOtherOverlaysMode.DoNotProcessOtherOverlays); } finally { this.Lock.ExitWriteLock(); } }
Also, when I clear this overlay and don't want any shape to be included, I still have the Vertex and Resize control points displayed on the screen until the next map refresh.