This example illustrates how to add user polygons in MapView. As custom features, they are
handled through a FeaturesDataSource.
First we create a base map. For more details, check the hello example.
Then we generate a custom [[StyleSet]] for the countries, with a color gradient based on the
year that the country joined the EU. The Styles are all an ExtrudedPolygonStyle with only
a variation in the color.
In order to have the extrusion animation for all the individual sets of countries joining, we
group them and handle them in separate datasources, so that the various datasources' tiles will
get animated independently and highlight new territories. The following snippet highlights the
core part of the application's logic: we create these individual FeaturesDataSource for each
set of countries, and create the MapViewMultiPolygonFeatures for the countries.
The rest of the code is example-dependent logic to handle the countries sets, with the joining
and leaving mechanism, that adds and removes datasources.
This example illustrates how to add user polygons in MapView. As custom features, they are handled through a FeaturesDataSource.
First we create a base map. For more details, check the
hello
example.Then we generate a custom [[StyleSet]] for the countries, with a color gradient based on the year that the country joined the EU. The Styles are all an ExtrudedPolygonStyle with only a variation in the color.
In order to have the extrusion animation for all the individual sets of countries joining, we group them and handle them in separate datasources, so that the various datasources' tiles will get animated independently and highlight new territories. The following snippet highlights the core part of the application's logic: we create these individual FeaturesDataSource for each set of countries, and create the MapViewMultiPolygonFeatures for the countries.
The rest of the code is example-dependent logic to handle the countries sets, with the joining and leaving mechanism, that adds and removes datasources.