OpenLayers OpenLayers

Changeset 5919

Show
Ignore:
Timestamp:
01/28/08 11:39:05 (1 year ago)
Author:
tschaub
Message:

Adding Web Map Context document parsing for versions 1.0.0 and 1.1.0. This also adds a cross browser setAttributeNS to the XML format. Thanks bartvde for supporting this work. r=crschmidt (closes #100)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers.js

    r5902 r5919  
    186186            "OpenLayers/Format/JSON.js", 
    187187            "OpenLayers/Format/GeoJSON.js", 
     188            "OpenLayers/Format/WMC.js", 
     189            "OpenLayers/Format/WMC/v1.js", 
     190            "OpenLayers/Format/WMC/v1_0_0.js", 
     191            "OpenLayers/Format/WMC/v1_1_0.js", 
    188192            "OpenLayers/Layer/WFS.js", 
    189193            "OpenLayers/Control/MouseToolbar.js", 
  • trunk/openlayers/lib/OpenLayers/Format/XML.js

    r5614 r5919  
    349349        return found; 
    350350    }, 
     351     
     352    /** 
     353     * APIMethod: setAttributeNS 
     354     * Adds a new attribute or changes the value of an attribute with the given 
     355     *     namespace and name. 
     356     * 
     357     * Parameters: 
     358     * node - {Element} Element node on which to set the attribute. 
     359     * uri - {String} Namespace URI for the attribute. 
     360     * name - {String} Qualified name (prefix:localname) for the attribute. 
     361     * value - {String} Attribute value. 
     362     */ 
     363    setAttributeNS: function(node, uri, name, value) { 
     364        if(node.setAttributeNS) { 
     365            node.setAttributeNS(uri, name, value); 
     366        } else { 
     367            if(this.xmldom) { 
     368                if(uri) { 
     369                    var attribute = node.ownerDocument.createNode( 
     370                        2, name, uri 
     371                    ); 
     372                    attribute.nodeValue = value; 
     373                    node.setAttributeNode(attribute); 
     374                } else { 
     375                    node.setAttribute(name, value); 
     376                } 
     377            } else { 
     378                throw "setAttributeNS not implemented"; 
     379            } 
     380        } 
     381    }, 
    351382 
    352383    CLASS_NAME: "OpenLayers.Format.XML"  
  • trunk/openlayers/tests/list-tests.html

    r5902 r5919  
    3030    <li>Format/test_SLD.html</li> 
    3131    <li>Format/test_WKT.html</li> 
     32    <li>Format/test_WMC.html</li> 
    3233    <li>Format/test_XML.html</li> 
    3334    <li>test_Icon.html</li>