OpenLayers OpenLayers

Changeset 6402

Show
Ignore:
Timestamp:
02/28/08 17:46:43 (11 months ago)
Author:
euzuro
Message:

bringing up to date from trunk 6325:trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/euzuro/pop/build/full.cfg

    r3601 r6402  
    1414Firebug/firebug.js 
    1515Firebug/firebugx.js 
     16OpenLayers/Lang/de.js 
     17OpenLayers/Lang/en-CA.js 
     18OpenLayers/Lang/fr.js 
  • sandbox/euzuro/pop/examples/fractional-zoom.html

    r6253 r6402  
    1414 
    1515        function init() { 
    16             map = new OpenLayers.Map('map'); 
     16            map = new OpenLayers.Map('map',  
     17                 {controls: [new OpenLayers.Control.Navigation(),  
     18                             new OpenLayers.Control.PanZoomBar()],  
     19                  numZoomLevels: 10 }); 
    1720            var wms = new OpenLayers.Layer.WMS( 
    1821                "OpenLayers WMS", 
     
    2326 
    2427            map.events.register("moveend", null, displayZoom); 
    25             map.addControl( new OpenLayers.Control.LayerSwitcher() ); 
    2628 
    2729            map.zoomToMaxExtent(); 
     
    3739        function update(input) { 
    3840            map.fractionalZoom = input.checked; 
     41            map.zoomTo(Math.round(map.zoom)); 
    3942        } 
    4043    </script> 
  • sandbox/euzuro/pop/lib/OpenLayers.js

    r6325 r6402  
    105105            "OpenLayers/Layer/HTTPRequest.js", 
    106106            "OpenLayers/Layer/Grid.js", 
     107            "OpenLayers/Layer/MapGuide.js", 
    107108            "OpenLayers/Layer/MapServer.js", 
    108109            "OpenLayers/Layer/MapServer/Untiled.js", 
  • sandbox/euzuro/pop/lib/OpenLayers/Control/OverviewMap.js

    r6325 r6402  
    328328                                                   newTop)); 
    329329        this.updateMapToRect(); 
    330         OpenLayers.Event.stop(evt); 
    331330    }, 
    332331 
  • sandbox/euzuro/pop/lib/OpenLayers/Control/PanZoomBar.js

    r6253 r6402  
    242242        var y = evt.xy.y; 
    243243        var top = OpenLayers.Util.pagePosition(evt.object)[1]; 
    244         var levels = Math.floor((y - top)/this.zoomStopHeight); 
    245         this.map.zoomTo((this.map.getNumZoomLevels() -1) -  levels); 
     244        var levels = (y - top)/this.zoomStopHeight; 
     245        var zoom = (this.map.getNumZoomLevels() - 1) - levels;  
     246        if(this.map.fractionalZoom) { 
     247           zoom = Math.min(Math.max(zoom, 0), this.map.getNumZoomLevels() - 1); 
     248        } else { 
     249            zoom = Math.floor(zoom); 
     250        }     
     251        this.map.zoomTo(zoom); 
    246252        OpenLayers.Event.stop(evt); 
    247253    }, 
     
    315321            }); 
    316322            var deltaY = this.zoomStart.y - evt.xy.y; 
    317             this.map.zoomTo(this.map.zoom + Math.round(deltaY/this.zoomStopHeight)); 
     323            var zoomLevel = this.map.zoom; 
     324            if (this.map.fractionalZoom) { 
     325                zoomLevel += deltaY/this.zoomStopHeight; 
     326                zoomLevel = Math.min(Math.max(zoomLevel, 0),  
     327                                     this.map.getNumZoomLevels() - 1); 
     328            } else { 
     329                zoomLevel += Math.round(deltaY/this.zoomStopHeight); 
     330            } 
     331            this.map.zoomTo(zoomLevel); 
    318332            this.moveZoomBar(); 
    319333            this.mouseDragStart = null; 
  • sandbox/euzuro/pop/lib/OpenLayers/Format/WFS.js

    r6325 r6402  
    190190            return false;  
    191191        } 
    192         var deleteNode = this.createElementNS(this.featureNS, 'wfs:Delete'); 
     192        var deleteNode = this.createElementNS(this.wfsns, 'wfs:Delete'); 
    193193        deleteNode.setAttribute("typeName", this.layerName); 
    194194 
  • sandbox/euzuro/pop/lib/OpenLayers/Format/WMC.js

    r6253 r6402  
    8888        var context = this.parser.read(data, options); 
    8989        var map; 
    90         if(options.map instanceof OpenLayers.Map) { 
    91             map = this.mergeContextToMap(context, options.map); 
     90        if(options.map) { 
     91            this.context = context; 
     92            if(options.map instanceof OpenLayers.Map) { 
     93                map = this.mergeContextToMap(context, options.map); 
     94            } else { 
     95                map = this.contextToMap(context, options.map); 
     96            } 
    9297        } else { 
    93             map = this.contextToMap(context, options.map); 
     98            // not documented as part of the API, provided as a non-API option 
     99            map = context; 
    94100        } 
    95101        return map; 
  • sandbox/euzuro/pop/lib/OpenLayers/Format/WMC/v1.js

    r6136 r6402  
    123123            childNode = children[i]; 
    124124            if(childNode.nodeType == 1) { 
    125                 prefix = (childNode.prefix == this.rootPrefix) ? 
    126                             this.defaultPrefix : 
    127                             this.getNamespacePrefix(childNode.namespaceURI); 
     125                prefix = this.getNamespacePrefix(childNode.namespaceURI); 
    128126                local = childNode.nodeName.split(":").pop(); 
    129127                processor = this["read_" + prefix + "_" + local]; 
     
    313311        this.runChildNodes(style, node); 
    314312        if(node.getAttribute("current") == "1") { 
    315             layerInfo.params.style = style.name; 
     313            // three style types to consider 
     314            // 1) linked SLD 
     315            // 2) inline SLD 
     316            // 3) named style 
     317            // running child nodes always gets name, optionally gets href or body 
     318            if(style.href) { 
     319                layerInfo.params.sld = style.href; 
     320            } else if(style.body) { 
     321                layerInfo.params.sld_body = style.body; 
     322            } else { 
     323                layerInfo.params.styles = style.name; 
     324            } 
    316325        } 
    317326        layerInfo.styles.push(style); 
     327    }, 
     328     
     329    /** 
     330     * Method: read_wmc_SLD 
     331     */ 
     332    read_wmc_SLD: function(style, node) { 
     333        this.runChildNodes(style, node); 
     334        // style either comes back with an href or a body property 
     335    }, 
     336     
     337    /** 
     338     * Method: read_sld_StyledLayerDescriptor 
     339     */ 
     340    read_sld_StyledLayerDescriptor: function(sld, node) { 
     341        var xml = OpenLayers.Format.XML.prototype.write.apply(this, [node]); 
     342        sld.body = xml; 
    318343    }, 
    319344 
     
    732757            "Style", null, {current: "1"} 
    733758        ); 
    734         var name = layer.params["STYLES"] ? 
    735             layer.params["STYLES"] : this.defaultStyleName; 
    736          
    737         style.appendChild(this.createElementDefaultNS("Name", name)); 
    738         style.appendChild(this.createElementDefaultNS( 
    739             "Title", this.defaultStyleTitle 
    740         )); 
     759         
     760        // Style can come from one of three places (prioritized as below): 
     761        // 1) an SLD parameter 
     762        // 2) and SLD_BODY parameter 
     763        // 3) the STYLES parameter 
     764         
     765        if(layer.params["SLD"]) { 
     766            // create link from SLD parameter 
     767            var sld = this.createElementDefaultNS("SLD"); 
     768            var link = this.write_wmc_OnlineResource(layer.params["SLD"]); 
     769            sld.appendChild(link); 
     770            style.appendChild(sld); 
     771        } else if(layer.params["SLD_BODY"]) { 
     772            // include sld fragment from SLD_BODY parameter 
     773            var sld = this.createElementDefaultNS("SLD"); 
     774            var body = layer.params["SLD_BODY"]; 
     775            // read in body as xml doc - assume proper namespace declarations 
     776            var doc = OpenLayers.Format.XML.prototype.read.apply(this, [body]); 
     777            // append to StyledLayerDescriptor node 
     778            var imported = doc.documentElement; 
     779            if(sld.ownerDocument && sld.ownerDocument.importNode) { 
     780                imported = sld.ownerDocument.importNode(imported, true); 
     781            } 
     782            sld.appendChild(imported); 
     783            style.appendChild(sld);             
     784        } else { 
     785            // use name(s) from STYLES parameter 
     786            var name = layer.params["STYLES"] ? 
     787                layer.params["STYLES"] : this.defaultStyleName; 
     788             
     789            style.appendChild(this.createElementDefaultNS("Name", name)); 
     790            style.appendChild(this.createElementDefaultNS( 
     791                "Title", this.defaultStyleTitle 
     792            )); 
     793        } 
    741794        node.appendChild(style); 
    742795        return node; 
  • sandbox/euzuro/pop/lib/OpenLayers/Layer.js

    r6253 r6402  
    716716 
    717717            // determine numZoomLevels if not already set on the layer 
     718            // this gives numZoomLevels assuming approximately base 2 scaling 
    718719            if (confProps.minResolution != null && 
    719720                this.options.numZoomLevels == undefined) { 
     
    728729            var base = 2; 
    729730            if(typeof confProps.minResolution == "number" && 
    730                this.options.numZoomLevels > 1) { 
     731               confProps.numZoomLevels > 1) { 
    731732                /** 
    732                  * If numZoomLevels is explicitly set in the layer options, 
    733                  * respect it.  If numZoomLevels is not specified, we use 
    734                  * exponential scaling with a base of 2.  If numZoomLevels 
    735                  * is specified, we use exponential scaling and determine the 
    736                  * appropriate base so minResolution is reached. 
     733                 * If maxResolution and minResolution are set (or related 
     734                 * scale properties), we calculate the base for exponential 
     735                 * scaling that starts at maxResolution and ends at 
     736                 * minResolution in numZoomLevels steps. 
    737737                 */ 
    738738                base = Math.pow( 
  • sandbox/euzuro/pop/lib/OpenLayers/Layer/Vector.js

    r6325 r6402  
    151151         
    152152        // concatenate events specific to vector with those from the base 
    153         this.EVENT_TYPES = this.EVENT_TYPES.concat( 
     153        this.EVENT_TYPES = 
     154            OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat( 
    154155            OpenLayers.Layer.prototype.EVENT_TYPES 
    155156        ); 
     
    271272        if (!dragging) { 
    272273            this.renderer.root.style.visibility = "hidden"; 
     274            // force a reflow on gecko based browsers to actually hide the svg 
     275            if (navigator.userAgent.toLowerCase().indexOf("gecko") != -1) { 
     276                this.div.scrollLeft = this.div.scrollLeft; 
     277            } 
    273278             
    274279            this.div.style.left = -parseInt(this.map.layerContainerDiv.style.left) + "px"; 
  • sandbox/euzuro/pop/lib/OpenLayers/Map.js

    r6325 r6402  
    4747     * 
    4848     * Supported map event types: 
     49     *  - *preaddlayer* triggered before a layer has been added.  The event 
     50     *      object will include a *layer* property that references the layer   
     51     *      to be added. 
    4952     *  - *addlayer* triggered after a layer has been added.  The event object 
    5053     *      will include a *layer* property that references the added layer. 
     
    7578     */ 
    7679    EVENT_TYPES: [  
    77         "addlayer", "removelayer", "changelayer", "movestart", "move",  
    78         "moveend", "zoomend", "popupopen", "popupclose", 
     80        "preaddlayer", "addlayer", "removelayer", "changelayer", "movestart", 
     81        "move", "moveend", "zoomend", "popupopen", "popupclose", 
    7982        "addmarker", "removemarker", "clearmarkers", "mouseover", 
    8083        "mouseout", "mousemove", "dragstart", "drag", "dragend", 
     
    316319     */ 
    317320    fallThrough: true, 
     321     
     322    /** 
     323     * Property: panTween 
     324     * {OpenLayers.Tween} Animated panning tween object, see panTo() 
     325     */ 
     326    panTween: null, 
    318327 
    319328    /** 
     
    733742            } 
    734743        }     
     744 
     745        this.events.triggerEvent("preaddlayer", {layer: layer}); 
    735746         
    736747        layer.div.className = "olLayerDiv"; 
     
    14391450        if (zoomChanged || centerChanged || !dragging) { 
    14401451 
    1441             if (!dragging && !noEvent) { 
     1452            if (!this.dragging && !noEvent) { 
    14421453                this.events.triggerEvent("movestart"); 
    14431454            } 
     
    15121523            this.events.triggerEvent("moveend"); 
    15131524        } 
     1525         
     1526        // Store the map dragging state for later use 
     1527        this.dragging = !!dragging;  
     1528 
    15141529    }, 
    15151530 
  • sandbox/euzuro/pop/lib/OpenLayers/Popup.js

    r6390 r6402  
    289289    updatePosition: function() { 
    290290        if ((this.lonlat) && (this.map)) { 
    291                 var px = this.map.getLayerPxFromLonLat(this.lonlat); 
    292                 if (px) { 
    293                     this.moveTo(px);            
    294                 }     
     291            var px = this.map.getLayerPxFromLonLat(this.lonlat); 
     292            if (px) { 
     293                this.moveTo(px);            
     294            }     
    295295        } 
    296296    }, 
  • sandbox/euzuro/pop/lib/OpenLayers/Renderer/SVG.js

    r6253 r6402  
    193193        style = style  || node._style; 
    194194        options = options || node._options; 
    195         if (node._geometryClass == "OpenLayers.Geometry.Point") { 
     195        var x = node.getAttributeNS(null, "cx"); 
     196        // if x equals "", the node is outside the valid range 
     197        if (node._geometryClass == "OpenLayers.Geometry.Point" && x) { 
    196198            if (style.externalGraphic) { 
    197                 var x = parseFloat(node.getAttributeNS(null, "cx")); 
     199                x = parseFloat(x); 
    198200                var y = parseFloat(node.getAttributeNS(null, "cy")); 
    199201                 
     
    338340            node.setAttributeNS(null, "r", radius); 
    339341        } else { 
    340             if (node.parentNode == this.root) { 
    341                 this.root.removeChild(node); 
    342             } 
     342            node.setAttributeNS(null, "cx", ""); 
     343            node.setAttributeNS(null, "cy", ""); 
     344            node.setAttributeNS(null, "r", 0); 
    343345        }     
    344346             
  • sandbox/euzuro/pop/lib/OpenLayers/Rule.js

    r6136 r6402  
    2323    /** 
    2424     * Property: context 
    25      * {Object} An optional object with properties that the rule and its 
    26      * symbolizers' property values should be evaluatad against. If no 
    27      * context is specified, feature.attributes will be used 
     25     * {Object} An optional object with properties that the rule should be 
     26     * evaluatad against. If no context is specified, feature.attributes will 
     27     * be used. 
    2828     */ 
    2929    context: null, 
     
    4141    /** 
    4242     * Property: symbolizer 
    43      * {Object} Hash of styles for this rule. Contains hashes of feature 
    44      * styles. Keys are one or more of ["Point", "Line", "Polygon"] 
     43     * {Object} Symbolizer or hash of symbolizers for this rule. If hash of 
     44     * symbolizers, keys are one or more of ["Point", "Line", "Polygon"] 
    4545     */ 
    4646    symbolizer: null, 
  • sandbox/euzuro/pop/lib/OpenLayers/Style.js

    r6253 r6402  
    4242     
    4343    /** 
     44     * Property: context 
     45     * {Object} An optional object with properties that symbolizers' property 
     46     * values should be evaluatad against. If no context is specified, 
     47     * feature.attributes will be used 
     48     */ 
     49    context: null, 
     50 
     51    /** 
    4452     * Property: defaultStyle 
    4553     * {Object} hash of style properties to use as default for merging 
     
    117125        for(var i=0; i<rules.length; i++) { 
    118126            rule = rules[i]; 
    119             context = rule.context; 
    120             if (!context) { 
    121                 context = feature.attributes || feature.data; 
    122             } 
    123127            // does the rule apply? 
    124128            var applies = rule.evaluate(feature); 
     
    129133                } else { 
    130134                    appliedRules = true; 
    131                     this.applySymbolizer(rule, style, feature, context); 
     135                    this.applySymbolizer(rule, style, feature); 
    132136                } 
    133137            } 
     
    138142            appliedRules = true; 
    139143            for(var i=0; i<elseRules.length; i++) { 
    140                 this.applySymbolizer(elseRules[i], style, feature, context); 
     144                this.applySymbolizer(elseRules[i], style, feature); 
    141145            } 
    142146        } 
     
    159163     * style - {Object} 
    160164     * feature - {<OpenLayer.Feature.Vector>} 
    161      * context - {Object} 
    162165     * 
    163166     * Returns: 
    164167     * {Object} A style with new symbolizer applied. 
    165168     */ 
    166     applySymbolizer: function(rule, style, feature, context) { 
     169    applySymbolizer: function(rule, style, feature) { 
    167170        var symbolizerPrefix = feature.geometry ? 
    168171                this.getSymbolizerPrefix(feature.geometry) : 
    169172                OpenLayers.Style.SYMBOLIZER_PREFIXES[0]; 
    170173 
    171         var symbolizer = rule.symbolizer[symbolizerPrefix]; 
    172  
     174        var symbolizer = rule.symbolizer[symbolizerPrefix] || rule.symbolizer; 
     175 
     176        var context = this.context || feature.attributes || feature.data; 
     177         
    173178        // merge the style with the current style 
    174179        return this.createLiterals( 
     
    213218        // check the default style 
    214219        var style = this.defaultStyle; 
    215         for (var i in style) { 
    216             if (typeof style[i] == "string" && style[i].match(/\$\{\w+\}/)) {   
    217                 propertyStyles[i] = true; 
    218             } 
    219         } 
     220        this.addPropertyStyles(propertyStyles, style); 
    220221 
    221222        // walk through all rules to check for properties in their symbolizer 
    222223        var rules = this.rules; 
    223         var prefixes = OpenLayers.Style.SYMBOLIZER_PREFIXES
     224        var symbolizer, value
    224225        for (var i=0; i<rules.length; i++) { 
    225             for (var s=0; s<prefixes.length; s++) { 
    226                 style = rules[i].symbolizer[prefixes[s]]; 
    227                 for (var j in style) { 
    228                     if (typeof style[j] == "string" && 
    229                             style[j].match(/\$\{\w+\}/)) { 
    230                         propertyStyles[j] = true; 
    231                     } 
     226            var symbolizer = rules[i].symbolizer; 
     227            for (var key in symbolizer) { 
     228                value = symbolizer[key]; 
     229                if (typeof value == "object") { 
     230                    // symbolizer key is "Point", "Line" or "Polygon" 
     231                    this.addPropertyStyles(propertyStyles, value); 
     232                } else { 
     233                    // symbolizer is a hash of style properties 
     234                    this.addPropertyStyles(propertyStyles, symbolizer); 
     235                    break; 
    232236                } 
     237            } 
     238        } 
     239        return propertyStyles; 
     240    }, 
     241     
     242    /** 
     243     * Method: addPropertyStyles 
     244     *  
     245     * Parameters: 
     246     * propertyStyles - {Object} hash to add new property styles to. Will be 
     247     *                  modified inline 
     248     * symbolizer     - {Object} search this symbolizer for property styles 
     249     *  
     250     * Returns: 
     251     * {Object} propertyStyles hash 
     252     */ 
     253    addPropertyStyles: function(propertyStyles, symbolizer) { 
     254        var property; 
     255        for (var key in symbolizer) { 
     256            property = symbolizer[key]; 
     257            if (typeof property == "string" && 
     258                    property.match(/\$\{\w+\}/)) { 
     259                propertyStyles[key] = true; 
    233260            } 
    234261        } 
  • sandbox/euzuro/pop/lib/OpenLayers/StyleMap.js

    r6253 r6402  
    111111            this.styles[intent].createSymbolizer(feature)); 
    112112    }, 
     113     
     114    /** 
     115     * Method: addUniqueValueRules 
     116     * Convenience method to create comparison rules for unique values of a 
     117     * property. The rules will be added to the style object for a specified 
     118     * rendering intent. This method is a shortcut for creating something like 
     119     * the "unique value legends" familiar from well known desktop GIS systems 
     120     *  
     121     * Parameters: 
     122     * renderIntent - {String} rendering intent to add the rules to 
     123     * property     - {String} values of feature attributes to create the 
     124     *                rules for 
     125     * symbolizers  - {Object} Hash of symbolizers, keyed by the desired 
     126     *                property values  
     127     */ 
     128    addUniqueValueRules: function(renderIntent, property, symbolizers) { 
     129        var rules = []; 
     130        for (var value in symbolizers) { 
     131            rules.push(new OpenLayers.Rule.Comparison({ 
     132                type: OpenLayers.Rule.Comparison.EQUAL_TO, 
     133                property: property, 
     134                value: value, 
     135                symbolizer: symbolizers[value]})); 
     136        } 
     137        this.styles[renderIntent].addRules(rules); 
     138    }, 
    113139 
    114140    CLASS_NAME: "OpenLayers.StyleMap" 
  • sandbox/euzuro/pop/lib/OpenLayers/Tween.js

    r6136 r6402  
    5959    interval: null, 
    6060     
     61    /** 
     62     * Property: playing 
     63     * {Boolean} Tells if the easing is currently playing 
     64     */ 
     65    playing: false, 
     66     
    6167    /**  
    6268     * Constructor: OpenLayers.Tween 
     
    8187     */ 
    8288    start: function(begin, finish, duration, options) { 
     89        this.playing = true; 
    8390        this.begin = begin; 
    8491        this.finish = finish; 
     
    99106    /** 
    100107     * APIMethod: stop 
    101      * Stops the Tween, and calls the finish callback 
     108     * Stops the Tween, and calls the done callback 
     109     *     Doesn't do anything if animation is already finished 
    102110     */ 
    103111    stop: function() { 
     112        if (!this.playing) { 
     113            return; 
     114        } 
     115         
    104116        if (this.callbacks && this.callbacks.done) { 
    105117            this.callbacks.done.call(this, this.finish); 
     
    107119        window.clearInterval(this.interval); 
    108120        this.interval = null; 
     121        this.playing = false; 
    109122    }, 
    110123     
     
    134147            if (this.callbacks && this.callbacks.done) { 
    135148                this.callbacks.done.call(this, this.finish); 
     149                this.playing = false; 
    136150            } 
    137151            window.clearInterval(this.interval); 
  • sandbox/euzuro/pop/tests/Format/test_XML.html

    r6136 r6402  
    4444         
    4545        var format = new OpenLayers.Format.XML(); 
    46         t.plan(format.xmldom ? 11 : 10); 
     46        t.plan(format.xmldom ? 10 : 9); 
    4747 
    4848        var doc = format.read(text); 
     
    5353        t.ok(doc.documentElement, 
    5454             "ok to access doc.documentElement"); 
    55         t.eq(doc.documentElement.nodeName, "ol:root", 
    56              "doc root has the correct node name"); 
    57         t.eq(doc.documentElement.childNodes[1].firstChild.nodeValue, "junk2", 
    58              "second child of doc root has correct child node"); 
     55        t.xml_eq(doc.documentElement, text, 
     56                 "doc.documentElement correctly read"); 
    5957         
    6058        // read can also be called on the prototype directly 
     
    6664        t.ok(doc.documentElement, 
    6765             "ok to access doc.documentElement"); 
    68         t.eq(doc.documentElement.nodeName, "ol:root", 
    69              "doc root has the correct node name"); 
    70         t.eq(doc.documentElement.childNodes[1].firstChild.nodeValue, "junk2", 
    71              "second child of doc root has correct child node"); 
     66        t.xml_eq(doc.documentElement, text, 
     67                 "doc.documentElement correctly read"); 
    7268         
    7369        // where appropriate, make sure doc is loaded into xmldom property 
    7470        if(format.xmldom) { 
    75             t.eq(format.xmldom.documentElement.childNodes[1].firstChild.nodeValue, 
    76                  "junk2", 
    77                  "second child of doc root has correct child node"); 
     71            t.xml_eq(format.xmldom.documentElement, text, 
     72                     "xmldom.documentElement contains equivalent xml"); 
    7873        } 
     74         
     75        // test equivalence with different namespace alias 
     76        var pre1 =  
     77            "<pre1:parent xmlns:pre1='http://namespace'>" + 
     78                "<pre1:child1>value2</pre1:child1>" + 
     79                "<pre1:child2 pre1:attr1='foo'>value2</pre1:child2>" + 
     80                "<pre1:child3 chicken:attr='hot' xmlns:chicken='http://soup'/>" + 
     81            "</pre1:parent>"; 
     82        var pre2 =  
     83            "<pre2:parent xmlns:pre2='http://namespace'>" + 
     84                "<pre2:child1>value2</pre2:child1>" + 
     85                "<pre2:child2 pre2:attr1='foo'>value2</pre2:child2>" + 
     86                "<pre2:child3 pea:attr='hot' xmlns:pea='http://soup'/>" + 
     87            "</pre2:parent>"; 
     88        var doc1 = format.read(pre1); 
     89        t.xml_eq(doc1.documentElement, pre2, "read correctly sets namespaces"); 
     90         
    7991    } 
    8092 
  • sandbox/euzuro/pop/tests/Renderer/test_SVG.html

    r6136 r6402  
    156156        r.drawCircle(node, geometry, "blah_4000"); 
    157157         
    158         t.eq(node.getAttributeNS(null, 'cx'), '2', "cx is correct"); 
    159         t.eq(node.getAttributeNS(null, 'cy'), '-4', "cy is correct"); 
    160         t.eq(node.getAttributeNS(null, 'r'), '3', "r is correct"); 
     158        t.eq(node.getAttributeNS(null, 'cx'), '', "cx is correct"); 
     159        t.eq(node.getAttributeNS(null, 'cy'), '', "cy is correct"); 
     160        t.eq(node.getAttributeNS(null, 'r'), '0', "r is correct"); 
    161161    } 
    162162     
  • sandbox/euzuro/pop/tests/Rule/test_Comparison.html

    r6136 r6402  
    3939     
    4040    function test_Comparison_evaluate(t) { 
    41         t.plan(3); 
     41        t.plan(4); 
    4242         
    4343        var rule = new OpenLayers.Rule.Comparison({ 
     
    6363                    " evaluates to "+result.toString()+" correctly."); 
    6464        } 
     65        rule.context = { 
     66            area: 4998 
     67        } 
     68        var result = rule.evaluate(); 
     69        t.eq(result, true, "evaluation against custom rule context works."); 
    6570    } 
    6671    </script>  
  • sandbox/euzuro/pop/tests/Tile/test_WFS.html

    r6136 r6402  
    3030        t.plan(2); 
    3131 
    32        var tile = { 
    33            'request': {} 
    34        }; 
    35              
    36        OpenLayers.Tile.WFS.prototype.requestSuccess.apply(tile, []); 
    37          
    38        t.ok(tile.request == null, "request property on tile set to null"); 
     32        var tile = { 
     33            'request': {} 
     34        }; 
     35             
     36        OpenLayers.Tile.WFS.prototype.requestSuccess.apply(tile, []); 
     37         
     38        t.ok(tile.request == null, "request property on tile set to null"); 
    3939 
    4040        var layer = {}; // bogus layer 
     
    5252     
    5353    function test_Tile_WFS_loadFeaturesForRegion(t) { 
    54        t.plan(9); 
    55          
    56        var tile = { 
    57            'url': {} 
    58        }; 
     54        t.plan(9); 
     55         
     56        var tile = { 
     57            'url': {} 
     58        }; 
    5959 
    60         var g_Success = {};      
     60        var g_Success = {};         
    6161 
    62        var tLoadURL = OpenLayers.loadURL; 
    63        OpenLayers.loadURL = function(url, params, caller, onComplete) { 
    64            t.ok(url == tile.url, "tile's url correctly passed as 1st param to loadURL"); 
    65            t.ok(params == null, "null passed as 2nd param to loadURL"); 
    66            t.ok(caller == tile, "tile passed as 3rd param to loadURL"); 
    67            t.ok(onComplete == g_Success, "success param from loadFeaturesForRegion() passed as 4th param to loadURL"); 
    68        }; 
    69          
    70      //no running request -- 4 tests 
    71        OpenLayers.Tile.WFS.prototype.loadFeaturesForRegion.apply(tile, [g_Success]); 
     62        var tLoadURL = OpenLayers.loadURL; 
     63        OpenLayers.loadURL = function(url, params, caller, onComplete) { 
     64            t.ok(url == tile.url, "tile's url correctly passed as 1st param to loadURL"); 
     65            t.ok(params == null, "null passed as 2nd param to loadURL"); 
     66            t.ok(caller == tile, "tile passed as 3rd param to loadURL"); 
     67            t.ok(onComplete == g_Success, "success param from loadFeaturesForRegion() passed as 4th param to loadURL"); 
     68        }; 
     69         
     70      //no running request -- 4 tests 
     71        OpenLayers.Tile.WFS.prototype.loadFeaturesForRegion.apply(tile, [g_Success]); 
    7272 
    73      //running request (cancelled) -- 4 tests + 1 test (for request abort) 
    74        tile.request = { 
    75            'transport': { 
    76                'abort': function() { 
    77                    t.ok(true, "request aborted"); 
    78                
    79            
    80        }; 
    81        OpenLayers.Tile.WFS.prototype.loadFeaturesForRegion.apply(tile, [g_Success]); 
    82                  
    83        OpenLayers.loadURL = tLoadURL; 
     73      //running request (cancelled) -- 4 tests + 1 test (for request abort) 
     74        tile.request = { 
     75            transport: { 
     76                'abort': function() { 
     77                        t.ok(true, "request aborted"); 
     78               
     79           
     80        }; 
     81        OpenLayers.Tile.WFS.prototype.loadFeaturesForRegion.apply(tile, [g_Success]); 
     82                 
     83        OpenLayers.loadURL = tLoadURL; 
    8484    } 
    8585     
  • sandbox/euzuro/pop/tests/list-tests.html

    r6325 r6402  
    3333    <li>Format/test_WMC.html</li> 
    3434    <li>Format/WMC/test_v1_1_0.html</li> 
     35    <li>Format/WMC/test_v1.html</li> 
    3536    <li>Format/test_XML.html</li> 
    3637    <li>test_Icon.html</li> 
     
    6263    <li>Layer/test_Image.html</li> 
    6364    <li>Layer/test_KaMap.html</li> 
     65    <li>Layer/test_MapGuide.html</li> 
    6466    <li>Layer/test_MapServer.html</li> 
    6567    <li>Layer/test_Markers.html</li> 
  • sandbox/euzuro/pop/tests/manual/ajax.html

    r6136 r6402  
    2323        function sendSynchronous(){ 
    2424            var request = new OpenLayers.Ajax.Request(url, { 
     25               'asynchronous': false, 
    2526                onComplete: function() { 
    2627                    document.getElementById('send_sync').value += 'request completed\n'; 
     
    3132        function sendAsynchronous(){ 
    3233            var request = new OpenLayers.Ajax.Request(url, { 
    33                'asynchronous': false, 
    3434                onComplete: function() {