iOS API Tutorials
Tutorial 12 — Vector Lines, Part III
Dynamically update vector lines and markers
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:
- Tap the button labeled "Route — Off" and note the line that is drawn from Raleigh, NC to San Francisco, CA.
- Note the markers that are drawn at the route end-points.
- Perform a 'long-press' gesture of at least 2 seconds on a single point to activate the rubber-banding mode.
- Now move your touch location around and note how the route dynamically updates.
Further changes happen in SimpleRoutePlanner.h and SimpleRoutePlanner.m.
Creating a long-press gesture recognizer when the route planner is initialized:
Adding the gesture recognizer when the route planner is enabled:
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].