0
votes

After seeing 3d buildings in mapbox here: https://www.mapbox.com/mapbox-gl-js/example/3d-buildings/ I've decided to create a custom layer with only 3 buildings of my own (custom ones, one of which is in construction in reality), but I'm having problems extruding those buildings in mapbox view. I'm using same code as in example and only building contours shows up on the ground, cant make them look like 3d buildings. Any advices here?

To be more specific: 1. created building with JOSM, 2. exported to geojson file 3. imported to mapbox studio 4. trying to use layer in code, but only building countours appear in map - not an actual 3d shape.

Here's a screenshot from my mapbox studio: http://i.imgur.com/LZbKUvr.jpg - building layer is default one which shows buildings, but building_custom does not. Also, why my building_custom layer has green line near its name instead of blue one, like building layer does?

I've been trying to fix this for 2 days, not sure what I'm doing wrong with mapbox. As a proof that buildings actually exists, check here, where it displays correctly https://osmbuildings.org/?lat=40.71604&lon=-74.0362&zoom=17.8&rotation=-54&tilt=28 (middle building, reverse C shape front).

1

1 Answers

0
votes

If your screenshot is up to date, you're currently styling your building_custom layer as a fill layer. In order to make them 3D you'll need to change this to a fill-extrusion layer (next to "Type" — the fill-extrusion layer type is the one that looks like a windmill). Once it's a fill-extrusion layer you'll be able to adjust its height in the Style panel.

As to your other question I think what you're asking is why building_custom has a light purple line next to its name? If this is your question, the color coding has to do with what source-layer a layer's data comes from. The default building layer comes from the "building" source layer in Mapbox Streets; your custom building layer is from a different source layer. (All the place-* layers come from the same source-layer — "place-label" in Mapbox Streets — which is why they all have the same color.)