Select to view content in your preferred language

Delete vertex not available when editing

1849
11
10-03-2011 12:57 AM
LukeEvans
Emerging Contributor
Hi,

I am using a heavily modified version of the Flex Viewer.  Whenever using an editor within our implementation I am unable to right click to delete a vertex.  I have tested this in the out of the box version and it works fine.  I cannot figure why this option would not be available to me.  I have 'allowDeleteVertices' set to true.  We use the EditTool rather than the Editor component.  Does anyone have any ideas as to why this option wouldn't be available in the context menu?

Thanks

Luke
Tags (2)
0 Kudos
11 Replies
LukeEvans
Emerging Contributor
Can anyone help with this?
0 Kudos
JanieGoddard
Frequent Contributor
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Luke,

   Sounds like you have a mouseEvent listener attached to the map that is preventing the right click context menu from receiving the event (just a guess).
0 Kudos
LukeEvans
Emerging Contributor
Luke,

   Sounds like you have a mouseEvent listener attached to the map that is preventing the right click context menu from receiving the event (just a guess).


Thanks.  That sounds the most likely reason.  It's a case of trying to hunt down the offending listener

Is it definitely the map listening for the event that will then add the "Delete Vertex" context menu item?  Not the feature/graphics layer or the Edit tool?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Luke,

   I think the featurelayer that has the context menu listener, but I would see if you have a map mouse listener attached that is preventing the graphics from receiving the event. Or do you have a widget that is firing a setMapAction as that by default sets the mouse events to not listen, until the drawtool is deactivated.
0 Kudos
LukeEvans
Emerging Contributor
Luke,

   I think the featurelayer that has the context menu listener, but I would see if you have a map mouse listener attached that is preventing the graphics from receiving the event. Or do you have a widget that is firing a setMapAction as that by default sets the mouse events to not listen, until the drawtool is deactivated.


Would adding listeners to the map (or feature layer, graphic etc) stop the feature layer from receiving the event?  I assumed that the event would be caught by all listeners unless event.stopPropagation() was called, though I may be completely wrong on this
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Luke,

   It depends. I think that the DrawTool disables or removes all listeners when it is activated by default, unless you choose to add it's addition argument of false.
0 Kudos
LukeEvans
Emerging Contributor
Luke,

   It depends. I think that the DrawTool disables or removes all listeners when it is activated by default, unless you choose to add it's addition argument of false.


I've tried listening to the EditEvent.CONTEXT_MENU_SELECT event on the EditTool but it doesn't appear to be getting fired.  One step closer I guess, as this is clearly the issue.  I don't know why this wouldn't be getting fired.

Edit: On that note, I've just noticed that the "About ArcGIS API for Flex..." and "About ArcGIS Viewer for Flex..." aren't available in the context menu when the edit tool is activated on a graphic and the mouse is over a vertex.  If the mouse is in the centre of the graphic (not over a vertex) then they are available.  No idea why the event is being fired when mouse is over a vertex

Edit: Yet another update.  If I open my viewer with no widgets open then keep right clicking around the map then sometimes the "About..." items will show in the context menu, other times they won't.  It seems that the context menu is only shown with the "About..." items when the focus is on the map.  This could be related to my edit tool issue, as when right clicking over a vertex takes the focus off of the map.  I don't know really
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Luke,

  For debugging try making this change to the MapManager.mxml. Find the setMapActionHandler function and then the
drawTool.activate(tool);
and change it to
drawTool.activate(tool, true);
and see if that makes a difference. Also search your custom code for things that add event listeners to the map or graphics.
0 Kudos