Map Edit ActorΒΆ

Map Edit Actors are objects provided for each mapset to provide context-sensitive information and behavior that help drive the Wheel Menu and other elements of the Map Viewer.

Map Edit Actors are implementations of com.partnersoft.maps.model.MapEditActor that are returned from the mapset script scripts/Map Edit Actor. In general, your implementation should inherit from com.partnersoft.maps.model.AbstractMapEditActor, which provides default do-nothing implementations of all methods and is maintained so that new methods are implemented similarly in the future.

Methods provided generally follow two forms:

  • isFooEnabled(MapEditContext context) - returns true if the action “foo” is enabled
  • foo(MapEditContext context) - performs the action “foo”

Examples actions are add, delete, move, rotate, edit, etc.

The action menu is implemented using a method listAvailableActions(MapEditContext context).

The MapEditContext provides a wealth of context information, such as the current selection, last gps reading, where the map was clicked, etc.

Knowing which Map Edit Actor will be used for a given behavior is a bit complex. These things are used to decide:

  • the action selected or desired
  • the current selection’s mapset
  • the current tool’s mapset
  • all visible mapsets

If the action is a standard editing-type behavior, then the Map Edit Actor for the current selection’s mapset is consulted. This is true for delete, move, rotate, and edit.

The add action is determined by consulting the mapset of the current tool.

The action menu is built by consulting ALL visible mapsets. Any of these can contribute actions to the current selection’s action menu.

The context is then used by the Map Edit Actor to actually determine whether a given action is enabled and what to do when it is called. It may use a combination of factors, such as the selection’s datatype or data values.

Previous topic

Scale

Next topic

Map Platform

This Page