• What is KendoReact
  • Getting Started
  • Server Components
  • Components
  • Sample Applications
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Changelog
  • Updates
  • Troubleshooting

Add Titles to Map Shapes

Environment

Product Version5.5.1
ProductProgress® KendoReact

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.

Example
View Source
Change Theme:

In this article

Not finding the help you need?