Interactive map labels

Click country, city and neighborhood labels on the map to show their boundaries

View on GitHub
SDK 1.0.0-rc.7

Click a country, city or neighbourhood label and the map outlines the area it names and dims the rest.

  • BaseMapModule.get owns the style’s own labels, and events.where({ layerGroups }) splits them from the rest of the map, each scope carrying its own hover cursor.
  • The handler gets the label feature, so its name feeds discoverPlaces with the geography types to keep, so there is no reverse lookup.
  • GeometriesModule.create with fill: { style: 'inverted' } shades the world outside the polygon geometryData returns, and clear takes it away.

Related examples