Google Summer of Code/2012/Improvements to Vespucci/Easy editing mode

From OpenStreetMap Wiki
Jump to: navigation, search

Easy editing mode

Currently, there are separate modes for scrolling, creating new nodes, moving existing nodes, changing tags, extending paths, spliting paths, and deleting nodes. I would like to add one more, "easy editing mode". (This makes sure existing users are not disturbed by the addition of new features).

In this mode, tapping a node once selects it.

Editing in this mode

Moving a node

Select it, then drag it (dragging anywhere except on a selected node scrolls the map)

Creating a node

Long-pressing anywhere instantly creates a node at that place and brings up a menu to select the type.

This (nested) menu is derived from JOSM preset files (see [1]). Once the user selects an item, there are multiple options:

The item-type is "node" only:
The node is immediately created with the proper tags. Depending on a preference, the tag editor could automatically open to allow adding more tags
The item-type is "way" and/or "closedway" only:
The user is prompted (via a "toast" notification) to add additional points, tapping the last one twice or closing the way. After this, the way is created, again with the appropriate tags.
The item-type allows nodes or ways:
The user is prompted to either proceed as with a way or tap the node again to create a single node. Once this has happened, the tags are applied as expected.

In addition to the JOSM presets, the first menu item is "repeat previous", which will re-use the last selection (possibly including all additional tags) to allow quickly adding identical nodes.

The user may specify their own preset file, containing only the points most important to them. This would also be very useful for non-public maps: A first response organization (using a separate API server) could have a preset with a "Casualty" group, containing one item per triage priority. A group putting up posters could have a preset with exactly one item, "poster" (in this case, the item could be auto-applied).

Editing a node (tagging)

Tapping a selected node again will trigger an edit. If the node is a part of one or more ways, the familiar "select-what-you-want-to-edit" list will pop up. After selecting the item, a new menu appears. The first item allows to go to the regular tag editor. Below this menu item, however, the JOSM preset list will be shown again. Only items applicable to the type of the edited thing will be visible. The submenu in which the item belongs will be shown first. For example, if I tap on a selected "Baker" node, I will get the following menu:

 - Edit tags
 - change to 'Supermarket'
 - change to 'Convenience Store'
 - change to 'Kiosk'
 - change to 'Butcher'
 - change to 'Beverages'
 - back to "shops"
 - Delete node

Possible extensions

  • done - A simple way to split/extend paths (e.g. an additional menu item) could be added.
  • not done, unnecessary due to other changes - The menu items could be split horizontally, allowing for much better screen space usage. This could either be used to fit more items from the preset list, or in the following way:
    • When choosing the way/node to edit, tapping on the left would trigger a different action than tapping on the right. This would need to be an advanced option and be confusing in the beginning; after the user gets used to it, it could speed the editing process significantly.
  • done - The tag editor could use the tag list from the selected preset item


To add the additional mode, (mainly for clicking), (for dragging and all edits) and the menu handling functions in Main will need to be extended. A separate class for handling the easy editing mode will probably be added, which will handle submodes (i.e. the difference between the regular easy edit mode and the state after the first node of a path was created).

The menu will need to be added, preferably as a separate class, possibly as a separate activity.

At first, the menu will be loaded from a hardcoded file. Later, Preferences for this need to be added, together with a good way for users to pass in preset files.

The package will help with interpreting the preset files. However, it will need to be extended to accurately extract all relevant data from the preset XML.