Closed gerbsen closed 7 years ago
I'm not part of the Mapbox team, but I feel pretty confident when I say that you will not see any native SVG support in mapbox-gl-js anytime soon (probably never).
If you really want to stay with SVG I suggest you add an SVG overlay on top of your map, for example using d3.js. As the user interacts you will have to continuously project your SVG using mapbox-gl-js' projection-functions, but this is not rocket science and something I've done many times. This should also be similar in nature to what you are doing with leaflet.
For the example you demonstrated I would, however, strongly suggest you continue down the road of transforming your data into GeoJSON (or vector tiles). If your data source contains overlapping polygons I simply suggest you modify them, either at the source or on the fly, for example using turf.js: http://turfjs.org/docs/#difference
You can either add it manually on top of the map canvas and synchronize using map
move
event, or remove the overlap in GeoJSON isochrones by adding holes in shapes. SVG support as a part of GL JS is not technically feasible.
Any updates on this?
I'll also wait here
Hey guys, We've developed a SVG layer to display overlapping isochrones on Leaflet maps. We are in the process of switching to vector based maps and want to port this layer to support mapbox-gl js. I started fiddling around a little with the GeoJson, but this is not working since overlapping parts are painted darker the more overlays are added. Is there a way to add SVG layers or do we have to port the painting to WebGL?
Cheers,
Daniel