Changeset 5857
- Timestamp:
- 01/23/08 17:57:47 (1 year ago)
- Files:
-
- sandbox/tschaub/wmc/doc/authors.txt (modified) (1 diff)
- sandbox/tschaub/wmc/examples/boxes-vector.html (copied) (copied from trunk/openlayers/examples/boxes-vector.html)
- sandbox/tschaub/wmc/examples/hover-handler.html (copied) (copied from trunk/openlayers/examples/hover-handler.html)
- sandbox/tschaub/wmc/examples/point-track-markers.html (copied) (copied from trunk/openlayers/examples/point-track-markers.html)
- sandbox/tschaub/wmc/examples/vector-features.html (modified) (1 diff)
- sandbox/tschaub/wmc/examples/xml/track1.xml (copied) (copied from trunk/openlayers/examples/xml/track1.xml)
- sandbox/tschaub/wmc/lib/OpenLayers.js (modified) (2 diffs)
- sandbox/tschaub/wmc/lib/OpenLayers/Control/ArgParser.js (modified) (1 diff)
- sandbox/tschaub/wmc/lib/OpenLayers/Control/ZoomBox.js (modified) (2 diffs)
- sandbox/tschaub/wmc/lib/OpenLayers/Format/GeoRSS.js (modified) (1 diff)
- sandbox/tschaub/wmc/lib/OpenLayers/Handler/Click.js (modified) (2 diffs)
- sandbox/tschaub/wmc/lib/OpenLayers/Handler/Drag.js (modified) (2 diffs)
- sandbox/tschaub/wmc/lib/OpenLayers/Handler/Hover.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Handler/Hover.js)
- sandbox/tschaub/wmc/lib/OpenLayers/Layer.js (modified) (1 diff)
- sandbox/tschaub/wmc/lib/OpenLayers/Layer/GML.js (modified) (3 diffs)
- sandbox/tschaub/wmc/lib/OpenLayers/Layer/GeoRSS.js (modified) (5 diffs)
- sandbox/tschaub/wmc/lib/OpenLayers/Layer/PointTrack.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Layer/PointTrack.js)
- sandbox/tschaub/wmc/lib/OpenLayers/Layer/SphericalMercator.js (modified) (1 diff)
- sandbox/tschaub/wmc/lib/OpenLayers/Layer/Text.js (modified) (4 diffs)
- sandbox/tschaub/wmc/lib/OpenLayers/Layer/TileCache.js (modified) (1 diff)
- sandbox/tschaub/wmc/lib/OpenLayers/Layer/WFS.js (modified) (2 diffs)
- sandbox/tschaub/wmc/lib/OpenLayers/Map.js (modified) (1 diff)
- sandbox/tschaub/wmc/lib/OpenLayers/Projection.js (modified) (1 diff)
- sandbox/tschaub/wmc/lib/OpenLayers/Renderer/Elements.js (modified) (1 diff)
- sandbox/tschaub/wmc/lib/OpenLayers/Renderer/SVG.js (modified) (1 diff)
- sandbox/tschaub/wmc/lib/OpenLayers/Renderer/VML.js (modified) (1 diff)
- sandbox/tschaub/wmc/lib/OpenLayers/Tile.js (modified) (1 diff)
- sandbox/tschaub/wmc/lib/OpenLayers/Tile/Image.js (modified) (3 diffs)
- sandbox/tschaub/wmc/lib/OpenLayers/Tile/WFS.js (modified) (4 diffs)
- sandbox/tschaub/wmc/tests/Format/test_GeoRSS.html (modified) (1 diff)
- sandbox/tschaub/wmc/tests/Handler/test_Hover.html (copied) (copied from trunk/openlayers/tests/Handler/test_Hover.html)
- sandbox/tschaub/wmc/tests/Layer/test_GML.html (modified) (3 diffs)
- sandbox/tschaub/wmc/tests/Layer/test_GeoRSS.html (modified) (3 diffs)
- sandbox/tschaub/wmc/tests/Layer/test_PointTrack.html (copied) (copied from trunk/openlayers/tests/Layer/test_PointTrack.html)
- sandbox/tschaub/wmc/tests/Layer/test_Text.html (modified) (1 diff)
- sandbox/tschaub/wmc/tests/Layer/test_WFS.html (modified) (2 diffs)
- sandbox/tschaub/wmc/tests/Renderer/test_SVG.html (modified) (2 diffs)
- sandbox/tschaub/wmc/tests/Tile/test_Image.html (modified) (4 diffs)
- sandbox/tschaub/wmc/tests/Tile/test_WFS.html (modified) (3 diffs)
- sandbox/tschaub/wmc/tests/list-tests.html (modified) (2 diffs)
- sandbox/tschaub/wmc/tests/mice.xml (copied) (copied from trunk/openlayers/tests/mice.xml)
- sandbox/tschaub/wmc/tests/run-tests.html (modified) (1 diff)
- sandbox/tschaub/wmc/tests/test_Projection.html (modified) (2 diffs)
- sandbox/tschaub/wmc/tests/test_Tile.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/tschaub/wmc/doc/authors.txt
r5415 r5857 11 11 Pierre Giraud 12 12 Andreas Hocevar 13 Ian Johnson 13 14 Eric Lemoine 14 15 Philip Lindsay sandbox/tschaub/wmc/examples/vector-features.html
r5362 r5857 38 38 var style_green = { 39 39 strokeColor: "#00FF00", 40 strokeOpacity: 1,41 40 strokeWidth: 3, 42 41 pointRadius: 6, sandbox/tschaub/wmc/lib/OpenLayers.js
r5616 r5857 118 118 "OpenLayers/Handler.js", 119 119 "OpenLayers/Handler/Click.js", 120 "OpenLayers/Handler/Hover.js", 120 121 "OpenLayers/Handler/Point.js", 121 122 "OpenLayers/Handler/Path.js", … … 165 166 "OpenLayers/Renderer/VML.js", 166 167 "OpenLayers/Layer/Vector.js", 168 "OpenLayers/Layer/PointTrack.js", 167 169 "OpenLayers/Layer/GML.js", 168 170 "OpenLayers/Style.js", sandbox/tschaub/wmc/lib/OpenLayers/Control/ArgParser.js
r5616 r5857 1 /* C pyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD1 /* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD 2 2 * license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the 3 3 * full text of the license. */ sandbox/tschaub/wmc/lib/OpenLayers/Control/ZoomBox.js
r5616 r5857 22 22 23 23 /** 24 * Property: out 25 * {Boolean} Should the control be used for zooming out? 26 */ 27 out: false, 28 29 /** 24 30 * Method: draw 25 31 */ … … 37 43 zoomBox: function (position) { 38 44 if (position instanceof OpenLayers.Bounds) { 39 var minXY = this.map.getLonLatFromPixel( 45 if (!this.out) { 46 var minXY = this.map.getLonLatFromPixel( 40 47 new OpenLayers.Pixel(position.left, position.bottom)); 41 var maxXY = this.map.getLonLatFromPixel(48 var maxXY = this.map.getLonLatFromPixel( 42 49 new OpenLayers.Pixel(position.right, position.top)); 43 var bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat,50 var bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat, 44 51 maxXY.lon, maxXY.lat); 52 } else { 53 var pixWidth = Math.abs(position.right-position.left); 54 var pixHeight = Math.abs(position.top-position.bottom); 55 var zoomFactor = Math.min((this.map.size.h / pixHeight), 56 (this.map.size.w / pixWidth)); 57 var extent = map.getExtent(); 58 var center = this.map.getLonLatFromPixel( 59 position.getCenterPixel()); 60 var xmin = center.lon - (extent.getWidth()/2)*zoomFactor; 61 var xmax = center.lon + (extent.getWidth()/2)*zoomFactor; 62 var ymin = center.lat - (extent.getHeight()/2)*zoomFactor; 63 var ymax = center.lat + (extent.getHeight()/2)*zoomFactor; 64 var bounds = new OpenLayers.Bounds(xmin, ymin, xmax, ymax); 65 } 45 66 this.map.zoomToExtent(bounds); 46 67 } else { // it's a pixel 47 this.map.setCenter(this.map.getLonLatFromPixel(position), 68 if (!this.out) { 69 this.map.setCenter(this.map.getLonLatFromPixel(position), 48 70 this.map.getZoom() + 1); 71 } else { 72 this.map.setCenter(this.map.getLonLatFromPixel(position), 73 this.map.getZoom() - 1); 74 } 49 75 } 50 76 }, sandbox/tschaub/wmc/lib/OpenLayers/Format/GeoRSS.js
r5616 r5857 156 156 } 157 157 158 if ( this.internalProjection && this.externalProjection) {158 if (geometry && this.internalProjection && this.externalProjection) { 159 159 geometry.transform(this.externalProjection, 160 160 this.internalProjection); sandbox/tschaub/wmc/lib/OpenLayers/Handler/Click.js
r5692 r5857 172 172 /** 173 173 * Method: passesTolerance 174 * Determine whether the event is within the optional pixel tolerance. 174 * Determine whether the event is within the optional pixel tolerance. Note 175 * that the pixel tolerance check only works if mousedown events get to 176 * the listeners registered here. If they are stopped by other elements, 177 * the <pixelTolerance> will have no effect here (this method will always 178 * return true). 175 179 * 176 180 * Returns: … … 179 183 passesTolerance: function(evt) { 180 184 var passes = true; 181 if(this.pixelTolerance ) {185 if(this.pixelTolerance && this.down) { 182 186 var dpx = Math.sqrt( 183 187 Math.pow(this.down.x - evt.xy.x, 2) + sandbox/tschaub/wmc/lib/OpenLayers/Handler/Drag.js
r5616 r5857 37 37 started: false, 38 38 39 /** 40 * Property: stopDown 41 * {Boolean} Stop propagation of mousedown events from getting to listeners 42 * on the same element. Default is true. 43 */ 44 stopDown: true, 45 39 46 /** 40 47 * Property: dragging … … 165 172 } 166 173 167 propagate = false;174 propagate = !this.stopDown; 168 175 } else { 169 176 this.started = false; sandbox/tschaub/wmc/lib/OpenLayers/Layer.js
r5616 r5857 625 625 } 626 626 627 // Do not use the scales/resolutions at the map level if 628 // minScale/minResolution and maxScale/maxResolution are 629 // specified at the layer level 630 if (this.options.minScale != null && 631 this.options.maxScale != null && 632 this.options.scales == null) { 633 confProps.scales = null; 634 } 635 if (this.options.minResolution != null && 636 this.options.maxResolution != null && 637 this.options.resolutions == null) { 638 confProps.resolutions = null; 639 } 640 627 641 // If numZoomLevels hasn't been set and the maxZoomLevel *has*, 628 642 // then use maxZoomLevel to calculate numZoomLevels sandbox/tschaub/wmc/lib/OpenLayers/Layer/GML.js
r5616 r5857 29 29 */ 30 30 format: null, 31 32 /** 33 * APIProperty: formatOptions 34 * {Object} Hash of options which should be passed to the format when it is 35 * created. Must be passed in the constructor. 36 */ 37 formatOptions: null, 31 38 32 39 /** … … 98 105 } 99 106 }, 100 107 108 /** 109 * Method: setUrl 110 * Change the URL and reload the GML 111 * 112 * Parameters: 113 * url - {String} URL of a GML file. 114 */ 115 setUrl:function(url) { 116 this.url = url; 117 this.destroyFeatures(); 118 this.loaded = false; 119 this.events.triggerEvent("loadstart"); 120 this.loadGML(); 121 }, 101 122 102 123 /** … … 114 135 doc = request.responseText; 115 136 } 116 117 var gml = this.format ? new this.format() : new OpenLayers.Format.GML(); 137 138 var options = {}; 139 140 OpenLayers.Util.extend(options, this.formatOptions); 141 if (this.map && !this.projection.equals(this.map.getProjectionObject())) { 142 options.externalProjection = this.projection; 143 options.internalProjection = this.map.getProjectionObject(); 144 } 145 146 var gml = this.format ? new this.format(options) : new OpenLayers.Format.GML(options); 118 147 this.addFeatures(gml.read(doc)); 119 148 this.events.triggerEvent("loadend"); sandbox/tschaub/wmc/lib/OpenLayers/Layer/GeoRSS.js
r5616 r5857 30 30 */ 31 31 features: null, 32 33 /** 34 * APIProperty: formatOptions 35 * {Object} Hash of options which should be passed to the format when it is 36 * created. Must be passed in the constructor. 37 */ 38 formatOptions: null, 32 39 33 40 /** … … 70 77 this.location = location; 71 78 this.features = []; 72 this.events.triggerEvent("loadstart");73 OpenLayers.loadURL(location, null, this, this.parseData);74 79 }, 75 80 … … 87 92 this.features = null; 88 93 }, 94 95 /** 96 * Method: loadRSS 97 * Start the load of the RSS data. Don't do this when we first add the layer, 98 * since we may not be visible at any point, and it would therefore be a waste. 99 */ 100 loadRSS: function() { 101 if (!this.loaded) { 102 this.events.triggerEvent("loadstart"); 103 OpenLayers.loadURL(this.location, null, this, this.parseData); 104 this.loaded = true; 105 } 106 }, 107 108 /** 109 * Method: moveTo 110 * If layer is visible and RSS has not been loaded, load RSS. 111 * 112 * Parameters: 113 * bounds - {Object} 114 * zoomChanged - {Object} 115 * minor - {Object} 116 */ 117 moveTo:function(bounds, zoomChanged, minor) { 118 OpenLayers.Layer.Markers.prototype.moveTo.apply(this, arguments); 119 if(this.visibility && !this.loaded){ 120 this.events.triggerEvent("loadstart"); 121 this.loadRSS(); 122 } 123 }, 89 124 90 125 /** … … 114 149 } 115 150 116 var format = new OpenLayers.Format.GeoRSS(); 151 var options = {}; 152 153 OpenLayers.Util.extend(options, this.formatOptions); 154 155 if (this.map && !this.projection.equals(this.map.getProjectionObject())) { 156 options.externalProjection = this.projection; 157 options.internalProjection = this.map.getProjectionObject(); 158 } 159 160 var format = new OpenLayers.Format.GeoRSS(options); 117 161 var features = format.read(doc); 118 162 … … 120 164 var data = {}; 121 165 var feature = features[i]; 166 167 // we don't support features with no geometry in the GeoRSS 168 // layer at this time. 169 if (!feature.geometry) { 170 continue; 171 } 172 122 173 var title = feature.attributes.title ? 123 174 feature.attributes.title : "Untitled"; sandbox/tschaub/wmc/lib/OpenLayers/Layer/SphericalMercator.js
r5553 r5857 129 129 130 130 /** 131 * Method: project Forward131 * Method: projectInverse 132 132 * Given an object with x and y properties in Spherical Mercator, modify 133 133 * the x,y properties on the object to be the unprojected coordinates. sandbox/tschaub/wmc/lib/OpenLayers/Layer/Text.js
r5616 r5857 54 54 */ 55 55 features: null, 56 57 /** 58 * APIProperty: formatOptions 59 * {Object} Hash of options which should be passed to the format when it is 60 * created. Must be passed in the constructor. 61 */ 62 formatOptions: null, 56 63 57 64 /** … … 73 80 OpenLayers.Layer.Markers.prototype.initialize.apply(this, arguments); 74 81 this.features = new Array(); 75 if (this.location != null) {76 77 var onFail = function(e) {78 this.events.triggerEvent("loadend");79 };80 81 this.events.triggerEvent("loadstart");82 OpenLayers.loadURL(this.location, null,83 this, this.parseData, onFail);84 }85 82 }, 86 83 … … 99 96 }, 100 97 98 /** 99 * Method: loadText 100 * Start the load of the Text data. Don't do this when we first add the layer, 101 * since we may not be visible at any point, and it would therefore be a waste. 102 */ 103 loadText: function() { 104 if (!this.loaded) { 105 if (this.location != null) { 106 107 var onFail = function(e) { 108 this.events.triggerEvent("loadend"); 109 }; 110 111 this.events.triggerEvent("loadstart"); 112 OpenLayers.loadURL(this.location, null, 113 this, this.parseData, onFail); 114 this.loaded = true; 115 } 116 } 117 }, 118 119 /** 120 * Method: moveTo 121 * If layer is visible and Text has not been loaded, load Text. 122 * 123 * Parameters: 124 * bounds - {Object} 125 * zoomChanged - {Object} 126 * minor - {Object} 127 */ 128 moveTo:function(bounds, zoomChanged, minor) { 129 OpenLayers.Layer.Markers.prototype.moveTo.apply(this, arguments); 130 if(this.visibility && !this.loaded){ 131 this.events.triggerEvent("loadstart"); 132 this.loadText(); 133 } 134 }, 101 135 102 136 /** … … 108 142 parseData: function(ajaxRequest) { 109 143 var text = ajaxRequest.responseText; 110 var parser = new OpenLayers.Format.Text(); 144 145 var options = {}; 146 147 OpenLayers.Util.extend(options, this.formatOptions); 148 149 if (this.map && !this.projection.equals(this.map.getProjectionObject())) { 150 options.externalProjection = this.projection; 151 options.internalProjection = this.map.getProjectionObject(); 152 } 153 154 var parser = new OpenLayers.Format.Text(options); 111 155 features = parser.read(text); 112 156 for (var i = 0; i < features.length; i++) { sandbox/tschaub/wmc/lib/OpenLayers/Layer/TileCache.js
r5616 r5857 104 104 var bbox = this.maxExtent; 105 105 var size = this.tileSize; 106 var tileX = Math. floor((bounds.left - bbox.left) / (res * size.w));107 var tileY = Math. floor((bounds.bottom - bbox.bottom) / (res * size.h));106 var tileX = Math.round((bounds.left - bbox.left) / (res * size.w)); 107 var tileY = Math.round((bounds.bottom - bbox.bottom) / (res * size.h)); 108 108 var tileZ = this.map.zoom; 109 109 /** sandbox/tschaub/wmc/lib/OpenLayers/Layer/WFS.js
r5616 r5857 54 54 */ 55 55 featureClass: null, 56 57 /** 58 * APIProperty: format 59 * {<OpenLayers.Format>} The format you want the data to be parsed with. 60 * Must be passed in the constructor. Should be a class, not an instance. 61 */ 62 format: null, 63 64 /** 65 * Property: formatObject 66 * {<OpenLayers.Format>} Internally created/managed format object, used by 67 * the Tile to parse data. 68 */ 69 formatObject: null, 70 71 /** 72 * APIProperty: formatOptions 73 * {Object} Hash of options which should be passed to the format when it is 74 * created. Must be passed in the constructor. 75 */ 76 formatOptions: null, 56 77 57 78 /** … … 147 168 if (this.vectorMode) { 148 169 OpenLayers.Layer.Vector.prototype.setMap.apply(this, arguments); 170 171 var options = { 172 'extractAttributes': this.extractAttributes 173 }; 174 175 OpenLayers.Util.extend(options, this.formatOptions); 176 if (this.map && !this.projection.equals(this.map.getProjectionObject())) { 177 options.externalProjection = this.projection; 178 options.internalProjection = this.map.getProjectionObject(); 179 } 180 181 this.formatObject = this.format ? new this.format(options) : new OpenLayers.Format.GML(options); 149 182 } else { 150 183 OpenLayers.Layer.Markers.prototype.setMap.apply(this, arguments); sandbox/tschaub/wmc/lib/OpenLayers/Map.js
r5692 r5857 27 27 /** 28 28 * Constant: EVENT_TYPES 29 * {Array(String)} supported application event types 29 * {Array(String)} Supported application event types. Register a listener 30 * for a particular event with the following syntax: 31 * (code) 32 * map.events.register(type, obj, listener); 33 * (end) 34 * 35 * Supported map event types: 36 * - *addlayer* triggered after a layer has been added 37 * - *removelayer* triggered after a layer has been removed 38 * - *changelayer* triggered after a layer name change, order change, or 39 * visibility change (due to resolution thresholds) 40 * - *movestart* triggered after the start of a drag, pan, or zoom 41 * - *move* triggered after each drag, pan, or zoom 42 * - *moveend* triggered after a drag, pan, or zoom completes 43 * - *popupopen* triggered after a popup opens 44 * - *popupclose* triggered after a popup opens 45 * - *addmarker* triggered after a marker has been added 46 * - *removemarker* triggered after a marker has been removed 47 * - *clearmarkers* triggered after markers have been cleared 48 * - *mouseover* triggered after mouseover the map 49 * - *mouseout* triggered after mouseout the map 50 * - *mousemove* triggered after mousemove the map 51 * - *dragstart* triggered after the start of a drag 52 * - *drag* triggered after a drag 53 * - *dragend* triggered after the end of a drag 54 * - *changebaselayer* triggered after the base layer changes 30 55 */ 31 56 EVENT_TYPES: [ sandbox/tschaub/wmc/lib/OpenLayers/Projection.js
r5616 r5857 90 90 */ 91 91 equals: function(projection) { 92 return this.getCode() == projection.getCode(); 92 if (projection && projection.getCode) { 93 return this.getCode() == projection.getCode(); 94 } else { 95 return false; 96 } 93 97 }, 94 98 sandbox/tschaub/wmc/lib/OpenLayers/Renderer/Elements.js
r5616 r5857 135 135 //now actually draw the node, and style it 136 136 node = this.drawGeometryNode(node, geometry); 137 this.root.appendChild(node); 137 138 // append the node to root (but only if it's new) 139 if (node.parentNode != this.root) { 140 this.root.appendChild(node); 141 } 138 142 this.postDraw(node); 139 143 } else { sandbox/tschaub/wmc/lib/OpenLayers/Renderer/SVG.js
r5616 r5857 337 337 node.setAttributeNS(null, "r", radius); 338 338 } else { 339 this.root.removeChild(node); 339 if (node.parentNode == this.root) { 340 this.root.removeChild(node); 341 } 340 342 } 341 343 sandbox/tschaub/wmc/lib/OpenLayers/Renderer/VML.js
r5616 r5857 241 241 node.appendChild(stroke); 242 242 } 243 stroke.setAttribute("opacity", style.strokeOpacity); 243 if (style.strokeOpacity) { 244 stroke.setAttribute("opacity", style.strokeOpacity); 245 } 244 246 stroke.setAttribute("endcap", !style.strokeLinecap || style.strokeLinecap == 'butt' ? 'flat' : style.strokeLinecap); 245 247 } sandbox/tschaub/wmc/lib/OpenLayers/Tile.js
r5616 r5857 119 119 this.events.destroy(); 120 120 this.events = null; 121 }, 122 123 /** 124 * Method: clone 125 * 126 * Parameters: 127 * obj - {<OpenLayers.Tile>} The tile to be cloned 128 * 129 * Returns: 130 * {<OpenLayers.Tile>} An exact clone of this <OpenLayers.Tile> 131 */ 132 clone: function (obj) { 133 if (obj == null) { 134 obj = new OpenLayers.Tile(this.layer, 135 this.position, 136 this.bounds, 137 this.url, 138 this.size); 139 } 140 141 // catch any randomly tagged-on properties 142 OpenLayers.Util.applyDefaults(obj, this); 143 144 return obj; 121 145 }, 122 146 sandbox/tschaub/wmc/lib/OpenLayers/Tile/Image.js
r5616 r5857 93 93 94 94 /** 95 * Method: clone 96 * 97 * Parameters: 98 * obj - {<OpenLayers.Tile.Image>} The tile to be cloned 99 * 100 * Returns: 101 * {<OpenLayers.Tile.Image>} An exact clone of this <OpenLayers.Tile.Image> 102 */ 103 clone: function (obj) { 104 if (obj == null) { 105 obj = new OpenLayers.Tile.Image(this.layer, 106 this.position, 107 this.bounds, 108 this.url, 109 this.size); 110 } 111 112 //pick up properties from superclass 113 obj = OpenLayers.Tile.prototype.clone.apply(this, [obj]); 114 115 //dont want to directly copy the image div 116 obj.imgDiv = null; 117 118 119 return obj; 120 }, 121 122 /** 95 123 * Method: draw 96 124 * Check that a tile should be drawn, and draw it. … … 146 174 if(this.imgDiv) { 147 175 this.imgDiv.style.display = "none"; 176 if (OpenLayers.Tile.Image.useBlankTile) { 177 this.imgDiv.src = OpenLayers.Util.getImagesLocation() + "blank.gif"; 178 } 148 179 } 149 180 }, … … 267 298 } 268 299 ); 300 301 OpenLayers.Tile.Image.useBlankTile = ( 302 OpenLayers.Util.getBrowserName() == "safari" || 303 OpenLayers.Util.getBrowserName() == "opera"); sandbox/tschaub/wmc/lib/OpenLayers/Tile/WFS.js
r5616 r5857 68 68 if(this.request) { 69 69 this.request.transport.abort(); 70 //this.request.destroy(); 71 this.request = null; 70 72 } 71 73 }, … … 109 111 */ 110 112 loadFeaturesForRegion:function(success, failure) { 113 if(this.request) { 114 this.request.transport.abort(); 115 //this.request.destroy(); 116 } 111 117 this.request = OpenLayers.loadURL(this.url, null, this, success); 112 118 }, … … 128 134 } 129 135 if (this.layer.vectorMode) { 130 var gml = new OpenLayers.Format.GML({ 131 'extractAttributes': this.layer.options.extractAttributes 132 }); 133 this.layer.addFeatures(gml.read(doc)); 136 this.layer.addFeatures(this.layer.formatObject.read(doc)); 134 137 } else { 135 138 var resultFeatures = OpenLayers.Ajax.getElementsByTagNameNS( … … 142 145 this.events.triggerEvent("loadend"); 143 146 } 147 148 //request produced with success, we can delete the request object. 149 //this.request.destroy(); 150 this.request = null; 144 151 }, 145 152 sandbox/tschaub/wmc/tests/Format/test_GeoRSS.html
r5478 r5857 35 35 t.eq(data[0].geometry.x, -1, "w3c geo x read correctly"); 36 36 t.eq(data[0].geometry.y, 1, "w3c geo y read correctly"); 37 } 38 function test_Format_GeoRSS_reproject_null(t) { 39 t.plan(1); 40 41 var parser = new OpenLayers.Format.GeoRSS({'internalProjection':new OpenLayers.Projection("EPSG:4326"), 'externalProjection': new OpenLayers.Projection("EPSG:4326")}); 42 var data = parser.read('<rss xmlns="http://backend.userland.com/rss2" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"><item></item></rss>'); 43 t.eq(data.length, 1, "Parsing items with null geometry and reprojection doesn't fail"); 37 44 } 38 45 function test_Format_GeoRSS_roundtrip(t) { sandbox/tschaub/wmc/tests/Layer/test_GML.html
r4252 r5857 7 7 8 8 var gml = "./owls.xml"; 9 var gml2 = "./mice.xml"; 9 10 10 11 // if this test is running online, different rules apply … … 12 13 if (isMSIE) { 13 14 gml = "." + gml; 15 gml2 = "." + gml2; 14 16 } 15 17 … … 41 43 42 44 } 45 function test_GML_setUrl(t) { 46 t.plan(2); 47 var layer = new OpenLayers.Layer.GML(name, gml); 48 var map = new OpenLayers.Map("map"); 49 map.addLayer(layer); 50 t.eq(layer.url, gml, "layer has correct original url"); 51 layer.setUrl(gml2); 52 t.eq(layer.url, gml2, "layer has correctly changed url"); 53 } 43 54 </script> 44 55 </head> sandbox/tschaub/wmc/tests/Layer/test_GeoRSS.html
r4356 r5857 22 22 t.eq( layer.location, georss_txt, "layer.location is correct" ); 23 23 var markers; 24 layer.loadRSS(); 24 25 t.delay_call( 1, function() { 25 26 t.eq( layer.markers.length, 40, "marker length is correct" ); … … 44 45 t.eq( layer.location, atom_xml, "layer.location is correct" ); 45 46 var markers; 47 layer.loadRSS(); 46 48 t.delay_call( 1, function() { 47 49 t.eq( layer.markers.length, 2, "marker length is correct" ); … … 154 156 map.setCenter(new OpenLayers.LonLat(0,0),0); 155 157 var defaultIcon = OpenLayers.Marker.defaultIcon(); 156 t.delay_call( 1, function() { 158 layer.loadRSS(); 159 otherLayer.loadRSS(); 160 t.delay_call( 2, function() { 157 161 t.ok(layer.markers[0].icon, "The layer has a icon"); 158 162 t.eq(layer.markers[0].icon.url, defaultIcon.url, "The layer without icon has the default icon."); sandbox/tschaub/wmc/tests/Layer/test_Text.html
r5489 r5857 22 22 23 23 layer = new OpenLayers.Layer.Text('Test Layer', { location: datafile }); 24 layer.loadText(); 24 25 t.ok( layer instanceof OpenLayers.Layer.Text, "new OpenLayers.Layer.Text returns object" ); 25 26 t.eq( layer.location, datafile, "layer.location is correct" ); sandbox/tschaub/wmc/tests/Layer/test_WFS.html
r5462 r5857 6 6 var name = "Vector Layer"; 7 7 8 function test_ 01_Layer_WFS_constructor(t) {8 function test_Layer_WFS_constructor(t) { 9 9 t.plan(3); 10 10 … … 15 15 16 16 } 17 function test_ 02_Layer_WFS_mapresizevector(t) {17 function test_Layer_WFS_mapresizevector(t) { 18 18 t.plan(2); 19 19 sandbox/tschaub/wmc/tests/Renderer/test_SVG.html
