Debugging MapboxGL
Jump to navigation
Jump to search
Some errors fail silently in mapbox and this can be annoying when you can't make a layer show up. A few things to make sure you check:
- Vector layers require a
source-layer
prop or argument. Often times, silent failing can be simply because the source layer is wrong. When using a tile server response from profiles.wprdc.org, make sure the source-layer is the same as the table name (`<schema>.<table/view>
). - Look in the network pane of your browser's dev tools and ensure that the requests to the source data are working.
- Make sure the projections are correct. Connect the source in a desktop GIS like QGis and see if the data is showing elsewhere. I'm fairly certain that mapbox requires the data to already be in WGS 84 Web Mercator .
- If you see tile data coming in the network pane (
.pbf
,.mvt
, etc.) check to see if they have any data. If data in your target area is empty (i.e. 0 bytes), this could be a sign the projection is incorrect.