Environment

Product Version5.5.1
ProductProgress® KendoReact

Description

How can I draw a straight line between a marker and a location?

Solution

  1. Add shape and marker layers to the Map configuration.
  2. Attach a handler to the reset event of the Map.
  3. Create a method that will draw a line between a marker and a specified position.
  4. Inside the method, retrieve the from and to coordinates for the line by using the locationToView method.
  5. Get a reference to the shape layer so you can draw on its surface.
  6. Draw the line by using the Path element.

The following example demonstrates how to draw a straight line between a marker and a location.

Example
View Source
Change Theme:

In this article

Not finding the help you need?