Telerik Product and Version
|
UI for ASP.NET AJAX (version 2014.3 1209 and above)
|
Supported Browsers and Platforms
|
All browsers and platforms supported by Telerik UI for ASP.NET AJAX
|
Components/Widgets used (JS frameworks, etc.)
|
|
PROJECT DESCRIPTION
GeoJSON shapes in RadMap do not support labels out of the box. You can, however, manually create such labels by replacing the markers with the desired text as follows:
- Bind a MapLayer Type="Shape" to a GeoJSON data source.
- Include the text you want to display over the shapes in the marker.title field of the GeoJSON data.
- Attach to the shapeCreated event of the map and then:
- Reference the current marker through the dataItem properties of the shape.
- Set a custom marker shape. Marker shapes are implemented as CSS classes on the marker element (span.k-marker).
- Add the marker to the markers collection.
- Get the title of the marker element and add it as text to the span element.
- Hide the original marker image with CSS by cascading through the class defined in 3.2 step.