Buildings on the map
One of the main added "layer" the Smplrspace map viewer provides, as compared to just Mapbox is the ability to render 3D spaces from your Smplrspace data, and 3D cities based on OpenStreetMap data in a few lines of code. Here are the functions currently available.
Spaces from Smplrspace
Add spaces by ID
To fetch spaces from your Smplrspace account and render them on the map, call the following method. Note that the spaces need to be georeferenced within the platform.
map.addSpacesById(spaceIds: string[]) => void
spaceIds
- unique identifiers of the spaces in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
Remove spaces by ID
To remove specific spaces from the map, call this function:
map.removeSpacesById(spaceIds: string[]) => void
spaceIds
- unique identifiers of the spaces in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
Remove all spaces
To remove all spaces from the map, call this function:
map.removeAllSpaces() => void
3D cities
Control OSM layer
To control whether to render the 3D cities based on OpenStreetMap data or not, use the following methods:
map.showOsmBuildings() => void
map.hideOsmBuildings() => void
map.toggleOsmBuildings() => void