This article describes how to configure the input needed to perform certain edit actions on the map. As an example, we show you how to use a right mouse click to remove a point from a polyline instead of the default CTRL key + mouse left click combination.

The EditSettingsEditSettingsEditSettings customizations aren’t limited to changes of key combinations.

For example, you can also change:

  • The appearance of the handles

  • The style of the outline for handles that manipulate an outline

  • The style used for the visual aid, for example a vertical line that connects a handle with the terrain

  • The style used for the shadow

  • The mouse button

  • The modifier key

  • The mouse cursor

For more information, see the API documentation for the EditSettingsEditSettingsEditSettings.

Step 1 - Change the settings

If we want to change the default key combination for all delete actions, we must configure the EditSettingsEditSettingsEditSettings the Editor uses.

To do so, we create the default edit settings, and call the methods that adapt what we want.

Program: Change the default edit settings
auto settings = std::make_shared<EditSettings>();
settings->setRemoveModifierKeys(ModifierKeys::none());
settings->setRemoveButton(MouseButton::right());
var settings = new EditSettings();
settings.RemoveModifierKeys = ModifierKeys.None;
settings.RemoveButton = MouseButton.Right;
EditSettings settings = new EditSettings();
settings.setRemoveModifierKeys(ModifierKeys.None);
settings.setRemoveButton(MouseButton.Right);

Step 2 - Use the edit configuration

The next step is to use our edit settings when we create the creator.

Program: Use edit settings
auto creator = Editor::newBuilder().map(map).defaultSettings(settings).build();
var editor = Editor.NewBuilder().Map(map).DefaultSettings(settings).Build();
Editor editor = Editor.newBuilder().map(map).defaultSettings(settings).build();