HSLayers.OWS

HSLayers.OWS() is basic class for WMS, WFS and WCS (and SOS and other layer types) clients.

Fore easier usage, we exposed HSLayers.OWSPanel() function, which creates Ext.Panel containing everything - the WMS, WCS, WFS clients, as well as possibility to add KML, GML and GeoRSS type of layers.

Following code is taken from OWSPanel example

Using HSLayers.OWSPanel

First the JavaScript files

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
        <script type="text/javascript" src="http://hslayers.org/lib/build/OpenLayers-debug.js"></script>
        <script type="text/javascript" src="http://hslayers.org/lib/source/HSLayers.js"></script>
        <script type="text/javascript" src="http://hslayers.org/lib/source/HSLayers/Util.js"></script>

        <script type="text/javascript" src="http://hslayers.org/lib/source/HSLayers/Layer/OWS.js"></script>
        <script type="text/javascript" src="http://hslayers.org/lib/source/HSLayers/Layer/WMS.js"></script>
        <script type="text/javascript" src="http://hslayers.org/lib/source/HSLayers/Layer/WFS.js"></script>
        <script type="text/javascript" src="http://hslayers.org/lib/source/HSLayers/Layer/WCS.js"></script>
        <script type="text/javascript" src="http://hslayers.org/lib/source/HSLayers/OWS.js"></script>
        <script type="text/javascript" src="http://hslayers.org/lib/source/HSLayers/OWS/WMS.js"></script>
        <script type="text/javascript" src="http://hslayers.org/lib/source/HSLayers/OWS/WFS.js"></script>
        <script type="text/javascript" src="http://hslayers.org/lib/source/HSLayers/OWS/WCS.js"></script>

Now the code, first set necessary variables

1
2
3
            OpenLayers.ProxyHost = "/cgi-bin/hsproxy.cgi?url=";
            OpenLayers.ImgPath = "http://hslayers.org/lib/build/img/";
            HSLayers.OWS.proxy4ows = "/cgi-bin/proxy4ows.cgi";

Create the OWS Panel, and use HSLayers.OWS.setMap() function

1
2
3
4
5
6
7
8
            owsPanel = new HSLayers.OWSPanel({
                renderTo: Ext.get("ows"),
                width:400,
                height:400,
                urls: [
                ],
            });
            owsPanel.setMap(map);

In above example, we created some Ext.Panel, and in this panel HSLayers.OWSPanel() was included (with all supported inputs).

Using HSLayers.Layer.WFS and HSLayers.Layer.WCS

Those layers are using server-side script, which will parse Capabilities response from those servers. When the user makes choice about the layers she want’s to display, it will convert the layers into raster images and display them in the map.

Both layers are using Proxy4ows script, for translating WCS and WFS capabilities to WMS capabilities.

Data are transformed from input format (vector, raster) to image format (PNG, JPEG, ...) and target coordinate system.

For WMS servers, which are NOT offering their data in map’s coordinate reference system, OWSProxy is used as well, for performing on-server transformation.

Main Menu


Table Of Contents

Previous topic

HSLayers.InfoPanel

Next topic

HSLayers.Printer

This Page