Skip to content

Instantly share code, notes, and snippets.

@ryanbaumann
Last active January 6, 2023 11:32
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ryanbaumann/a7d970386ce59d11c16278b90dde094d to your computer and use it in GitHub Desktop.
Save ryanbaumann/a7d970386ce59d11c16278b90dde094d to your computer and use it in GitHub Desktop.

3D Indoor Floor Map - Mapbox GL JS Example

  • This gist contains the geoJSON data for 3D Indoor Map example on the Mapbox GL JS docs
  • Each GeoJSON feature has a color, height, and base_height property. These property values are used with the identity function type to style the GL JS 3D indoor map example.
  • Want to create your own 3D indoor map data? Create features with the Mapbox Dataset Editor.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jtFrancisco
Copy link

Did you create this geojson with the Dataset Editor or did you use another source and tool to create the geojson?

@ryanbaumann
Copy link
Author

@donbigote yes, I used the Mapbox Dataset Editor to create these geojson polygons.

@annette74
Copy link

Hello I have downloaded the 3D Indoor Mapbox html file on my computer. :
I would like to replace the geojson location by a local geojson location (on my computer to run it "locally")
'data': 'https://www.mapbox.com/mapbox-gl-js/assets/indoor-3d-map.geojson'
I have put a local path 'data': 'file:///C:/GEOJSON/indoor-3d-map.geojson' but it doesn't work.
(When it will be ok I have to adapt the html file to my local project)
Thanks for your help.

@alvpickmans
Copy link

Dataset Editor link is broken, returns 404.

@lukesUbuntu
Copy link

Just updating, more info here https://docs.mapbox.com/studio-manual/reference/datasets/ and Dataset Editor
located here https://studio.mapbox.com/datasets/

@JeanChristopher
Copy link

@donbigote yes, I used the Mapbox Dataset Editor to create these geojson polygons.

Hello ryan, can we as well use a converted 3D building BIM(.IFC) data in geojson and load it into mapbox GL ?
Thanks !

@ryanbaumann
Copy link
Author

Hello ryan, can we as well use a converted 3D building BIM(.IFC) data in geojson and load it into mapbox GL ?
Thanks !

Absolutely. Just ensure that your geojson is is in the WGS84 (long/lat) coordinate system.

@Cal-um
Copy link

Cal-um commented Dec 8, 2020

Hi, im looking to add some 3D shapes using a method similar to this to a map. Is there a application that is good for designing these buildings? Im finding it hard to get a good shape using the dataset editor. Cheers

@carlosalvarez91
Copy link

carlosalvarez91 commented Apr 11, 2021

Hi, I've been playing around with this dataset editor, I don't see any option to set the altitude or elevation
I see in the example there are some values specifying hight
"height": 40,
"base_height": 30
did you add them manually ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment