[OpenLayers-Users] OpenLayers.Layer.WMS - using SVG Format?

Harris Hudson hhudson at katmandu.org
Fri Dec 14 22:37:47 PST 2012


Using OpenLayers.Layer.WMS to add a WMS SVG (image/svg+xml) format layer
should work fine for modern browsers.  I've successfully added WMS SVG
layers using OpenLayers.Layer.WMS where the layer tiles are added to the
map based either on the <img> tag or the <iframe> tag.  You might just need
to have <!DOCTYPE html> at the top of your page for versions of IE that
support SVG.

In non standard cases where your WMS produces a non-static or an interactive
SVG layer, or an SVG layer that has external styling for example, then you
might consider trying OpenLayers.Layer.WMS.InlineXhtml from the InlineXhtml
Addin.

Regards,

Harris.

> Hi, just wondering if instead of pushing out an OpenLayers.Layer.WMS as
> format:image/png I can use svg. My getcapabilities request of my WMS says
> that is supports SVG with the following -
>
> - <GetMap>
>   <Format>image/png</Format>
>   <Format>image/jpeg</Format>
>   <Format>image/svg+xml</Format>
>   <Format>svgz</Format>
>
> However when I declare a WMS layer with svg format it does not show, is
> there any way to use SVG with a WMS layer? Thanks.
>
>  layer_Overview = new OpenLayers.Layer.WMS("Overview Map Layers", wms, {
>     layers: ["OVERVIEW_County", "OVERVIEW_City_Boundaries",
> "OVERVIEW_Roads", "OVERVIEW_River", "OVERVIEW_Roads_Highways"],
>     VERSION: "1.3.0",
>     format: 'image/svg+xml'
> }, {
>     isBaseLayer: true,
>     displayInLayerSwitcher: false,
>     singleTile: true,
>     buffer: 1,
>     ratio: 1
> });
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.n6.nabble.com/OpenLayers-Layer-WMS-using-SVG-Format-tp5023159.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>




More information about the Users mailing list