1

I made a map and put some points on it and I symbolized some points as svg markers from QGis library.Now, when I wanted to display or export the map with the gis2web plugin (openlayers option checked), I couldn't see the points. When I symbolized them as simple markers I saw them on the published map. What's happened? I've used QGIS 2.6.1 and qgis2web 0.35.

1

SVG markers are most certainly not supported by qgis2web. You can open a feature request on the plugin website.

|improve this answer|||||
  • 2
    There is an open issue for this: github.com/tomchadwin/qgis2web/issues/95. It should work in OL3, but it falls, and I don't know why. Investigation so far suggests it might be something to do with image dimensions and offset exceeding the dimensions of the source image. All help gratefully received. It is not supported yet in Leaflet export. Again, help on that would be very welcome. – Tom Chadwin Nov 27 '15 at 7:13
  • Update: I still don't know why this isn't working, though I have a new theory that OL3 will not render local SVGs. I've asked here: gis.stackexchange.com/questions/171796/… – Tom Chadwin Nov 28 '15 at 21:02
  • Could you try uploading your OL3 map and then browsing to it? In other words, can you see whether the SVGs display when viewed over HTTP, rather than file:///? – Tom Chadwin Nov 30 '15 at 20:40
1

SVG marker icons are implemented in OL3 output. However, some SVGs seem not to work, specifically some of the SVGs which are installed with QGIS. Discussion of that issue is at http://osgeo-org.1560.x6.nabble.com/QGIS-SVGs-won-t-work-in-OpenLayers3-td5239335.html and Local OpenLayers3 - SVG icon.

I've also now just implemented SVG marker icons in Leaflet output. Upgrade qgis2web to 0.36.0 and see how that works for you.

|improve this answer|||||
0

It were 8 commas to eliminate in leaflet-svg-shape-markers.min.js for diamond and square shapes :

if("diamond"===e){var n="M "+(i.x-s)+" "+i.y+", L "+i.x+" "+(i.y-s)+", L"+(i.x+s)+" "+i.y+", L"+i.x+" "+(i.y+s)+", L"+(i.x-s)+" "+i.y;this._setPath(t,n)}
if("square"===e){var n="M "+(i.x-s)+" "+(i.y-s)+", L "+(i.x+s)+" "+(i.y-s)+", L"+(i.x+s)+" "+(i.y+s)+", L"+(i.x-s)+" "+(i.y+s)+", L"+(i.x-s)+" "+(i.y-s)

The right code is :

if("diamond"===e){var n="M "+(i.x-s)+" "+i.y+" L "+i.x+" "+(i.y-s)+" L"+(i.x+s)+" "+i.y+" L"+i.x+" "+(i.y+s)+" L"+(i.x-s)+" "+i.y;this._setPath(t,n)}
if("square"===e){var n="M "+(i.x-s)+" "+(i.y-s)+" L "+(i.x+s)+" "+(i.y-s)+" L"+(i.x+s)+" "+(i.y+s)+" L"+(i.x-s)+" "+(i.y+s)+" L"+(i.x-s)+" "+(i.y-s)
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.