User Tools

Site Tools


map_suite_webapi_drawing_and_editing

Map Suite WebAPI Drawing and Editing

Overview

The drawing and editing tools allow users to draw a variety of new shapes on the map and to edit existing features. For example, a user may want to trace the outlines of buildings or other objects from aerial imagery to create and save new polygon features in vector format. Creating vector features from imagery converts them from colored pixels embedded in a grid to discrete, individual features that can then be queried and analyzed with mapping software.

New features and edits exist on the client side until the user uses the “Save to server” tool to save them to the cloud.

Drawing Tools


A new, unsaved feature (in pink) and existing
features (gray). Note the toolbar on the left.

Below the zoom in/out buttons on the toolbar on the left, you'll see another set of tools for drawing and editing features. You can use these tools to draw lines, polygons, rectangles, circles, or points. To do this, simply click the tool button, then click the location on the map where you'd like to begin drawing. To continue drawing the feature, click the location of the next vertex (without dragging), and so on, then double-click the location of the last vertex. To add a point, activate the “Add point” tool and click once in the desired location.

You can also prompt users to add attribute information about the new shape. For example, in the video linked at the top of this page, a prompt to enter a name appears after the new shape is drawn. You can wire up prompts for any type of attribute information you wish.

When finished making additions and edits, be sure to save your changes to the server using the “Save to server” button.

Edit Tool


Edit Mode

After selecting the Edit tool button, the features will turn pink, and tiny white boxes will appear around their edges. These characteristics indicate that you are in edit mode. The white boxes are the vertices on which the shape is based. You can move these vertices to adjust a feature's shape. Be sure to click the “save” option that pops up next to the Edit button once you enter edit mode to save your change, or select “cancel” to cancel your changes.

Be sure to also save your edits to the server using the “Save to server” button when finished. The features will be rendered in gray once again, and the vertices will disappear, indicating that your edits have been saved, and you are no longer in edit mode.

Delete Tool

Use the trash can icon (second from the bottom) to toggle into delete mode and remove a shape entirely. Simply activate the tool, the click on the feature you wish to remove. Be sure to click the “save” option that pops up next to the trash can once you enter delete mode to save your change, or select “cancel” to cancel deletion.

Be sure to also save your edits to the server using the “Save to server” button when finished. The features will be rendered in gray once again, and the vertices will disappear, indicating that your changes have been saved.

Saving Edits

Use the “Save to server” icon at the bottom of the toolbar to save your additions and edits to memory on the server. Features and attribute data can be stored in a variety of formats, including Shapefiles, geodatabases, or SQL Server databases, for consumption by other users.

Once saved, they will be rendered back in gray, based on the same GetTile method used to render the underlying basemap.

Sample Code

Now that you've read about these tools, see how to wire them up in the sample code.

map_suite_webapi_drawing_and_editing.txt · Last modified: 2015/12/03 09:37 by tgwikiupdate