Changeset 7489
- Timestamp:
- 07/11/08 10:54:38 (1 month ago)
- Files:
-
- sandbox/vector-behavior/build/full.cfg (modified) (1 diff)
- sandbox/vector-behavior/build/library.cfg (modified) (1 diff)
- sandbox/vector-behavior/build/lite.cfg (modified) (1 diff)
- sandbox/vector-behavior/doc/authors.txt (modified) (1 diff)
- sandbox/vector-behavior/examples/editingtoolbar-outside.html (modified) (1 diff)
- sandbox/vector-behavior/examples/georss-flickr.html (modified) (2 diffs)
- sandbox/vector-behavior/examples/intersects.html (modified) (1 diff)
- sandbox/vector-behavior/examples/navigation-history.html (modified) (2 diffs)
- sandbox/vector-behavior/examples/projected-map.html (modified) (1 diff)
- sandbox/vector-behavior/examples/rotate-features.html (modified) (1 diff)
- sandbox/vector-behavior/examples/sld.html (modified) (1 diff)
- sandbox/vector-behavior/examples/smoothDragging.html (deleted)
- sandbox/vector-behavior/examples/spherical-mercator.html (modified) (2 diffs)
- sandbox/vector-behavior/examples/stylemap.html (copied) (copied from trunk/openlayers/examples/stylemap.html)
- sandbox/vector-behavior/examples/styles-rotation.html (modified) (1 diff)
- sandbox/vector-behavior/examples/styles-unique.html (modified) (1 diff)
- sandbox/vector-behavior/lib/OpenLayers/BaseTypes.js (modified) (1 diff)
- sandbox/vector-behavior/lib/OpenLayers/Control/NavigationHistory.js (modified) (2 diffs)
- sandbox/vector-behavior/lib/OpenLayers/Control/OverviewMap.js (modified) (1 diff)
- sandbox/vector-behavior/lib/OpenLayers/Control/Permalink.js (modified) (2 diffs)
- sandbox/vector-behavior/lib/OpenLayers/Control/ScaleLine.js (modified) (1 diff)
- sandbox/vector-behavior/lib/OpenLayers/Feature/Vector.js (modified) (2 diffs)
- sandbox/vector-behavior/lib/OpenLayers/Format/GeoRSS.js (modified) (1 diff)
- sandbox/vector-behavior/lib/OpenLayers/Format/WKT.js (modified) (1 diff)
- sandbox/vector-behavior/lib/OpenLayers/Handler/Box.js (modified) (1 diff)
- sandbox/vector-behavior/lib/OpenLayers/Lang/en.js (modified) (1 diff)
- sandbox/vector-behavior/lib/OpenLayers/Lang/fr.js (modified) (1 diff)
- sandbox/vector-behavior/lib/OpenLayers/Lang/nb.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Lang/nb.js)
- sandbox/vector-behavior/lib/OpenLayers/Lang/zh-TW.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Lang/zh-TW.js)
- sandbox/vector-behavior/lib/OpenLayers/Layer/GeoRSS.js (modified) (1 diff)
- sandbox/vector-behavior/lib/OpenLayers/Layer/WFS.js (modified) (4 diffs)
- sandbox/vector-behavior/lib/OpenLayers/Layer/WMS.js (modified) (2 diffs)
- sandbox/vector-behavior/lib/OpenLayers/Map.js (modified) (1 diff)
- sandbox/vector-behavior/lib/OpenLayers/Renderer/Elements.js (modified) (1 diff)
- sandbox/vector-behavior/lib/OpenLayers/Tile/WFS.js (modified) (1 diff)
- sandbox/vector-behavior/tests/BaseTypes.html (modified) (1 diff)
- sandbox/vector-behavior/tests/Control/ScaleLine.html (modified) (1 diff)
- sandbox/vector-behavior/tests/Format/WKT.html (modified) (1 diff)
- sandbox/vector-behavior/tests/Layer/GeoRSS.html (modified) (1 diff)
- sandbox/vector-behavior/tests/Layer/WFS.html (modified) (1 diff)
- sandbox/vector-behavior/tests/Map.html (modified) (1 diff)
- sandbox/vector-behavior/tests/Protocol/HTTP.html (modified) (1 diff)
- sandbox/vector-behavior/tests/Tile/WFS.html (modified) (1 diff)
- sandbox/vector-behavior/tests/run-tests.html (modified) (1 diff)
- sandbox/vector-behavior/theme/default/img/navigation_history.png (copied) (copied from trunk/openlayers/theme/default/img/navigation_history.png)
- sandbox/vector-behavior/theme/default/style.css (modified) (1 diff)
- sandbox/vector-behavior/tools/exampleparser.py (modified) (6 diffs)
- sandbox/vector-behavior/tools/oldot.py (copied) (copied from trunk/openlayers/tools/oldot.py)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/vector-behavior/build/full.cfg
r7348 r7489 19 19 OpenLayers/Lang/fr.js 20 20 OpenLayers/Lang/it.js 21 OpenLayers/Lang/nb.js 21 22 OpenLayers/Lang/pt-BR.js 22 23 OpenLayers/Lang/sv-SE.js 24 OpenLayers/Lang/zh-TW.js sandbox/vector-behavior/build/library.cfg
r7348 r7489 52 52 OpenLayers/Lang/fr.js 53 53 OpenLayers/Lang/it.js 54 OpenLayers/Lang/nb.js 54 55 OpenLayers/Lang/pt-BR.js 55 56 OpenLayers/Lang/sv-SE.js 57 OpenLayers/Lang/zh-TW.js 56 58 59 sandbox/vector-behavior/build/lite.cfg
r7348 r7489 20 20 21 21 [exclude] 22 Firebug/firebug.js23 Firebug/firebugx.js24 OpenLayers/Lang/cs-CZ.js25 OpenLayers/Lang/de.js26 OpenLayers/Lang/en-CA.js27 OpenLayers/Lang/fr.js28 OpenLayers/Lang/it.js29 OpenLayers/Lang/pt-BR.js30 OpenLayers/Lang/sv-SE.js31 22 23 sandbox/vector-behavior/doc/authors.txt
r6493 r7489 24 24 Cameron Shorter 25 25 Paul Spencer 26 Paul Smith 26 27 Glen Stampoultzis 27 28 James Stembridge sandbox/vector-behavior/examples/editingtoolbar-outside.html
r7161 r7489 43 43 <body onload="init()"> 44 44 <h1 id="title">OpenLayers EditingToolbar Outside Viewport</h1> 45 <p id="shortdesc"> 46 Display an editing toolbar panel outside the map viewport. 47 </p> 45 48 <div id="map" class="smallmap"></div> 46 49 <div id="panel" class="olControlEditingToolbar"></div> sandbox/vector-behavior/examples/georss-flickr.html
r7161 r7489 47 47 style.addRules([rule, elseRule]); 48 48 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 52 66 styleMap: new OpenLayers.StyleMap({ 53 67 "default": style, … … 76 90 77 91 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 feature86 function createFeatureFromItem(item) {87 var feature = OpenLayers.Format.GeoRSS.prototype88 .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);102 92 } 103 93 </script> sandbox/vector-behavior/examples/intersects.html
r7161 r7489 162 162 <div id="leftcol"> 163 163 <h1 id="title">OpenLayers Geometry Intersection Example</h1> 164 <p id="shortdesc"> 165 Use of geometry.intersects method for testing geometry intersections. 166 </p> 164 167 <div id="map" class="smallmap"></div> 165 168 <div id="input"> sandbox/vector-behavior/examples/navigation-history.html
r7161 r7489 18 18 var map, nav, panel; 19 19 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() { 32 21 map = new OpenLayers.Map('map'); 33 22 … … 49 38 map.addLayer(layer); 50 39 map.zoomToMaxExtent(); 51 52 53 40 } 54 41 </script> sandbox/vector-behavior/examples/projected-map.html
r7161 r7489 48 48 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); 49 49 map.addControl(new OpenLayers.Control.LayerSwitcher()); 50 map.addControl(new OpenLayers.Control.ScaleLine()); 50 51 } 51 52 </script> sandbox/vector-behavior/examples/rotate-features.html
r7161 r7489 78 78 var center = new OpenLayers.Feature.Vector(origin, null, style); 79 79 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); 86 86 } 87 87 sandbox/vector-behavior/examples/sld.html
r7161 r7489 92 92 <body onload="init()"> 93 93 <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> 94 97 <div id="map" class="smallmap"></div> 95 <p >This example uses a <a target="_blank" href="tasmania/sld-tasmania.xml">SLD98 <p id="docs">This example uses a <a target="_blank" href="tasmania/sld-tasmania.xml">SLD 96 99 file</a> to style the vector features. To construct layers that use styles 97 100 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 42 42 var gsat = new OpenLayers.Layer.Google( 43 43 "Google Satellite", 44 {type: G_SATELLITE_MAP, 'sphericalMercator': true }44 {type: G_SATELLITE_MAP, 'sphericalMercator': true, numZoomLevels: 22} 45 45 ); 46 46 var ghyb = new OpenLayers.Layer.Google( … … 85 85 displayOutsideMaxExtent: true, 86 86 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 87 95 } 88 96 ); sandbox/vector-behavior/examples/styles-rotation.html
r7348 r7489 77 77 <body onload="init()"> 78 78 <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> 80 80 <div id="map"></div> 81 81 <div id="docs"/> sandbox/vector-behavior/examples/styles-unique.html
r7240 r7489 93 93 94 94 <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). 100 97 </p> 101 98 sandbox/vector-behavior/lib/OpenLayers/BaseTypes.js
r6829 r7489 135 135 } 136 136 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); 137 162 } 138 163 sandbox/vector-behavior/lib/OpenLayers/Control/NavigationHistory.js
r6833 r7489 138 138 var previousOptions = { 139 139 trigger: OpenLayers.Function.bind(this.previousTrigger, this), 140 displayClass: this.displayClass + " Previous"140 displayClass: this.displayClass + " " + this.displayClass + "Previous" 141 141 }; 142 142 OpenLayers.Util.extend(previousOptions, this.previousOptions); … … 145 145 var nextOptions = { 146 146 trigger: OpenLayers.Function.bind(this.nextTrigger, this), 147 displayClass: this.displayClass + " Next"147 displayClass: this.displayClass + " " + this.displayClass + "Next" 148 148 }; 149 149 OpenLayers.Util.extend(nextOptions, this.nextOptions); sandbox/vector-behavior/lib/OpenLayers/Control/OverviewMap.js
r6810 r7489 496 496 // The base layer for overview map needs to be in the same projection 497 497 // 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') { 499 499 if(this.ovmap.getProjection() && (this.map.getProjection() != this.ovmap.getProjection())) { 500 500 alert(OpenLayers.i18n("sameProjection")); sandbox/vector-behavior/lib/OpenLayers/Control/Permalink.js
r7303 r7489 154 154 155 155 params.layers = ''; 156 for (var i=0; i< this.map.layers.length; i++) {156 for (var i=0; i < this.map.layers.length; i++) { 157 157 var layer = this.map.layers[i]; 158 158 … … 165 165 166 166 var href = this.base; 167 if ( href.indexOf('?') != -1 ){167 if (href.indexOf('?') != -1) { 168 168 href = href.substring( 0, href.indexOf('?') ); 169 169 } sandbox/vector-behavior/lib/OpenLayers/Control/ScaleLine.js
r6727 r7489 154 154 } 155 155 156 var curMapUnits = this.map. units;156 var curMapUnits = this.map.getUnits(); 157 157 var inches = OpenLayers.INCHES_PER_UNIT; 158 158 sandbox/vector-behavior/lib/OpenLayers/Feature/Vector.js
r7303 r7489 316 316 hoverPointUnit: "%", 317 317 pointerEvents: "visiblePainted", 318 cursor: " "318 cursor: "inherit" 319 319 }, 320 320 'select': { … … 352 352 hoverPointUnit: "%", 353 353 pointerEvents: "visiblePainted", 354 cursor: " "354 cursor: "inherit" 355 355 } 356 356 }; sandbox/vector-behavior/lib/OpenLayers/Format/GeoRSS.js
r6833 r7489 224 224 getChildValue: function(node, nsuri, name, def) { 225 225 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 { 229 231 value = (def == undefined) ? "" : def; 230 232 } sandbox/vector-behavior/lib/OpenLayers/Format/WKT.js
r5614 r7489 68 68 features.geometry.transform(this.externalProjection, 69 69 this.internalProjection); 70 } else if (features && typeof features == "object") { 70 } else if (features && 71 type != "geometrycollection" && 72 typeof features == "object") { 71 73 for (var i = 0; i < features.length; i++) { 72 74 var component = features[i]; sandbox/vector-behavior/lib/OpenLayers/Handler/Box.js
r5614 r7489 85 85 */ 86 86 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); 89 91 this.zoomBox.style.width = Math.max(1, deltaX) + "px"; 90 92 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"; 97 95 }, 98 96 sandbox/vector-behavior/lib/OpenLayers/Lang/en.js
r6313 r7489 76 76 "in the layer switcher in the upper-right corner.<br><br>" + 77 77 "Most likely, this is because the ${layerLib} library " + 78 "script was eithernot correctly included.<br><br>" +78 "script was not correctly included.<br><br>" + 79 79 "Developers: For help getting this working correctly, " + 80 80 "<a href='http://trac.openlayers.org/wiki/${layerLib}' " + sandbox/vector-behavior/lib/OpenLayers/Lang/fr.js
r6313 r7489 15 15 OpenLayers.Lang.fr = { 16 16 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': '' 18 120 19 121 }; sandbox/vector-behavior/lib/OpenLayers/Layer/GeoRSS.js
r7348 r7489 122 122 OpenLayers.Layer.Markers.prototype.moveTo.apply(this, arguments); 123 123 if(this.visibility && !this.loaded){ 124 this.events.triggerEvent("loadstart");125 124 this.loadRSS(); 126 125 } sandbox/vector-behavior/lib/OpenLayers/Layer/WFS.js
r7348 r7489 5 5 6 6 /** 7 * @requires OpenLayers/Tile/WFS.js 7 8 * @requires OpenLayers/Layer/Vector.js 8 9 * @requires OpenLayers/Layer/Markers.js … … 59 60 * {<OpenLayers.Format>} The format you want the data to be parsed with. 60 61 * 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. 61 64 */ 62 65 format: null, … … 78 81 /** 79 82 * 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. 81 85 */ 82 86 vectorMode: true, … … 433 437 */ 434 438 getFullRequestString:function(newParams, altUrl) { 435 var projectionCode = this. map.getProjection();439 var projectionCode = this.projection.getCode() || this.map.getProjection(); 436 440 this.params.SRS = (projectionCode == "none") ? null : projectionCode; 437 441 sandbox/vector-behavior/lib/OpenLayers/Layer/WMS.js
r6418 r7489 187 187 * before calling changeParams on the super class. 188 188 * 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. 190 191 * 191 192 * Parameters: … … 200 201 201 202 /** 202 * Method: getFullRequestString203 * APIMethod: getFullRequestString 203 204 * Combine the layer's url with its params and these newParams. 204 205 * sandbox/vector-behavior/lib/OpenLayers/Map.js
r7348 r7489 1764 1764 }, 1765 1765 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 1766 1781 /** 1767 1782 * APIMethod: getScale sandbox/vector-behavior/lib/OpenLayers/Renderer/Elements.js
r7028 r7489 349 349 * Create new node of the specified type, with the (optional) specified id. 350 350 * 351 * If node already exists with same ID and type, we remove it and then352 * 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. 353 353 * 354 354 * Parameters: sandbox/vector-behavior/lib/OpenLayers/Tile/WFS.js
r7348 r7489 134 134 var doc = request.responseXML; 135 135 if (!doc || !doc.documentElement) { 136 doc = OpenLayers.Format.XML.prototype.read(request.responseText);136 doc = request.responseText; 137 137 } 138 138 if (this.layer.vectorMode) { 139 139 this.layer.addFeatures(this.layer.formatObject.read(doc)); 140 140 } 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" 143 147 ); 144 148 this.addResults(resultFeatures); sandbox/vector-behavior/tests/BaseTypes.html
r6724 r7489 141 141 ); 142 142 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 143 180 } 144 181 sandbox/vector-behavior/tests/Control/ScaleLine.html
r6719 r7489 87 87 t.eq(control.div.firstChild.style.visibility, "visible", "top scale is present."); 88 88 t.eq(control.div.lastChild.style.visibility, "visible", "bottom scale is present."); 89 t.eq(control.div.firstChild.innerHTML, "200 00 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."); 91 91 map.destroy(); 92 92 } sandbox/vector-behavior/tests/Format/WKT.html
r6719 r7489 217 217 } 218 218 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 } 219 240 </script> &nb
