OpenLayers OpenLayers

Changeset 6067

Show
Ignore:
Timestamp:
02/07/08 22:27:15 (1 year ago)
Author:
crschmidt
Message:

Merge from 6030:HEAD from trunk, primarily to fix up fix to Handler.Click
(See #110)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/crschmidt/animated_panning/doc/authors.txt

    r6032 r6067  
    11OpenLayers contributors: 
    22 
     3Seb Benthall 
    34Howard Butler 
    45Bertil Chaupis                                                                
     
    2526James Stembridge 
    2627Erik Uzureau 
     28Ivan Willig 
    2729Bill Woodall 
    2830Steve Woodbridge 
  • sandbox/crschmidt/animated_panning/examples/click-handler.html

    r5438 r6067  
    3939                    'single': true, 
    4040                    'double': false, 
    41                     'pixelTolerance': null
     41                    'pixelTolerance': 0
    4242                    'stopSingle': false, 
    4343                    'stopDouble': false 
     
    103103                        } 
    104104                    }), 
    105                     "nodrag": new OpenLayers.Control.Click({ 
     105                    "drag": new OpenLayers.Control.Click({ 
    106106                        handlerOptions: { 
    107107                            "single": true, 
    108                             "pixelTolerance": 1 
     108                            "pixelTolerance": null 
    109109                        } 
    110110                    }), 
     
    205205                    </tr> 
    206206                    <tr> 
    207                         <td>single no drag</td> 
    208                         <td><button id="nodragStatus" onclick="toggle('nodrag')">off</button></td> 
    209                         <td><textarea class="output" id="nodragOutput"></textarea></td> 
     207                        <td>single with drag</td> 
     208                        <td><button id="dragStatus" onclick="toggle('drag')">off</button></td> 
     209                        <td><textarea class="output" id="dragOutput"></textarea></td> 
    210210                    </tr> 
    211211                    <tr> 
  • sandbox/crschmidt/animated_panning/lib/OpenLayers/Control/OverviewMap.js

    r6045 r6067  
    435435        // create the overview map 
    436436        var options = OpenLayers.Util.extend( 
    437                         {controls: [], maxResolution: 'auto', 'fallThrough': false}, this.mapOptions); 
     437                        {controls: [], maxResolution: 'auto',  
     438                         fallThrough: false}, this.mapOptions); 
    438439        this.ovmap = new OpenLayers.Map(this.mapDiv, options); 
    439440         
  • sandbox/crschmidt/animated_panning/lib/OpenLayers/Format/WFS.js

    r5868 r6067  
    2222     */ 
    2323    wfsns: "http://www.opengis.net/wfs", 
     24     
     25    ogcns: "http://www.opengis.net/ogc", 
    2426     
    2527    /* 
     
    5860     */ 
    5961    write: function(features) { 
    60          
    61         var transaction = this.createElementNS('http://www.opengis.net/wfs', 'wfs:Transaction'); 
     62     
     63        var transaction = this.createElementNS(this.wfsns, 'wfs:Transaction'); 
    6264        transaction.setAttribute("version","1.0.0"); 
    6365        transaction.setAttribute("service","WFS"); 
     
    7577            } 
    7678        } 
    77         return transaction; 
     79         
     80        return OpenLayers.Format.XML.prototype.write.apply(this,[transaction]); 
    7881    }, 
    7982    
     
    9194        featureContainer.appendChild(geomContainer); 
    9295        for(var attr in feature.attributes) { 
    93             var attrText = document.createTextNode(feature.attributes[attr]);  
     96            var attrText = this.createTextNode(feature.attributes[attr]);  
    9497            var nodename = attr; 
    9598            if (attr.search(":") != -1) { 
     
    129132 
    130133        var propertyNode = this.createElementNS(this.wfsns, 'wfs:Property'); 
    131         var nameNode = this.createElementNS('http://www.opengis.net/wfs', 'wfs:Name'); 
     134        var nameNode = this.createElementNS(this.wfsns, 'wfs:Name'); 
    132135         
    133         var txtNode = document.createTextNode(this.geometryName); 
     136        var txtNode = this.createTextNode(this.geometryName); 
    134137        nameNode.appendChild(txtNode); 
    135138        propertyNode.appendChild(nameNode); 
    136139         
    137         var valueNode = this.createElementNS('http://www.opengis.net/wfs', 'wfs:Value'); 
     140        var valueNode = this.createElementNS(this.wfsns, 'wfs:Value'); 
    138141        valueNode.appendChild(this.buildGeometryNode(feature.geometry)); 
    139142         
     
    141144        updateNode.appendChild(propertyNode); 
    142145         
    143         var filterNode = this.createElementNS('http://www.opengis.net/ogc', 'ogc:Filter'); 
    144         var filterIdNode = this.createElementNS('http://www.opengis.net/ogc', 'ogc:FeatureId'); 
     146        var filterNode = this.createElementNS(this.ogcns, 'ogc:Filter'); 
     147        var filterIdNode = this.createElementNS(this.ogcns, 'ogc:FeatureId'); 
    145148        filterIdNode.setAttribute("fid", feature.fid); 
    146149        filterNode.appendChild(filterIdNode); 
     
    165168        deleteNode.setAttribute("typeName", this.layerName); 
    166169 
    167         var filterNode = this.createElementNS('http://www.opengis.net/ogc', 'ogc:Filter'); 
    168         var filterIdNode = this.createElementNS('http://www.opengis.net/ogc', 'ogc:FeatureId'); 
     170        var filterNode = this.createElementNS(this.ogcns, 'ogc:Filter'); 
     171        var filterIdNode = this.createElementNS(this.ogcns, 'ogc:FeatureId'); 
    169172        filterIdNode.setAttribute("fid", feature.fid); 
    170173        filterNode.appendChild(filterIdNode); 
  • sandbox/crschmidt/animated_panning/lib/OpenLayers/Format/WMC/v1_1_0.js

    r5919 r6067  
    9090         
    9191        // min/max scale denominator elements go before the 4th element in v1 
    92         var minSD = this.createElementNS( 
    93             this.namespaces.sld, "sld:MinScaleDenominator" 
    94         ); 
    95         minSD.appendChild(this.createTextNode(layer.maxScale.toPrecision(10))); 
    96         node.insertBefore(minSD, node.childNodes[3]); 
     92        if(layer.options.resolutions || layer.options.scales || 
     93           layer.options.minResolution || layer.options.maxScale) { 
     94            var minSD = this.createElementNS( 
     95                this.namespaces.sld, "sld:MinScaleDenominator" 
     96            ); 
     97            minSD.appendChild(this.createTextNode(layer.maxScale.toPrecision(10))); 
     98            node.insertBefore(minSD, node.childNodes[3]); 
     99        } 
    97100         
    98         var maxSD = this.createElementNS( 
    99             this.namespaces.sld, "sld:MaxScaleDenominator" 
    100         ); 
    101         maxSD.appendChild(this.createTextNode(layer.minScale.toPrecision(10))); 
    102         node.insertBefore(maxSD, node.childNodes[4]); 
     101        if(layer.options.resolutions || layer.options.scales || 
     102           layer.options.maxResolution || layer.options.minScale) { 
     103            var maxSD = this.createElementNS( 
     104                this.namespaces.sld, "sld:MaxScaleDenominator" 
     105            ); 
     106            maxSD.appendChild(this.createTextNode(layer.minScale.toPrecision(10))); 
     107            node.insertBefore(maxSD, node.childNodes[4]); 
     108        } 
    103109         
    104110        return node; 
  • sandbox/crschmidt/animated_panning/lib/OpenLayers/Handler/Click.js

    r5698 r6067  
    4646     * APIProperty: pixelTolerance 
    4747     * {Number} Maximum number of pixels between mouseup and mousedown for an 
    48      *     event to be considered a click.  Default is null.  If set to an 
     48     *     event to be considered a click.  Default is 0.  If set to an 
    4949     *     integer value, clicks with a drag greater than the value will be 
    5050     *     ignored.  This property can only be set when the handler is 
    5151     *     constructed. 
    5252     */ 
    53     pixelTolerance: null
     53    pixelTolerance: 0
    5454     
    5555    /** 
     
    183183    passesTolerance: function(evt) { 
    184184        var passes = true; 
    185         if(this.pixelTolerance && this.down) { 
     185        if(this.pixelTolerance != null && this.down) { 
    186186            var dpx = Math.sqrt( 
    187187                Math.pow(this.down.x - evt.xy.x, 2) + 
  • sandbox/crschmidt/animated_panning/lib/OpenLayers/Popup.js

    r5614 r6067  
    9292 
    9393    /**  
     94     * Property: closeDiv 
     95     * {DOMElement} the optional closer image 
     96     */ 
     97    closeDiv: null, 
     98 
     99    /**  
    94100     * Property: padding  
    95101     * {int} the internal padding of the content div. 
     
    158164            var closeSize = new OpenLayers.Size(17,17); 
    159165            var img = OpenLayers.Util.getImagesLocation() + "close.gif"; 
    160             var closeImg = OpenLayers.Util.createAlphaImageDiv(this.id + "_close",  
    161                                                                 null,  
    162                                                                 closeSize,  
    163                                                                 img); 
    164             closeImg.style.right = this.padding + "px"; 
    165             closeImg.style.top = this.padding + "px"; 
    166             this.groupDiv.appendChild(closeImg); 
     166            this.closeDiv = OpenLayers.Util.createAlphaImageDiv( 
     167                this.id + "_close", null, closeSize, img 
     168            ); 
     169            this.closeDiv.style.right = this.padding + "px"; 
     170            this.closeDiv.style.top = this.padding + "px"; 
     171            this.groupDiv.appendChild(this.closeDiv); 
    167172 
    168173            var closePopup = closeBoxCallback || function(e) { 
     
    170175                OpenLayers.Event.stop(e); 
    171176            }; 
    172             OpenLayers.Event.observe(closeImg, "click",  
     177            OpenLayers.Event.observe(this.closeDiv, "click",  
    173178                    OpenLayers.Function.bindAsEventListener(closePopup, this)); 
    174179 
  • sandbox/crschmidt/animated_panning/tests/Handler/test_Click.html

    r5685 r6067  
    4444     
    4545    function test_Handler_Click_events(t) { 
    46         t.plan(30); 
     46        t.plan(35); 
    4747         
    4848        var map = new OpenLayers.Map('map'); 
     
    7373        // list below events that should be handled (events) and those 
    7474        // that should not be handled (nonevents) by the handler 
    75         var events = ["click", "dblclick"]; 
    76         var nonevents = ["mousedown", "mousemove", "mouseup", "resize", "focus", "blur"]; 
     75        var events = ["click", "dblclick", "mousedown"]; 
     76        var nonevents = ["mousemove", "mouseup", "resize", "focus", "blur"]; 
    7777        var handler = new OpenLayers.Handler.Click(control); 
    7878        // set browser event like properties on the handler 
  • sandbox/crschmidt/animated_panning/tests/list-tests.html

    r6032 r6067  
    3232    <li>Format/test_WKT.html</li> 
    3333    <li>Format/test_WMC.html</li> 
     34    <li>Format/WMC/test_v1_1_0.html</li> 
    3435    <li>Format/test_XML.html</li> 
    3536    <li>test_Icon.html</li>