New to KendoReact? Start a free 30-day trial
Add Titles to Map Shapes
Environment
Product Version | 5.5.1 |
Product | Progress® KendoReact Map |
Description
How can I add some title text for the shapes in the Map?
Solution
- Add a shape layer to the Map configuration.
- Attach a handler to the
shapeCreated
event of the Map. - Create a method that will create a label for a given shape.
- Inside the method, retrieve the shape center using the element bounding box.
- Get a reference to the shape layer so you can draw on its surface.
- 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 ...