New to Kendo UI for Angular? Start a free 30-day trial
Link Map Markers to Locations
Environment
Product | Progress® Kendo UI® for Angular Map |
Description
How can I draw a straight line between a marker and a location?
Solution
- Add shape and marker layers to the Map configuration.
- Attach a handler to the reset event of the Map.
- Create a method that will draw a line between a marker and a specified position.
- Inside the method, retrieve the from and to coordinates for the line by using the locationToView method.
- Get a reference to the shape layer so you can draw on its surface.
- Draw the line by using the Path element.
The following example demonstrates how to draw a straight line between a marker and a location.
Change Theme
Theme
Loading ...