I am wondering if it's possible to do something like this with Mapbox GL:
https://raruto.github.io/leaflet-elevation/examples/leaflet-elevation_geojson-data.html
I would like to have interaction between a chart and Mapbox by moving the marker either on the chart or either on the map.
I googled for this but i didn't find anything for Mapbox GL, just for Leaflet.
Currently i'm using Chart.js and Mapbox and i don't see how to manage to reproduce the above example.
Any hints maybe?
Thanks a lot
I can confirm for you that it is possible to build something like this using Mapbox GL JS.
Related
I'm working website which uses a lot of markers. And for performance reasons I'm going to render only visible markers after each move.
I'm using mapbox js library via react-mapbox-gl react library.
Any advice how to get visible coordinates from map? Top left and bottom right visible coordinates is enough.
You can use map.getBounds() or map.getBounds().toArray().
We are trying to create a polygon programmatically in typescript using mapbox gl. But starting height and ending height of the polygon will be different to create a slope. Please let me know is there any way to achieve this requirement.
Mapbox GL JS does not support 3D shapes with sloping surfaces. You could use something like three.js (via ThreeBox) to achieve it.
So my problem is, that I have a tileset which geometries are Multipolygons and when I want to display the district names it places multiple labels instead of just one centered. Is there a way to fix this?
Here is a screenshot for clarification
The data comes from a postgis database, I just export it to a CSV and upload it to mapbox.
I have tried converting the Multipolygon into single Polygons but that ended in the same result.
I also played around with the text padding in mapbox studio but with this option the label placement is very off.
Is there possibly a way trough Mapbox GL JS to fix this issue?
You need to generate a separate label layer. You can use geojson-polygon-labels to do this.
I am new to leaflet. currently I am working on leaflet to render vector tiles. my application's requirement is that on click i should get features from map tiles in geojson format.
In Mapbox map.queryRenderedFeatures(e.point). I want to do exact same thing, but in leaflet. Please check here to check how mapbox is fetching features.
Please help.
Current Leaflet implementation does not supports querying rendered features. Hence switching to Mapboxgl
In mapbox studio I have a lot of layers for customizations. Is there a way to access those layers programmatically with js. For example hide all WATER or ROAD layer on the map with js?
Thanks.
You can try using https://github.com/mapbox/vt2geojson to get geojson data for whichever layers you are interested in and then use this data and add styling using mapbox gl js maps.
Hope that answers your question.