You can filter the pin markers on the map by clicking on the colorized country areas.
You can data bind RadMap Markers and Shapes on the
client to a RadClientDataSource control since Q2 2014.
This functionality is provided out of the box through the server-side ClientDataSourceID
property of the Layer which also has its client-side counterpart - the
set_clientDataSourceID() method.
Client-side data binding means fewer postbacks, easier integration with various data services and a more
flexible client-side development.
The map needs JSON literals with the necessary fields:
- for Markers you need a point with coordinates.
- for Shapes you need objects that follow the
GeoJSON specifications .
- additional fields can be present in the objects and they can be accessed in the
marker tooltip template with the #= marker.dataItem.FieldName # syntax.
You can alternatively use a field to define a simple tooltip via the
TitleField property.
- you can modify shapes in the ShapeCreated event with JavaScript
in case you need to apply further modifications on their structure/appearance.
- you can provide an array of JSON literals to the map by yourself in its OnInit event to use as a datasource. More information and examples are available in the RadMap client-side data binding help article.
In this example, the RadClientDataSource control requests *.json files
that contain the appropriate data. The one that works with the Shapes layer
has its WebServiceDataSourceSettings.ServiceType
property is set to GeoJSON. You can filter the data through the
client data source control object easily and this will not require additional requests for
the files (or in the common case - the service). You can read more on the matter in the
ClientDataSource Filtering demo.
Click on the countries from the selected continent or use the
Choose Map Destination dropdown to show points of interest for a specific country or continent
respectively. The OnShapeClick event of the map are used to determine which shape
was clicked so the filter collection of the RadClientDataSource is populated accordingly.