OpenLayers OpenLayers

Changeset 7489

Show
Ignore:
Timestamp:
07/11/08 10:54:38 (1 month ago)
Author:
elemoine
Message:

merge -r7352:HEAD from trunk/openlayers

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/vector-behavior/build/full.cfg

    r7348 r7489  
    1919OpenLayers/Lang/fr.js 
    2020OpenLayers/Lang/it.js 
     21OpenLayers/Lang/nb.js 
    2122OpenLayers/Lang/pt-BR.js 
    2223OpenLayers/Lang/sv-SE.js 
     24OpenLayers/Lang/zh-TW.js 
  • sandbox/vector-behavior/build/library.cfg

    r7348 r7489  
    5252OpenLayers/Lang/fr.js 
    5353OpenLayers/Lang/it.js 
     54OpenLayers/Lang/nb.js 
    5455OpenLayers/Lang/pt-BR.js 
    5556OpenLayers/Lang/sv-SE.js 
     57OpenLayers/Lang/zh-TW.js 
    5658 
     59 
  • sandbox/vector-behavior/build/lite.cfg

    r7348 r7489  
    2020 
    2121[exclude] 
    22 Firebug/firebug.js 
    23 Firebug/firebugx.js 
    24 OpenLayers/Lang/cs-CZ.js 
    25 OpenLayers/Lang/de.js 
    26 OpenLayers/Lang/en-CA.js 
    27 OpenLayers/Lang/fr.js 
    28 OpenLayers/Lang/it.js 
    29 OpenLayers/Lang/pt-BR.js 
    30 OpenLayers/Lang/sv-SE.js 
    3122 
     23 
  • sandbox/vector-behavior/doc/authors.txt

    r6493 r7489  
    2424Cameron Shorter                                                               
    2525Paul Spencer                                                                  
     26Paul Smith                                                                  
    2627Glen Stampoultzis 
    2728James Stembridge 
  • sandbox/vector-behavior/examples/editingtoolbar-outside.html

    r7161 r7489  
    4343  <body onload="init()"> 
    4444    <h1 id="title">OpenLayers EditingToolbar Outside Viewport</h1> 
     45    <p id="shortdesc"> 
     46        Display an editing toolbar panel outside the map viewport. 
     47    </p> 
    4548    <div id="map" class="smallmap"></div> 
    4649    <div id="panel" class="olControlEditingToolbar"></div> 
  • sandbox/vector-behavior/examples/georss-flickr.html

    r7161 r7489  
    4747            style.addRules([rule, elseRule]); 
    4848             
    49             // Create a layer with a style map.  Giving the style map keys 
    50             // for "default" and "select" rendering intent. 
    51             markerLayer = new OpenLayers.Layer.Vector("", { 
     49            // Create a GML layer with GeoRSS format and a style map. 
     50            markerLayer = new OpenLayers.Layer.GML("Some images from Flickr", 
     51                                                   "xml/georss-flickr.xml", { 
     52                format: OpenLayers.Format.GeoRSS, 
     53                formatOptions: { 
     54                    // adds the thumbnail attribute to the feature 
     55                    createFeatureFromItem: function(item) { 
     56                        var feature = OpenLayers.Format.GeoRSS.prototype 
     57                                .createFeatureFromItem.apply(this, arguments); 
     58                        feature.attributes.thumbnail = 
     59                                this.getElementsByTagNameNS( 
     60                                item, "*", "thumbnail")[0].getAttribute("url"); 
     61                        return feature; 
     62                    } 
     63                }, 
     64                // Giving the style map keys for "default" and "select" 
     65                // rendering intent, to make the image larger when selected 
    5266                styleMap: new OpenLayers.StyleMap({ 
    5367                    "default": style, 
     
    7690             
    7791            popupControl.activate(); 
    78              
    79             OpenLayers.loadURL("xml/georss-flickr.xml", null, window, afterload); 
    80              
    81         } 
    82          
    83         function afterload(req) { 
    84             // extended version of OpenLayers.Format.GeoRSS.createFeatureFromItem; 
    85             // adds the thumbnail attribute to the feature 
    86             function createFeatureFromItem(item) { 
    87                 var feature = OpenLayers.Format.GeoRSS.prototype 
    88                         .createFeatureFromItem.apply(this, arguments); 
    89                 feature.attributes.thumbnail = 
    90                         this.getElementsByTagNameNS( 
    91                         item, "*", "thumbnail")[0].getAttribute("url"); 
    92                 return feature; 
    93             } 
    94  
    95             var store = new OpenLayers.Format.GeoRSS({ 
    96                     createFeatureFromItem: createFeatureFromItem}); 
    97  
    98             rss = store.read(req.responseText); 
    99  
    100             markerLayer.setName("Some images from Flickr"); 
    101             markerLayer.addFeatures(rss); 
    10292        } 
    10393    </script> 
  • sandbox/vector-behavior/examples/intersects.html

    r7161 r7489  
    162162    <div id="leftcol"> 
    163163        <h1 id="title">OpenLayers Geometry Intersection Example</h1> 
     164        <p id="shortdesc"> 
     165            Use of geometry.intersects method for testing geometry intersections. 
     166        </p> 
    164167        <div id="map" class="smallmap"></div> 
    165168        <div id="input"> 
  • sandbox/vector-behavior/examples/navigation-history.html

    r7161 r7489  
    1818            var map, nav, panel; 
    1919 
    20             // preload images if you care 
    21             var preload = [ 
    22                 "../theme/default/img/view_previous_on.png", 
    23                 "../theme/default/img/view_next_on.png" 
    24             ]; 
    25             var img = new Array(preload.length); 
    26             for(var i=0; i<preload.length; ++i) { 
    27                 img[i] = new Image(); 
    28                 img[i].src = preload[i]; 
    29             } 
    30              
    31             function init(){ 
     20            function init() { 
    3221                map = new OpenLayers.Map('map'); 
    3322 
     
    4938                map.addLayer(layer); 
    5039                map.zoomToMaxExtent(); 
    51  
    52  
    5340            } 
    5441        </script> 
  • sandbox/vector-behavior/examples/projected-map.html

    r7161 r7489  
    4848            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); 
    4949            map.addControl(new OpenLayers.Control.LayerSwitcher()); 
     50            map.addControl(new OpenLayers.Control.ScaleLine()); 
    5051        } 
    5152    </script> 
  • sandbox/vector-behavior/examples/rotate-features.html

    r7161 r7489  
    7878            var center = new OpenLayers.Feature.Vector(origin, null, style); 
    7979            vectorLayer.addFeatures([center]); 
    80             window.setInterval(rotateFeature, 100, 
    81                                pointFeature, 360 / 20, origin)
    82             window.setInterval(rotateFeature, 100, 
    83                                lineFeature, 360 / 40, origin)
    84             window.setInterval(rotateFeature, 100, 
    85                                polygonFeature, -360 / 20, origin)
     80            window.setInterval(function() {rotateFeature( 
     81                               pointFeature, 360 / 20, origin)}, 100)
     82            window.setInterval(function() {rotateFeature( 
     83                               lineFeature, 360 / 40, origin)}, 100)
     84            window.setInterval(function(){rotateFeature( 
     85                               polygonFeature, -360 / 20, origin)}, 100)
    8686        } 
    8787 
  • sandbox/vector-behavior/examples/sld.html

    r7161 r7489  
    9292  <body onload="init()"> 
    9393    <h1 id="title">Styled Layer Descriptor (SLD) Example</h1> 
     94    <p id="shortdesc"> 
     95        Parsing SLD and applying styles to a vector layer. 
     96    </p> 
    9497    <div id="map" class="smallmap"></div> 
    95     <p>This example uses a <a target="_blank" href="tasmania/sld-tasmania.xml">SLD 
     98    <p id="docs">This example uses a <a target="_blank" href="tasmania/sld-tasmania.xml">SLD 
    9699    file</a> to style the vector features. To construct layers that use styles 
    97100    from SLD, create a StyleMap for the layer that uses one of the userStyles in the 
  • sandbox/vector-behavior/examples/spherical-mercator.html

    r7348 r7489  
    4242            var gsat = new OpenLayers.Layer.Google( 
    4343                "Google Satellite", 
    44                 {type: G_SATELLITE_MAP, 'sphericalMercator': true
     44                {type: G_SATELLITE_MAP, 'sphericalMercator': true, numZoomLevels: 22
    4545            ); 
    4646            var ghyb = new OpenLayers.Layer.Google( 
     
    8585                    displayOutsideMaxExtent: true, 
    8686                    attribution: '<a href="http://www.openstreetmap.org/">OpenStreetMap</a>' 
     87                } 
     88            ); 
     89            // create OSM layer 
     90            var mapnik = new OpenLayers.Layer.TMS( 
     91                "OpenAerialMap", 
     92                "http://tile.openaerialmap.org/tiles/1.0.0/openaerialmap-900913/", 
     93                { 
     94                    type: 'png', getURL: osm_getTileURL 
    8795                } 
    8896            ); 
  • sandbox/vector-behavior/examples/styles-rotation.html

    r7348 r7489  
    7777  <body onload="init()"> 
    7878    <h1 id="title">Rotation Styles Example</h1> 
    79     <p id="shortdesc">Vector point feature symbolizers can have a <tt>rotation</tt> property. The center of the rotation is the point of the image specified by <tt>graphicXOffset</tt> and <tt>graphicYOffset</tt>.</p> 
     79    <p id="shortdesc">Vector point feature symbolizers can have a rotation property. The center of the rotation is the point of the image specified by graphicXOffset and graphicYOffset.</p> 
    8080    <div id="map"></div> 
    8181    <div id="docs"/> 
  • sandbox/vector-behavior/examples/styles-unique.html

    r7240 r7489  
    9393 
    9494    <p id="shortdesc"> 
    95       Shows how to create a style based : 
    96       <ul>  
    97         <li>on unique feature attribute values (markers),</li> 
    98         <li>on feature state values (circles).</li> 
    99       </ul> 
     95        Shows how to create a style based on unique feature attribute values (markers) 
     96        and feature state values (circles). 
    10097    </p> 
    10198 
  • sandbox/vector-behavior/lib/OpenLayers/BaseTypes.js

    r6829 r7489  
    135135        } 
    136136        return tokens.join(""); 
     137    }, 
     138     
     139    /** 
     140     * Property: OpenLayers.String.numberRegEx 
     141     * Used to test strings as numbers. 
     142     */ 
     143    numberRegEx: /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/, 
     144     
     145    /** 
     146     * APIFunction: OpenLayers.String.isNumeric 
     147     * Determine whether a string contains only a numeric value. 
     148     * 
     149     * Examples: 
     150     * (code) 
     151     * OpenLayers.String.isNumeric("6.02e23") // true 
     152     * OpenLayers.String.isNumeric("12 dozen") // false 
     153     * OpenLayers.String.isNumeric("4") // true 
     154     * OpenLayers.String.isNumeric(" 4 ") // false 
     155     * (end) 
     156     * 
     157     * Returns: 
     158     * {Boolean} String contains only a number. 
     159     */ 
     160    isNumeric: function(value) { 
     161        return OpenLayers.String.numberRegEx.test(value); 
    137162    } 
    138163 
  • sandbox/vector-behavior/lib/OpenLayers/Control/NavigationHistory.js

    r6833 r7489  
    138138        var previousOptions = { 
    139139            trigger: OpenLayers.Function.bind(this.previousTrigger, this), 
    140             displayClass: this.displayClass + "Previous" 
     140            displayClass: this.displayClass + " " + this.displayClass + "Previous" 
    141141        }; 
    142142        OpenLayers.Util.extend(previousOptions, this.previousOptions); 
     
    145145        var nextOptions = { 
    146146            trigger: OpenLayers.Function.bind(this.nextTrigger, this), 
    147             displayClass: this.displayClass + "Next" 
     147            displayClass: this.displayClass + " " + this.displayClass + "Next" 
    148148        }; 
    149149        OpenLayers.Util.extend(nextOptions, this.nextOptions); 
  • sandbox/vector-behavior/lib/OpenLayers/Control/OverviewMap.js

    r6810 r7489  
    496496        // The base layer for overview map needs to be in the same projection 
    497497        // as the base layer for the main map.  This should be made more robust. 
    498         if(this.map.units != 'degrees') { 
     498        if(this.map.getUnits() != 'degrees') { 
    499499            if(this.ovmap.getProjection() && (this.map.getProjection() != this.ovmap.getProjection())) { 
    500500                alert(OpenLayers.i18n("sameProjection")); 
  • sandbox/vector-behavior/lib/OpenLayers/Control/Permalink.js

    r7303 r7489  
    154154         
    155155        params.layers = ''; 
    156         for(var i=0; i< this.map.layers.length; i++) { 
     156        for (var i=0; i < this.map.layers.length; i++) { 
    157157            var layer = this.map.layers[i]; 
    158158 
     
    165165 
    166166        var href = this.base; 
    167         if( href.indexOf('?') != -1 )
     167        if (href.indexOf('?') != -1)
    168168            href = href.substring( 0, href.indexOf('?') ); 
    169169        } 
  • sandbox/vector-behavior/lib/OpenLayers/Control/ScaleLine.js

    r6727 r7489  
    154154        } 
    155155 
    156         var curMapUnits = this.map.units
     156        var curMapUnits = this.map.getUnits()
    157157        var inches = OpenLayers.INCHES_PER_UNIT; 
    158158 
  • sandbox/vector-behavior/lib/OpenLayers/Feature/Vector.js

    r7303 r7489  
    316316        hoverPointUnit: "%", 
    317317        pointerEvents: "visiblePainted", 
    318         cursor: "
     318        cursor: "inherit
    319319    }, 
    320320    'select': { 
     
    352352        hoverPointUnit: "%", 
    353353        pointerEvents: "visiblePainted", 
    354         cursor: "
     354        cursor: "inherit
    355355    } 
    356356};     
  • sandbox/vector-behavior/lib/OpenLayers/Format/GeoRSS.js

    r6833 r7489  
    224224    getChildValue: function(node, nsuri, name, def) { 
    225225        var value; 
    226         try { 
    227             value = this.getElementsByTagNameNS(node, nsuri, name)[0].firstChild.nodeValue; 
    228         } catch(e) { 
     226        var eles = this.getElementsByTagNameNS(node, nsuri, name); 
     227        if(eles && eles[0] && eles[0].firstChild 
     228            && eles[0].firstChild.nodeValue) { 
     229            value = eles[0].firstChild.nodeValue; 
     230        } else { 
    229231            value = (def == undefined) ? "" : def; 
    230232        } 
  • sandbox/vector-behavior/lib/OpenLayers/Format/WKT.js

    r5614 r7489  
    6868                    features.geometry.transform(this.externalProjection, 
    6969                                                this.internalProjection); 
    70                 } else if (features && typeof features == "object") { 
     70                } else if (features && 
     71                           type != "geometrycollection" && 
     72                           typeof features == "object") { 
    7173                    for (var i = 0; i < features.length; i++) { 
    7274                        var component = features[i]; 
  • sandbox/vector-behavior/lib/OpenLayers/Handler/Box.js

    r5614 r7489  
    8585    */ 
    8686    moveBox: function (xy) { 
    87         var deltaX = Math.abs(this.dragHandler.start.x - xy.x); 
    88         var deltaY = Math.abs(this.dragHandler.start.y - xy.y); 
     87        var startX = this.dragHandler.start.x; 
     88        var startY = this.dragHandler.start.y; 
     89        var deltaX = Math.abs(startX - xy.x); 
     90        var deltaY = Math.abs(startY - xy.y); 
    8991        this.zoomBox.style.width = Math.max(1, deltaX) + "px"; 
    9092        this.zoomBox.style.height = Math.max(1, deltaY) + "px"; 
    91         if (xy.x < this.dragHandler.start.x) { 
    92             this.zoomBox.style.left = xy.x+"px"; 
    93         } 
    94         if (xy.y < this.dragHandler.start.y) { 
    95             this.zoomBox.style.top = xy.y+"px"; 
    96         } 
     93        this.zoomBox.style.left = xy.x < startX ? xy.x+"px" : startX+"px"; 
     94        this.zoomBox.style.top = xy.y < startY ? xy.y+"px" : startY+"px"; 
    9795    }, 
    9896 
  • sandbox/vector-behavior/lib/OpenLayers/Lang/en.js

    r6313 r7489  
    7676        "in the layer switcher in the upper-right corner.<br><br>" + 
    7777        "Most likely, this is because the ${layerLib} library " + 
    78         "script was either not correctly included.<br><br>" + 
     78        "script was not correctly included.<br><br>" + 
    7979        "Developers: For help getting this working correctly, " + 
    8080        "<a href='http://trac.openlayers.org/wiki/${layerLib}' " + 
  • sandbox/vector-behavior/lib/OpenLayers/Lang/fr.js

    r6313 r7489  
    1515OpenLayers.Lang.fr = { 
    1616 
    17     'overlays': "Couches de superposition" 
     17    'unhandledRequest': "Requête non gérée, retournant ${statusText}", 
     18 
     19    'permalink': "Permalien", 
     20 
     21    'overlays': "Calques", 
     22 
     23    'baseLayer': "Calque de base", 
     24 
     25    'sameProjection': 
     26        "La carte de situation ne fonctionne que lorsque sa projection est la même que celle de la carte principale", 
     27 
     28    'readNotImplemented': "Lecture non implémentée.", 
     29 
     30    'writeNotImplemented': "Ecriture non implémentée.", 
     31 
     32    'noFID': "Impossible de mettre à jour un objet sans identifiant (fid).", 
     33 
     34    'errorLoadingGML': "Erreur au chargement du fichier GML ${url}", 
     35 
     36    'browserNotSupported': 
     37        "Votre navigateur ne supporte pas le rendu vectoriel. Les renderers actuellement supportés sont : \n${renderers}", 
     38 
     39    'componentShouldBe': "addFeatures : le composant devrait être de type ${geomType}", 
     40 
     41    // console message 
     42    'getFeatureError': 
     43        "getFeatureFromEvent a été appelé sur un calque sans renderer. Cela signifie généralement que vous " + 
     44        "avez détruit cette couche, mais que vous avez conservé un handler qui lui était associé.", 
     45 
     46    // console message 
     47    'minZoomLevelError': 
     48        "La propriété minZoomLevel doit seulement être utilisée " + 
     49        "pour des couches FixedZoomLevels-descendent. Le fait que " + 
     50        "cette couche WFS vérifie la présence de minZoomLevel " + 
     51        "est une relique du passé. Nous ne pouvons toutefois la " + 
     52        "supprimer sans casser des applications qui pourraient en dépendre." + 
     53        " C'est pourquoi nous la déprécions -- la vérification du minZoomLevel " + 
     54        "sera supprimée en version 3.0. A la place, merci d'utiliser " + 
     55        "les paramÚtres de résolutions min/max tel que décrit sur : " + 
     56        "http://trac.openlayers.org/wiki/SettingZoomLevels", 
     57 
     58    'commitSuccess': "Transaction WFS : SUCCES ${response}", 
     59 
     60    'commitFailed': "Transaction WFS : ECHEC ${response}", 
     61 
     62    'googleWarning': 
     63        "La couche Google n'a pas été en mesure de se charger correctement.<br><br>" + 
     64        "Pour supprimer ce message, choisissez une nouvelle BaseLayer " + 
     65        "dans le sélecteur de couche en haut à droite.<br><br>" + 
     66        "Cela est possiblement causé par la non-inclusion de la " + 
     67        "librairie Google Maps, ou alors parce que la clé de l'API " + 
     68        "ne correspond pas à votre site.<br><br>" + 
     69        "Développeurs : pour savoir comment corriger ceci, " + 
     70        "<a href='http://trac.openlayers.org/wiki/Google' " + 
     71        "target='_blank'>cliquez ici</a>", 
     72 
     73    'getLayerWarning': 
     74        "La couche ${layerType} n'est pas en mesure de se charger correctement.<br><br>" + 
     75        "Pour supprimer ce message, choisissez une nouvelle BaseLayer " + 
     76        "dans le sélecteur de couche en haut à droite.<br><br>" + 
     77        "Cela est possiblement causé par la non-inclusion de la " + 
     78        "librairie ${layerLib}.<br><br>" + 
     79        "Développeurs : pour savoir comment corriger ceci, " + 
     80        "<a href='http://trac.openlayers.org/wiki/${layerLib}' " + 
     81        "target='_blank'>cliquez ici</a>", 
     82 
     83    'scale': "Echelle ~ 1 : ${scaleDenom}", 
     84 
     85    // console message 
     86    'layerAlreadyAdded': 
     87        "Vous avez essayé d'ajouter à la carte le calque : ${layerName}, mais il est déjà présent", 
     88 
     89    // console message 
     90    'reprojectDeprecated': 
     91        "Vous utilisez l'option 'reproject' " + 
     92        "sur la couche ${layerName}. Cette option est dépréciée : " + 
     93        "Son usage permettait d'afficher des données au dessus de couches raster commerciales." +  
     94        "Cette fonctionalité est maintenant supportée en utilisant le support de la projection " + 
     95        "Mercator Sphérique. Plus d'information est disponible sur " + 
     96        "http://trac.openlayers.org/wiki/SphericalMercator.", 
     97 
     98    // console message 
     99    'methodDeprecated': 
     100        "Cette méthode est dépréciée, et sera supprimée à la version 3.0. " + 
     101        "Merci d'utiliser ${newMethod} à la place.", 
     102 
     103    // console message 
     104    'boundsAddError': "Vous devez passer les deux valeurs x et y à la fonction add.", 
     105 
     106    // console message 
     107    'lonlatAddError': "Vous devez passer les deux valeurs lon et lat à la fonction add.", 
     108 
     109    // console message 
     110    'pixelAddError': "Vous devez passer les deux valeurs x et y à la fonction add.", 
     111 
     112    // console message 
     113    'unsupportedGeometryType': "Type de géométrie non supporté : ${geomType}", 
     114 
     115    // console message 
     116    'pagePositionFailed': 
     117        "OpenLayers.Util.pagePosition a échoué: l'élément d'id ${elemId} pourrait être mal positionné.", 
     118     
     119    'end': '' 
    18120 
    19121}; 
  • sandbox/vector-behavior/lib/OpenLayers/Layer/GeoRSS.js

    r7348 r7489  
    122122        OpenLayers.Layer.Markers.prototype.moveTo.apply(this, arguments); 
    123123        if(this.visibility && !this.loaded){ 
    124             this.events.triggerEvent("loadstart"); 
    125124            this.loadRSS(); 
    126125        } 
  • sandbox/vector-behavior/lib/OpenLayers/Layer/WFS.js

    r7348 r7489  
    55 
    66/** 
     7 * @requires OpenLayers/Tile/WFS.js 
    78 * @requires OpenLayers/Layer/Vector.js 
    89 * @requires OpenLayers/Layer/Markers.js 
     
    5960      * {<OpenLayers.Format>} The format you want the data to be parsed with. 
    6061      * Must be passed in the constructor. Should be a class, not an instance. 
     62      * This option can only be used if no featureClass is passed / vectorMode 
     63      * is false: if a featureClass is passed, then this parameter is ignored. 
    6164      */ 
    6265    format: null, 
     
    7881    /** 
    7982     * Property: vectorMode 
    80      * {Boolean} Should be calculated automatically. 
     83     * {Boolean} Should be calculated automatically. Determines whether the 
     84     *     layer is in vector mode or marker mode. 
    8185     */ 
    8286    vectorMode: true,  
     
    433437     */ 
    434438    getFullRequestString:function(newParams, altUrl) { 
    435         var projectionCode = this.map.getProjection(); 
     439        var projectionCode = this.projection.getCode() || this.map.getProjection(); 
    436440        this.params.SRS = (projectionCode == "none") ? null : projectionCode; 
    437441 
  • sandbox/vector-behavior/lib/OpenLayers/Layer/WMS.js

    r6418 r7489  
    187187     *     before calling changeParams on the super class. 
    188188     *  
    189      *     Once params have been changed, we will need to re-init our tiles. 
     189     *     Once params have been changed, the tiles will be reloaded with 
     190     *     the new parameters. 
    190191     *  
    191192     * Parameters: 
     
    200201 
    201202    /**  
    202      * Method: getFullRequestString 
     203     * APIMethod: getFullRequestString 
    203204     * Combine the layer's url with its params and these newParams.  
    204205     *    
  • sandbox/vector-behavior/lib/OpenLayers/Map.js

    r7348 r7489  
    17641764    }, 
    17651765 
     1766    /** 
     1767     * APIMethod: getUnits 
     1768     *  
     1769     * Returns: 
     1770     * {Float} The current units of the map.  
     1771     *         If no baselayer is set, returns null. 
     1772     */ 
     1773    getUnits: function () { 
     1774        var units = null; 
     1775        if (this.baseLayer != null) { 
     1776            units = this.baseLayer.units; 
     1777        } 
     1778        return units; 
     1779    }, 
     1780 
    17661781     /** 
    17671782      * APIMethod: getScale 
  • sandbox/vector-behavior/lib/OpenLayers/Renderer/Elements.js

    r7028 r7489  
    349349     * Create new node of the specified type, with the (optional) specified id. 
    350350     *  
    351      * If node already exists with same ID and type, we remove it and then 
    352      *  call ourselves again to recreate it. 
     351     * If node already exists with same ID and a different type, we remove it 
     352     *     and then call ourselves again to recreate it. 
    353353     *  
    354354     * Parameters: 
  • sandbox/vector-behavior/lib/OpenLayers/Tile/WFS.js

    r7348 r7489  
    134134            var doc = request.responseXML; 
    135135            if (!doc || !doc.documentElement) { 
    136                 doc = OpenLayers.Format.XML.prototype.read(request.responseText); 
     136                doc = request.responseText;  
    137137            } 
    138138            if (this.layer.vectorMode) { 
    139139                this.layer.addFeatures(this.layer.formatObject.read(doc)); 
    140140            } else { 
    141                 var resultFeatures = OpenLayers.Ajax.getElementsByTagNameNS( 
    142                     doc, "http://www.opengis.net/gml", "gml", "featureMember" 
     141                var xml = new OpenLayers.Format.XML(); 
     142                if (typeof doc == "string") { 
     143                    doc = xml.read(doc); 
     144                } 
     145                var resultFeatures = xml.getElementsByTagNameNS( 
     146                    doc, "http://www.opengis.net/gml", "featureMember" 
    143147                ); 
    144148                this.addResults(resultFeatures); 
  • sandbox/vector-behavior/tests/BaseTypes.html

    r6724 r7489  
    141141        ); 
    142142 
     143    } 
     144 
     145    function test_String_isNumeric(t) { 
     146        var cases = [ 
     147            {value: "3", expect: true}, 
     148            {value: "+3", expect: true}, 
     149            {value: "-3", expect: true}, 
     150            {value: "3.0", expect: true}, 
     151            {value: "+3.0", expect: true}, 
     152            {value: "-3.0", expect: true}, 
     153            {value: "6.02e23", expect: true}, 
     154            {value: "+1.0e-100", expect: true}, 
     155            {value: "-1.0e+100", expect: true}, 
     156            {value: "1E100", expect: true}, 
     157            {value: null, expect: false}, 
     158            {value: true, expect: false}, 
     159            {value: false, expect: false}, 
     160            {value: undefined, expect: false}, 
     161            {value: "", expect: false}, 
     162            {value: "3 ", expect: false}, 
     163            {value: " 3", expect: false}, 
     164            {value: "1e", expect: false}, 
     165            {value: "1+e", expect: false}, 
     166            {value: "1-e", expect: false} 
     167        ]; 
     168        t.plan(cases.length); 
     169         
     170        var func = OpenLayers.String.isNumeric; 
     171        var obj, val, got, exp; 
     172        for(var i=0; i<cases.length; ++i) { 
     173            obj = cases[i]; 
     174            val = obj.value; 
     175            exp = obj.expect; 
     176            got = func(val); 
     177            t.eq(got, exp, "'" + val + "' returns " + exp); 
     178        } 
     179         
    143180    } 
    144181    
  • sandbox/vector-behavior/tests/Control/ScaleLine.html

    r6719 r7489  
    8787        t.eq(control.div.firstChild.style.visibility, "visible", "top scale is present."); 
    8888        t.eq(control.div.lastChild.style.visibility, "visible", "bottom scale is present."); 
    89         t.eq(control.div.firstChild.innerHTML, "20000 km", "top scale has correct text."); 
    90         t.eq(control.div.lastChild.innerHTML, "20000 mi", "bottom scale has correct text."); 
     89        t.eq(control.div.firstChild.innerHTML, "200 m", "top scale has correct text."); 
     90        t.eq(control.div.lastChild.innerHTML, "1000 ft", "bottom scale has correct text."); 
    9191        map.destroy(); 
    9292    } 
  • sandbox/vector-behavior/tests/Format/WKT.html

    r6719 r7489  
    217217    } 
    218218 
     219    function test_Format_WKT_read_projection(t) { 
     220        t.plan(1); 
     221 
     222        var projections = { 
     223            src:  new OpenLayers.Projection("EPSG:4326"), 
     224            dest: new OpenLayers.Projection("EPSG:900913") 
     225        }; 
     226 
     227        var points = { 
     228            src:  new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(-87.9, 41.9)), 
     229            dest: new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(-9784983.239366667, 5146011.678566458)) 
     230        }; 
     231 
     232        var format = new OpenLayers.Format.WKT({ 
     233            externalProjection: projections["src"], 
     234            internalProjection: projections["dest"], 
     235        }); 
     236        var feature = format.read("GEOMETRYCOLLECTION(POINT(" + points["src"].geometry.x + " " + points["src"].geometry.y + "))")[0]; 
     237        t.eq(feature.geometry.toString(), points["dest"].geometry.toString(),  
     238            "Geometry collections aren't transformed twice when reprojection."); 
     239    } 
    219240    </script> &nb