Loading map style parts

Load map style parts as you need them, allowing for a faster initial map load

View on GitHub
SDK 1.0.0-rc.7

The map opens on the base map alone, and a toggle’s layer arrives the first time that toggle is switched on.

  • The constructor’s include list names which style parts load up front, and it is empty here.
  • TrafficIncidentsModule.get, TrafficFlowModule.get and TerrainModule.get each pull their own part of the style in when first called, so the timing is the call site’s choice.
  • Passing { visible: true } to that same get turns the module on as it loads, so there is no follow-up setVisible.

Related examples