More

Qgis2web fails to display points with SVG markers

Qgis2web fails to display points with SVG markers


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.


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


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.


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)