Very simple webgis in just one single svg file

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Very simple webgis in just one single svg file

magerlin
Try this!

1) Export your map from your print composer as svg
2) Add a link to the saved SVG file in line 69 of this file: QGIS_svg_pan_zoom.svg (just edit it in a text editor)
3) Adjust the height and width in line 5 and 6 if you like

Open QGIS_svg_pan_zoom.svg in your browser and you can have something like THIS!
 
Perhaps some kind of pan and zoom function could be added automatically when exporting as svg from QGIS? As a new plugin? Anybody to take it from here?
 
I am no programmer and I owe all the svg credit to this guy: www.petercollingridge.co.uk

Be aware that the svg files can be rather big and perhaps not suitable for the net. It also seems like IE doesn't like big svg files - it simply leaves out some of the content! I have not seen this in Google and Firefox.
 





Regards Morten

Currently using Qgis 3.10.0
Windows 10, 64bit
Reply | Threaded
Open this post in threaded view
|

Re: Very simple webgis in just one single svg file

Jonathan Moules-2
That's quite interesting, thanks for sharing! I always wondered what use exporting as a SVG was; now I know. :-)


On 24 February 2014 17:45, magerlin <[hidden email]> wrote:
Try this!

1) Export your map from your print composer as svg
2) Add a link to the saved SVG file in line 69 of this file:
QGIS_svg_pan_zoom.svg
<http://osgeo-org.1560.x6.nabble.com/file/n5105612/QGIS_svg_pan_zoom.svg>
(just edit it in a text editor)
3) Adjust the height and width in line 5 and 6 if you like

Open QGIS_svg_pan_zoom.svg in your browser and you can have something like
THIS <http://byogtrafik.ramboll.dk/SandBox/QGIS_svg/QGIS_svg_pan_zoom.svg>
!

Perhaps some kind of pan and zoom function could be added automatically when
exporting as svg from QGIS? As a new plugin? Anybody to take it from here?

I am no programmer and I owe all the svg credit to this guy:
www.petercollingridge.co.uk <http://www.petercollingridge.co.uk>

Be aware that the svg files can be rather big and perhaps not suitable for
the net. It also seems like IE doesn't like big svg files - it simply leaves
out some of the content! I have not seen this in Google and Firefox.










-----
Regards Morten

Qgis 2.0.1 OSGeo,
Windows 7, 64bit
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Very-simple-webgis-in-just-one-single-svg-file-tp5105612.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.
_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user


This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.
_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Very simple webgis in just one single svg file

magerlin
SVG Volume 2:

1) Download this file: Index.svg

2) Export your map as a svg from the print composer and save it as "map.svg"

3) Export a legend as svg from print composer and save it as "legend.svg"

Put the files 1, 2 and 3 in the same folder and open index.svg in your web browser to get this

Once again I have to warn against big svg files - the map.svg file is 3MB in the above example and IE will not show all the coloured building polygons while other browsers do.

Also note that Chrome and Opera can handle compressed svgz files but Mozilla and IE cannot.
Regards Morten

Currently using Qgis 3.10.0
Windows 10, 64bit
Reply | Threaded
Open this post in threaded view
|

Re: Very simple webgis in just one single svg file

Carlos Cerdán
In reply to this post by magerlin
SVG Volume 2.1 (Fixed):

1) Download this file:  Index.svg
<http://byogtrafik.ramboll.dk/SandBox/QGIS_svg/Index.svg>

2) Export your own map as a svg from the print composer and save it as "Map.svg" (Or download http://byogtrafik.ramboll.dk/SandBox/QGIS_svg/map.svg , but save with capital letter "M")

3) Export a legend of previous map as svg from print composer and save it as "Legend.svg" (Or download http://byogtrafik.ramboll.dk/SandBox/QGIS_svg/legend.svg but save with capital letter "L").

IMPORTANT for Linux users: save the file name with first letter capital because if not, it doesn't show the Map and Legend ("Index.svg" is linked to these names - see it with a text editor as gedit)

Put the files 1, 2 and 3 in the same folder and open index.svg in your web browser to get  an amazing SVG map with capabilities of zoom and moving. Some times Internet Explorer doesn't open it, just the code, so it's better to use Firefox or Chrome.

Thank you Magerlin,

Carlos



2014-02-25 14:17 GMT-05:00 magerlin <[hidden email]>:
SVG Volume 2:

1) Download this file:  Index.svg
<http://byogtrafik.ramboll.dk/SandBox/QGIS_svg/Index.svg>

2) Export your map as a svg from the print composer and save it as "map.svg"

3) Export a legend as svg from print composer and save it as "legend.svg"

Put the files 1, 2 and 3 in the same folder and open index.svg in your web
browser to get  this
<http://byogtrafik.ramboll.dk/SandBox/QGIS_svg/Index.svg>

Once again I have to warn against big svg files - the map.svg file is 3MB in
the above example and IE will not show all the coloured building polygons
while other browsers do.

Also note that Chrome and Opera can handle compressed svgz files but Mozilla
and IE cannot.



-----
Regards Morten

Qgis 2.0.1 OSGeo,
Windows 7, 64bit
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Very-simple-webgis-in-just-one-single-svg-file-tp5105612p5105912.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.
_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user


_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Very simple webgis in just one single svg file

magerlin
Hi Carlos

Thanks for "cleaning up" my text: You are right - all filenames must start with a capital letter.

As a Windows user I am not used to care about that....

