2
votes

Is there a way to draw a vector layer with CorelDraw for example and place it on napboxgl and use it as geojson layers? For example https://seatgeek.com/colorado-rapids-at-seattle-sounders-fc-tickets/mls/2017-10-22-1-pm/3700786 Are they using geojson or etc.? Or just some sort of vector format? I can't use geojson as it is hard to draw with QGIS any straight lines or symmetrical objects. I just want to draw a lot of vector objects and use them as layers with mapboxGL(use mapbox as render method and interact with layers as with geojson) Any suggestions how to do it? Or is there a way to draw with Corel and then place it on map with QGIS? Thanks

UPD: Now I am using Corel -> dxf export and then import it to QGIS, then save it as geojson. But have some glitches with displaying that geojson geometry in mapbox, so I have to draw another in QGIS over the imported(dxf) one.

Here is an example of the bug, should be just a green polygon like the gray one enter image description here

UPDATE: my fault, I was using lines instead of polygons.

1
The bug you mention may be this one: github.com/mapbox/mapbox-gl-js/issues/3080Steve Bennett

1 Answers

1
votes

I think you can achieve this as follows:

  1. Convert the Corel output to SVG
  2. Create an HTML element containing the SVG (not necessarily added to DOM)
  3. On your Mapbox map, add a Canvas source containing the canvas: see https://www.mapbox.com/mapbox-gl-js/api/#canvassource

Obviously you will need to determine the lat/lon of the corners of your image somehow.