This example demonstrates how to data bind, display and customize shapes with RadMap.
To do this, you need the data in GeoJSON format and to set the Type property of
the MapLayer to Shape.
Two RadClientDataSource controls retrieve the countries and
earthquakes data and provide it to the layers through their ClientDataSourceID property.
Each earthquake is represented in the GeoJSON as Feature object, where the details for the
earthquake are within the Properties member. The Geometry member holds a
Point object with the coordinates.
By default, each Point object in the Shape layer is automatically converted to a Marker, but it is possible to prevent the default behavior and
create a circle object with coordinates and radius. To do this, we:
- Handle the client-side OnClientMarkerCreated event and cancel it.
- Handle the client-side OnClientShapeCreated event, obtain the dataItem associated
with the Shape and calculate the radius and the color for each circle. The magnitude from the data
item is used as a parameter for these calculations.
Finally, for displaying detailed information for each earthquake, we are using the client-side
OnClientShapeClick event, where the event coordinates are used for calculating
where the RadToolTip should be positioned. Again, the dataItem of the clicked shape is used to provide the message.