New to KendoReactStart a free 30-day trial

Add Titles to Map Shapes

Environment

Product Version5.5.1
ProductProgress® KendoReact Map

Description

How can I add some title text for the shapes in the Map?

Solution

  1. Add a shape layer to the Map configuration.
  2. Attach a handler to the shapeCreated event of the Map.
  3. Create a method that will create a label for a given shape.
  4. Inside the method, retrieve the shape center using the element bounding box.
  5. Get a reference to the shape layer so you can draw on its surface.
  6. Draw the label by using the Text element.

The following example demonstrates how to add title text for Map shapes that are loaded from GeoJSON.

Change Theme
Theme
Loading ...
In this article
EnvironmentDescriptionSolution
Not finding the help you need?
Contact Support