In order to add all the other buildings in Melbourne to our map (not just those under development) we need to load another layer to our map. Add this we add another layer above our previous map.addLayer
(so the new buildings are loaded afterwards).
Note: here the map.addSource
function is for this layer. The map.addSource
and 'source'
within map.addLayer
do the same thing.
map.addSource('buildingSource', {
'type': 'vector',
'url': 'mapbox://mapbox.mapbox-streets-v7'
}
);
map.addLayer({
'id': 'currentbuildings',
'source': 'buildingSource',
'source-layer': 'building',
'type': 'fill-extrusion',
'paint': {
'fill-extrusion-color': '#999999',
'fill-extrusion-height': {
'type': 'identity',
'property': 'height'
},
'fill-extrusion-opacity': 0.7
}
});