By the way I have realized that it is not the file size beeing the reason for the map is not showing up complete in IE9.  It apparently has something to do with "wrapping" the Map.svg file inside the Index.svg file. If I open Map.svg directly in IE9 then complete map shows up.

Same difference happens if I include Map.svg in a html document. Using "object" tag shows complete map, while using "img" tag shows incomplete map in IE9 (be patient since it is a big svg file showed twice): SVG in HTML
Regards Morten

Currently using Qgis 3.10.0
Windows 10, 64bit
Reply | Threaded
Open this post in threaded view
|

Re: Very simple webgis in just one single svg file

pcav
In reply to this post by Carlos Cerdán
Il 02/03/2014 06:37, Carlos Cerdán ha scritto:
> SVG Volume 2.1 (Fixed):

Very nice: why not writing a little plugin for this?
It should be quite simple.
All the best.
--
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Very simple webgis in just one single svg file

magerlin
A plugin would be VERY nice but I have no knowledge on writing plugins.
I will be happy if anyone else can make it!

Would the workflow using a plugin be that the user "on his own" creates the Map.svg and eventually a separate Legend.svg file and the runs the plugin supplying it with the file names for the created svg files?

Or could it somehow be integrated in the print composer for instance as an option when exporting as SVG or as a parallel to creating an atlas?

Regards Morten

Currently using Qgis 3.10.0
Windows 10, 64bit
Reply | Threaded
Open this post in threaded view
|

Re: Very simple webgis in just one single svg file

pcav
Il 05/03/2014 10:44, magerlin ha scritto:
> A plugin would be VERY nice but I have no knowledge on writing plugins.
> I will be happy if anyone else can make it!

Please extend this discussion to qgis-dev: if you are lucky there may be
someone able to help you.

> Would the workflow using a plugin be that the user "on his own" creates the
> Map.svg and eventually a separate Legend.svg file and the runs the plugin
> supplying it with the file names for the created svg files?
>
> Or could it somehow be integrated in the print composer for instance as an
> option when exporting as SVG or as a parallel to creating an atlas?

I would see it as a separate function, similar to the html map plugin
currently available: a new entry "create your web map" that creates the
three necessary files (and perhaps displays them in a webkit window).

All the best.
--
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Very simple webgis in just one single svg file

magerlin
Paolo Cavallini wrote
Please extend this discussion to qgis-dev: if you are lucky there may be someone able to help you.
Done: http://osgeo-org.1560.x6.nabble.com/Anybody-in-for-making-a-simple-plugin-to-produce-simple-SVG-web-gis-tp5107674.html
Regards Morten

Currently using Qgis 3.10.0
Windows 10, 64bit
Reply | Threaded
Open this post in threaded view
|

Re: Very simple webgis in just one single svg file

Carlos Cerdán
In reply to this post by pcav
+1

In efect, that plugin would be very nice.

Something to consider about SVG maps is that letters must be changed to "lines?" (it says "trayectos" in Spanish) in order to see it in an internet navigator. I do it using Inkscape.

All the best

Carlos


2014-03-05 4:48 GMT-05:00 Paolo Cavallini <[hidden email]>:
Il 05/03/2014 10:44, magerlin ha scritto:
> A plugin would be VERY nice but I have no knowledge on writing plugins.
> I will be happy if anyone else can make it!

Please extend this discussion to qgis-dev: if you are lucky there may be
someone able to help you.

> Would the workflow using a plugin be that the user "on his own" creates the
> Map.svg and eventually a separate Legend.svg file and the runs the plugin
> supplying it with the file names for the created svg files?
>
> Or could it somehow be integrated in the print composer for instance as an
> option when exporting as SVG or as a parallel to creating an atlas?

I would see it as a separate function, similar to the html map plugin
currently available: a new entry "create your web map" that creates the
three necessary files (and perhaps displays them in a webkit window).

All the best.
--
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user


_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Very simple webgis in just one single svg file

magerlin
Carlos Cerdán wrote
Something to consider about SVG maps is that letters must be changed to "lines?" (it says "trayectos" in Spanish) in order to see it in an internet navigator. I do it using Inkscape.
I do not have any problems showing letters in SVG files created by QGIS.

This map  shows letters in IE9, Chrome, Firefox and Opera in Win 7.

Regards Morten

Currently using Qgis 3.10.0
Windows 10, 64bit
Reply | Threaded
Open this post in threaded view
|

Re: Very simple webgis in just one single svg file

Carlos Cerdán
Sorry, my fault. It's right, text of QGIS is visible, but when we open a map in Inkscape in order to enhance it, added text in this program, is not visible in an internet navigator, so I have to convert it to lines.

I specially do it to make Sozi presentations whit maps. They always let my public with a woou in lips. I recomend it.

Carlos


2014-03-05 9:13 GMT-05:00 magerlin <[hidden email]>:
Carlos Cerdán wrote
> Something to consider about SVG maps is that letters must be changed to
> "lines?" (it says "trayectos" in Spanish) in order to see it in an
> internet navigator. I do it using Inkscape.

I do not have any problems showing letters in SVG files created by QGIS.

This map <http://byogtrafik.ramboll.dk/SandBox/QGIS_svg/with_letters.svg>
shows letters in IE9, Chrome, Firefox and Opera in Win 7.

<http://osgeo-org.1560.x6.nabble.com/file/n5107678/With_letters.png>



-----
Regards Morten

Today using Qgis 2.2 Standalone,
Windows 7, 64bit
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Very-simple-webgis-in-just-one-single-svg-file-tp5105612p5107678.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.
_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user


_______________________________________________
Qgis-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-user