Project

General

Profile

Download (2.91 KB) Statistics
| Branch: | Tag: | Revision:
1
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
2
 * full list of contributors). Published under the 2-clause BSD license.
3
 * See license.txt in the OpenLayers distribution or repository for the
4
 * full text of the license. */
5

    
6
/**
7
 * @requires OpenLayers/Format/WMSCapabilities/v1_1_1.js
8
 */
9

    
10
/**
11
 * Class: OpenLayers.Format.WMSCapabilities/v1_1_1_WMSC
12
 * Read WMS-C Capabilities version 1.1.1.
13
 * 
14
 * Inherits from:
15
 *  - <OpenLayers.Format.WMSCapabilities.v1_1_1>
16
 */
17
OpenLayers.Format.WMSCapabilities.v1_1_1_WMSC = OpenLayers.Class(
18
    OpenLayers.Format.WMSCapabilities.v1_1_1, {
19
    
20
    /**
21
     * Property: version
22
     * {String} The specific parser version.
23
     */
24
    version: "1.1.1",
25
    
26
    /**
27
     * Property: profile
28
     * {String} The specific profile
29
     */
30
    profile: "WMSC",
31
    
32
    /**
33
     * Constructor: OpenLayers.Format.WMSCapabilities.v1_1_1
34
     * Create a new parser for WMS-C capabilities version 1.1.1.
35
     *
36
     * Parameters:
37
     * options - {Object} An optional object whose properties will be set on
38
     *     this instance.
39
     */
40

    
41
    /**
42
     * Property: readers
43
     * Contains public functions, grouped by namespace prefix, that will
44
     *     be applied when a namespaced node is found matching the function
45
     *     name.  The function will be applied in the scope of this parser
46
     *     with two arguments: the node being read and a context object passed
47
     *     from the parent.
48
     */
49
    readers: {
50
        "wms": OpenLayers.Util.applyDefaults({
51
            "VendorSpecificCapabilities": function(node, obj) {
52
                obj.vendorSpecific = {tileSets: []};
53
                this.readChildNodes(node, obj.vendorSpecific);
54
            },
55
            "TileSet": function(node, vendorSpecific) {
56
                var tileset = {srs: {}, bbox: {}, resolutions: []};
57
                this.readChildNodes(node, tileset);
58
                vendorSpecific.tileSets.push(tileset);
59
            },
60
            "Resolutions": function(node, tileset) {
61
                var res = this.getChildValue(node).split(" ");
62
                for (var i=0, len=res.length; i<len; i++) {
63
                    if (res[i] != "") {
64
                        tileset.resolutions.push(parseFloat(res[i]));
65
                    }
66
                }
67
            },
68
            "Width": function(node, tileset) {
69
                tileset.width = parseInt(this.getChildValue(node));
70
            },
71
            "Height": function(node, tileset) {
72
                tileset.height = parseInt(this.getChildValue(node));
73
            },
74
            "Layers": function(node, tileset) {
75
                tileset.layers = this.getChildValue(node);
76
            },
77
            "Styles": function(node, tileset) {
78
                tileset.styles = this.getChildValue(node);
79
            }
80
        }, OpenLayers.Format.WMSCapabilities.v1_1_1.prototype.readers["wms"])
81
    },
82

    
83
    CLASS_NAME: "OpenLayers.Format.WMSCapabilities.v1_1_1_WMSC" 
84

    
85
});
(5-5/7)