React-native-mapbox-gl: Map is shown without buildings

Created on 25 Jul 2017  路  3Comments  路  Source: nitaliano/react-native-mapbox-gl

Hi everyone !

I'm looking for rendering 3D Buildings extrusion in a React-Native app using github /mapbox/react-native-mapbox-gl

I created a custom map in MapBox Studio,added the following line into the style.json and uploaded the map in Mapbox Studio

{
    "id": "buildings",
    "type": "fill-extrusion",
    "source": "composite",
    "source-layer": "building",
    "minzoom": 15,
    "filter": [
        "all",
        [
            "==",
            "extrude",
            "true"
        ],
        [
            ">",
            "height",
            1
        ]
    ],
    "paint": {
        "fill-extrusion-color": "hsl(206, 7%, 61%)",
        "fill-extrusion-height": {
            "type": "identity",
            "property": "height"
        },
        "fill-extrusion-base": {
            "type": "identity",
            "property": "min_height"
        },
        "fill-extrusion-opacity": 1,
        "fill-extrusion-translate-anchor": "viewport"
    }
}

The buildings are rendered as expected in mapbox-studio but when I go back in my React-Native App the map is shown but without the buildings.

Do you guys have any idea about how to display buildings in 3D with the react-native-mapbox-gl sdk ?

Thanks.

Most helpful comment

UPDATE:
xcfd3
Screenshot of the MapBox Studio Map
xdepu
Screenshot of the App with react-native-mapbox-gl

All 3 comments

UPDATE:
xcfd3
Screenshot of the MapBox Studio Map
xdepu
Screenshot of the App with react-native-mapbox-gl

How to use following code :

fill-extrusion-height": {
            "type": "identity",
            "property": "height"
        },
        "fill-extrusion-base": {
            "type": "identity",
            "property": "min_height"
        },

Anyone have idea? Because above code is not with latest react native mapbox

Was this page helpful?
0 / 5 - 0 ratings

Related issues

olofd picture olofd  路  3Comments

glennverschooren picture glennverschooren  路  4Comments

Craytor picture Craytor  路  3Comments

alexisohayon picture alexisohayon  路  4Comments

Amalp picture Amalp  路  3Comments