Tutorial 12 — Vector Lines, Part III

Dynamically update vector lines and markers


Step 1

Let's first bring in the code for this tutorial and run it to see what this new app can do. If you have been working through all of the tutorials (if not please see Tutorial 1), type:

git checkout tutorial12

When running the app:

  1. Tap the button labeled "Route — Off" and note the line that is drawn from Raleigh, NC to San Francisco, CA.
  2. Note the markers that are drawn at the route end-points.
  3. Perform a 'long-press' gesture of at least 2 seconds on a single point to activate the rubber-banding mode.
  4. Now move your touch location around and note how the route dynamically updates.

Further changes happen in SimpleRoutePlanner.h and SimpleRoutePlanner.m.

Step 2

Creating a long-press gesture recognizer when the route planner is initialized:

Step 3

Adding the gesture recognizer when the route planner is enabled:

Step 4

Responding to the long-press gesture recognizer to dynamically update the route:

You can learn more about the Altus Mapping Engine classes used in this tutorial in the Documentation. If you have any questions about the Altus Mapping Engine, any feature requests or suggestions for improving the Altus Mapping Engine, please send them to [email protected].