Creates the buildings on a map, drawn as soon as the map is ready.
The map to draw the buildings on.
Optionalconfig: Buildings3DConfig
The knobs to start with.
The user events of the buildings: a handler gets the building under the pointer, with its feature id and properties.
The underlying MapLibre custom layer, for advanced use beyond this facade.
Replaces the whole configuration. An empty object has every knob take the auto preset's value.
Use it, and updateConfig, for a look your code writes: the type is the check, and the values
are not checked again. For values held as data, the SDK's setKnobs checks each against
buildings3DKnobCatalogue and sets them by id, and its getKnob reads a knob's value in
force, the preset's one when unset. light.direction and light.altitude read the map's light
when unset, once one is placed.
updateConfig merges one level deep: a part you pass, such as light, replaces that part's values.
The colours setBuildingColors gave, by feature id.
Returns the knobs set, as a plain serializable copy.
Whether the feature is set to be shown: the visible knob, true unless set.
ProtectedlookA knob's value from a resolved look. The map's light turns with the bearing by fractions of a
degree, which the features draw with; the knob reports whole degrees, a value setKnob takes back.
Unsets every knob.
Gives the buildings with these feature ids a colour of their own, in place of their wall colour, and every other one its own colour back. An empty object clears them.
The ids are the ones events report, which stay the same across tiles and zoom levels, so you can colour a building before it loads. Its roof takes the colour too, and so does every part of a building the map data splits into parts, by the id of its whole outline.
Shows or hides the feature. Stored as visible in the configuration.
Changes the given knobs and keeps the others, one level deep.
Draws the base map's buildings in 3D with Three.js, with windows on their facades, a sun or moon that casts shadows on the buildings and the ground, and a look for every standard style.
Remarks
Public Preview until the plugin's 1.0.0 release.
3D - Buildinglayer. It draws whether or not thebuildings3Dgroup of theBaseMapModuleshows.autopreset follows the map style: the dark street and mono styles light windows from inside under a moon, the others get a sun and glass that mirrors the street and the sky.walls.color, following the map colours that restyle them.walls.palette, an array of colours of your own, gives each building one of them, andwalls.variationa shade of its own. Roofs follow the walls, palette included, until you setroofs.coloror aroofs.paletteof their own.view.lightknobs:light.directionandlight.altitudeeach follow it while unset.GLSurfacesfollows the same light, so the shadows and the textured ground agree.minZoom, palette knobs,walls.variationand hover and click looks for their unset knobs. Unless theirtextureknob says otherwise, their own textures show as facade detail, as strong asfacade.intensity, and in their own colours over satellite imagery. They mirror a little of the street and the sky, as much asreflections.intensitysets.roadLabels.occludedorpois.occluded, it moves those style layers under its own, so a building drawn over a label hides it. A hidden POI still keeps other labels off its place, and the moved labels give way to the labels above them where they collide.Example