Changeset 5914
- Timestamp:
- 01/27/08 21:47:56 (1 year ago)
- Files:
-
- sandbox/pagameba/transition-resize/doc/authors.txt (modified) (1 diff)
- sandbox/pagameba/transition-resize/examples/osm (copied) (copied from trunk/openlayers/examples/osm)
- sandbox/pagameba/transition-resize/examples/osm-layer.html (copied) (copied from trunk/openlayers/examples/osm-layer.html)
- sandbox/pagameba/transition-resize/examples/osm/sutton_coldfield.osm (copied) (copied from trunk/openlayers/examples/osm/sutton_coldfield.osm)
- sandbox/pagameba/transition-resize/examples/panel.html (modified) (1 diff)
- sandbox/pagameba/transition-resize/examples/proxy.cgi (modified) (1 diff)
- sandbox/pagameba/transition-resize/examples/wfs-t.html (modified) (1 diff)
- sandbox/pagameba/transition-resize/lib/OpenLayers.js (modified) (2 diffs)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Ajax.js (modified) (3 diffs)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Control.js (modified) (2 diffs)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Control/ArgParser.js (modified) (2 diffs)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Control/Button.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Control/Button.js)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Control/ModifyFeature.js (modified) (1 diff)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Control/MousePosition.js (modified) (2 diffs)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Control/Navigation.js (modified) (1 diff)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Control/Panel.js (modified) (1 diff)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Control/SelectFeature.js (modified) (1 diff)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Feature/Vector.js (modified) (3 diffs)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Format/OSM.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Format/OSM.js)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Format/WFS.js (modified) (8 diffs)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Handler/Drag.js (modified) (1 diff)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Layer/Markers.js (modified) (1 diff)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Layer/WFS.js (modified) (1 diff)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Map.js (modified) (3 diffs)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Renderer/SVG.js (modified) (1 diff)
- sandbox/pagameba/transition-resize/lib/OpenLayers/Renderer/VML.js (modified) (1 diff)
- sandbox/pagameba/transition-resize/tests/Control/test_Button.html (copied) (copied from trunk/openlayers/tests/Control/test_Button.html)
- sandbox/pagameba/transition-resize/tests/Control/test_Panel.html (modified) (1 diff)
- sandbox/pagameba/transition-resize/tests/Control/test_SelectFeature.html (modified) (2 diffs)
- sandbox/pagameba/transition-resize/tests/Format/test_OSM.html (copied) (copied from trunk/openlayers/tests/Format/test_OSM.html)
- sandbox/pagameba/transition-resize/tests/Handler/test_Drag.html (modified) (2 diffs)
- sandbox/pagameba/transition-resize/tests/Layer/test_Markers.html (modified) (2 diffs)
- sandbox/pagameba/transition-resize/tests/data/osm.js (copied) (copied from trunk/openlayers/tests/data/osm.js)
- sandbox/pagameba/transition-resize/tests/list-tests.html (modified) (3 diffs)
- sandbox/pagameba/transition-resize/tests/manual/tiles-loading.html (copied) (copied from trunk/openlayers/tests/manual/tiles-loading.html)
- sandbox/pagameba/transition-resize/tests/test_Ajax.html (copied) (copied from trunk/openlayers/tests/test_Ajax.html)
- sandbox/pagameba/transition-resize/tests/test_Control.html (modified) (1 diff)
- sandbox/pagameba/transition-resize/tests/test_Handler.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/pagameba/transition-resize/doc/authors.txt
r5822 r5914 14 14 Eric Lemoine 15 15 Philip Lindsay 16 Martijn van Oosterhout 16 17 Corey Puffault 17 18 Gregers Rygg sandbox/pagameba/transition-resize/examples/panel.html
r5822 r5914 70 70 71 71 72 zb = new OpenLayers.Control.ZoomBox(); 72 zb = new OpenLayers.Control.ZoomBox( 73 {title:"Zoom box: Selecting it you can zoom on an area by clicking and dragging."}); 73 74 var panel = new OpenLayers.Control.Panel({defaultControl: zb}); 74 75 panel.addControls([ 75 new OpenLayers.Control.MouseDefaults(), 76 new OpenLayers.Control.MouseDefaults( 77 {title:'You can use the default mouse configuration'}), 76 78 zb, 77 new OpenLayers.Control.DrawFeature(vlayer, OpenLayers.Handler.Path), 78 new OpenLayers.Control.ZoomToMaxExtent() 79 new OpenLayers.Control.DrawFeature(vlayer, OpenLayers.Handler.Path, 80 {title:'Draw a feature'}), 81 new OpenLayers.Control.ZoomToMaxExtent({title:"Zoom to the max extent"}) 79 82 ]); 80 83 map.addControl(panel); sandbox/pagameba/transition-resize/examples/proxy.cgi
r4371 r5914 18 18 allowedHosts = ['www.openlayers.org', 'openlayers.org', 19 19 'labs.metacarta.com', 'world.freemap.in', 20 'prototype.openmnnd.org', 'geo.openplans.org'] 20 'prototype.openmnnd.org', 'geo.openplans.org', 21 'www.openstreetmap.org'] 21 22 22 23 method = os.environ["REQUEST_METHOD"] sandbox/pagameba/transition-resize/examples/wfs-t.html
r5822 r5914 77 77 78 78 <div id="docs"> 79 This is an example of using a WFS layer type. 79 This is an example of using a WFS layer type. Note that it requires a 80 working GeoServer install, which the OpenLayers project does not maintain; 81 however, if you're interested, you should be able to point this against 82 a default GeoServer setup without too much trouble. 80 83 </div> 81 84 sandbox/pagameba/transition-resize/lib/OpenLayers.js
r5822 r5914 130 130 "OpenLayers/Control.js", 131 131 "OpenLayers/Control/Attribution.js", 132 "OpenLayers/Control/Button.js", 132 133 "OpenLayers/Control/ZoomBox.js", 133 134 "OpenLayers/Control/ZoomToMaxExtent.js", … … 180 181 "OpenLayers/Format/WFS.js", 181 182 "OpenLayers/Format/WKT.js", 183 "OpenLayers/Format/OSM.js", 182 184 "OpenLayers/Format/SLD.js", 183 185 "OpenLayers/Format/Text.js", sandbox/pagameba/transition-resize/lib/OpenLayers/Ajax.js
r5822 r5914 61 61 62 62 if (OpenLayers.ProxyHost && OpenLayers.String.startsWith(uri, "http")) { 63 uri = OpenLayers.ProxyHost + e scape(uri);63 uri = OpenLayers.ProxyHost + encodeURIComponent(uri); 64 64 } 65 65 … … 431 431 return this.transport.status || 0; 432 432 } catch (e) { 433 return 0 433 return 0; 434 434 } 435 435 }, … … 487 487 return this.transport.getResponseHeader(name); 488 488 } catch (e) { 489 return null 489 return null; 490 490 } 491 491 }, sandbox/pagameba/transition-resize/lib/OpenLayers/Control.js
r5822 r5914 85 85 */ 86 86 displayClass: "", 87 88 /** 89 * Property: title 90 * {string} This property is used for showing a tooltip over the 91 * Control. 92 */ 93 title: "", 87 94 88 95 /** … … 173 180 this.div = OpenLayers.Util.createDiv(this.id); 174 181 this.div.className = this.displayClass; 182 if (this.title != "") { 183 this.div.title = this.title; 184 } 175 185 } 176 186 if (px != null) { sandbox/pagameba/transition-resize/lib/OpenLayers/Control/ArgParser.js
r5823 r5914 87 87 88 88 var args = OpenLayers.Util.getParameters(); 89 // Be careful to set layer first, to not trigger unnecessary layer loads 90 if (args.layers) { 91 this.layers = args.layers; 92 93 // when we add a new layer, set its visibility 94 this.map.events.register('addlayer', this, 95 this.configureLayers); 96 this.configureLayers(); 97 } 89 98 if (args.lat && args.lon) { 90 99 this.center = new OpenLayers.LonLat(parseFloat(args.lon), … … 98 107 this.setCenter); 99 108 this.setCenter(); 100 }101 102 if (args.layers) {103 this.layers = args.layers;104 105 // when we add a new layer, set its visibility106 this.map.events.register('addlayer', this,107 this.configureLayers);108 this.configureLayers();109 109 } 110 110 } sandbox/pagameba/transition-resize/lib/OpenLayers/Control/ModifyFeature.js
r5822 r5914 262 262 this.vertices = []; 263 263 this.dragControl.deactivate(); 264 if(this.feature ) {264 if(this.feature && this.feature.geometry) { 265 265 this.selectControl.unselect.apply(this.selectControl, 266 266 [this.feature]); sandbox/pagameba/transition-resize/lib/OpenLayers/Control/MousePosition.js
r5822 r5914 131 131 } 132 132 133 var newHtml = this.formatOutput(lonLat); 134 135 if (newHtml != this.element.innerHTML) { 136 this.element.innerHTML = newHtml; 137 } 138 }, 139 140 /** 141 * Method: formatOutput 142 * Override to provide custom display output 143 * 144 * Parameters: 145 * lonLat - {<OpenLayers.LonLat>} Location to display 146 */ 147 formatOutput: function(lonLat) { 133 148 var digits = parseInt(this.numdigits); 134 149 var newHtml = … … 138 153 lonLat.lat.toFixed(digits) + 139 154 this.suffix; 140 141 if (newHtml != this.element.innerHTML) { 142 this.element.innerHTML = newHtml; 143 } 144 }, 155 return newHtml; 156 }, 145 157 146 158 /** sandbox/pagameba/transition-resize/lib/OpenLayers/Control/Navigation.js
r5822 r5914 55 55 }, 56 56 57 /** 58 * Method: destroy 59 * The destroy method is used to perform any clean up before the control 60 * is dereferenced. Typically this is where event listeners are removed 61 * to prevent memory leaks. 62 */ 63 destroy: function() { 64 OpenLayers.Control.prototype.destroy.apply(this,arguments); 65 this.deactivate(); 66 this.dragPan.destroy(); 67 this.wheelHandler.destroy(); 68 this.clickHandler.destroy(); 69 this.zoomBox.destroy(); 70 }, 71 57 72 /** 58 73 * Method: activate sandbox/pagameba/transition-resize/lib/OpenLayers/Control/Panel.js
r5822 r5914 173 173 var textNode = document.createTextNode(" "); 174 174 controls[i].panel_div = element; 175 if (controls[i].title != "") { 176 controls[i].panel_div.title = controls[i].title; 177 } 175 178 OpenLayers.Event.observe(controls[i].panel_div, "click", 176 179 OpenLayers.Function.bind(this.onClick, this, controls[i])); sandbox/pagameba/transition-resize/lib/OpenLayers/Control/SelectFeature.js
r5822 r5914 221 221 select: function(feature) { 222 222 // Store feature style for restoration later 223 if(feature.originalStyle == null) {223 if(feature.originalStyle != feature.style) { 224 224 feature.originalStyle = feature.style; 225 225 } 226 226 this.layer.selectedFeatures.push(feature); 227 feature.style = this.selectStyle; 227 228 var selectStyle = this.selectStyle; 229 230 if (feature.style.CLASS_NAME == "OpenLayers.Style") { 231 feature.style = feature.style.createStyle(feature); 232 } else { 233 feature.style = OpenLayers.Util.extend({}, feature.style); 234 } 235 if (selectStyle.CLASS_NAME == "OpenLayers.Style") { 236 selectStyle = selectStyle.createStyle(feature); 237 } 238 OpenLayers.Util.extend(feature.style, selectStyle); 239 228 240 this.layer.drawFeature(feature); 229 241 this.onSelect(feature); sandbox/pagameba/transition-resize/lib/OpenLayers/Feature/Vector.js
r5822 r5914 280 280 * - hoverPointUnit: "%", 281 281 * - pointerEvents: "visiblePainted" 282 * - cursor: "" 282 283 * 283 284 * Other style properties that have no default values: … … 307 308 hoverPointRadius: 1, 308 309 hoverPointUnit: "%", 309 pointerEvents: "visiblePainted" 310 pointerEvents: "visiblePainted", 311 cursor: "" 310 312 }, 311 313 'select': { … … 342 344 hoverPointRadius: 1, 343 345 hoverPointUnit: "%", 344 pointerEvents: "visiblePainted" 346 pointerEvents: "visiblePainted", 347 cursor: "" 345 348 } 346 349 }; sandbox/pagameba/transition-resize/lib/OpenLayers/Format/WFS.js
r5822 r5914 59 59 write: function(features) { 60 60 61 var transaction = document.createElementNS('http://www.opengis.net/wfs', 'wfs:Transaction');61 var transaction = this.createElementNS('http://www.opengis.net/wfs', 'wfs:Transaction'); 62 62 transaction.setAttribute("version","1.0.0"); 63 63 transaction.setAttribute("service","WFS"); … … 86 86 createFeatureXML: function(feature) { 87 87 var geometryNode = this.buildGeometryNode(feature.geometry); 88 var geomContainer = document.createElementNS(this.featureNS, "feature:" + this.geometryName);88 var geomContainer = this.createElementNS(this.featureNS, "feature:" + this.geometryName); 89 89 geomContainer.appendChild(geometryNode); 90 var featureContainer = document.createElementNS(this.featureNS, "feature:" + this.featureName);90 var featureContainer = this.createElementNS(this.featureNS, "feature:" + this.featureName); 91 91 featureContainer.appendChild(geomContainer); 92 92 for(var attr in feature.attributes) { … … 96 96 nodename = attr.split(":")[1]; 97 97 } 98 var attrContainer = document.createElementNS(this.featureNS, "feature:" + nodename);98 var attrContainer = this.createElementNS(this.featureNS, "feature:" + nodename); 99 99 attrContainer.appendChild(attrText); 100 100 featureContainer.appendChild(attrContainer); … … 111 111 */ 112 112 insert: function(feature) { 113 var insertNode = document.createElementNS(this.wfsns, 'wfs:Insert');113 var insertNode = this.createElementNS(this.wfsns, 'wfs:Insert'); 114 114 insertNode.appendChild(this.createFeatureXML(feature)); 115 115 return insertNode; … … 125 125 update: function(feature) { 126 126 if (!feature.fid) { alert("Can't update a feature for which there is no FID."); } 127 var updateNode = document.createElementNS(this.wfsns, 'wfs:Update');127 var updateNode = this.createElementNS(this.wfsns, 'wfs:Update'); 128 128 updateNode.setAttribute("typeName", this.layerName); 129 129 130 var propertyNode = document.createElementNS(this.wfsns, 'wfs:Property');131 var nameNode = document.createElementNS('http://www.opengis.net/wfs', 'wfs:Name');130 var propertyNode = this.createElementNS(this.wfsns, 'wfs:Property'); 131 var nameNode = this.createElementNS('http://www.opengis.net/wfs', 'wfs:Name'); 132 132 133 133 var txtNode = document.createTextNode(this.geometryName); … … 135 135 propertyNode.appendChild(nameNode); 136 136 137 var valueNode = document.createElementNS('http://www.opengis.net/wfs', 'wfs:Value');137 var valueNode = this.createElementNS('http://www.opengis.net/wfs', 'wfs:Value'); 138 138 valueNode.appendChild(this.buildGeometryNode(feature.geometry)); 139 139 … … 141 141 updateNode.appendChild(propertyNode); 142 142 143 var filterNode = document.createElementNS('http://www.opengis.net/ogc', 'ogc:Filter');144 var filterIdNode = document.createElementNS('http://www.opengis.net/ogc', 'ogc:FeatureId');143 var filterNode = this.createElementNS('http://www.opengis.net/ogc', 'ogc:Filter'); 144 var filterIdNode = this.createElementNS('http://www.opengis.net/ogc', 'ogc:FeatureId'); 145 145 filterIdNode.setAttribute("fid", feature.fid); 146 146 filterNode.appendChild(filterIdNode); … … 162 162 return false; 163 163 } 164 var deleteNode = document.createElementNS(this.featureNS, 'wfs:Delete');164 var deleteNode = this.createElementNS(this.featureNS, 'wfs:Delete'); 165 165 deleteNode.setAttribute("typeName", this.layerName); 166 166 167 var filterNode = document.createElementNS('http://www.opengis.net/ogc', 'ogc:Filter');168 var filterIdNode = document.createElementNS('http://www.opengis.net/ogc', 'ogc:FeatureId');167 var filterNode = this.createElementNS('http://www.opengis.net/ogc', 'ogc:Filter'); 168 var filterIdNode = this.createElementNS('http://www.opengis.net/ogc', 'ogc:FeatureId'); 169 169 filterIdNode.setAttribute("fid", feature.fid); 170 170 filterNode.appendChild(filterIdNode); sandbox/pagameba/transition-resize/lib/OpenLayers/Handler/Drag.js
r5822 r5914 168 168 169 169 if(!this.oldOnselectstart) { 170 this.oldOnselectstart = document.onselectstart;170 this.oldOnselectstart = (document.onselectstart) ? document.onselectstart : function() { return true; }; 171 171 document.onselectstart = function() {return false;}; 172 172 } sandbox/pagameba/transition-resize/lib/OpenLayers/Layer/Markers.js
r5822 r5914 121 121 */ 122 122 removeMarker: function(marker) { 123 OpenLayers.Util.removeItem(this.markers, marker); 124 if ((marker.icon != null) && (marker.icon.imageDiv != null) && 125 (marker.icon.imageDiv.parentNode == this.div) ) { 126 this.div.removeChild(marker.icon.imageDiv); 127 marker.drawn = false; 123 if (this.markers && this.markers.length) { 124 OpenLayers.Util.removeItem(this.markers, marker); 125 if ((marker.icon != null) && (marker.icon.imageDiv != null) && 126 (marker.icon.imageDiv.parentNode == this.div) ) { 127 this.div.removeChild(marker.icon.imageDiv); 128 marker.drawn = false; 129 } 128 130 } 129 131 }, sandbox/pagameba/transition-resize/lib/OpenLayers/Layer/WFS.js
r5847 r5914 245 245 !this.tile.bounds.containsBounds(bounds)); 246 246 247 if ( (zoomChanged || firstRendering || (!dragging && outOfBounds)) 248 && this.inRange) { 247 if (zoomChanged || firstRendering || (!dragging && outOfBounds)) { 249 248 //determine new tile bounds 250 249 var center = bounds.getCenterLonLat(); sandbox/pagameba/transition-resize/lib/OpenLayers/Map.js
r5822 r5914 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: [ … … 260 285 * {Boolean} Should OpenLayers allow events on the map to fall through to 261 286 * other elements on the page, or should it swallow them? (#457) 262 * Default is to swallow them.263 */ 264 fallThrough: false,287 * Default is to fall through. 288 */ 289 fallThrough: true, 265 290 266 291 /** … … 1317 1342 var layer = this.layers[i]; 1318 1343 if (!layer.isBaseLayer) { 1319 1320 var moveLayer;1321 1344 var inRange = layer.calculateInRange(); 1322 1345 if (layer.inRange != inRange) { 1323 // Layer property has changed. We are going 1324 // to call moveLayer so that the layer can be turned 1325 // off or on. 1346 // the inRange property has changed. If the layer is 1347 // no longer in range, we turn it off right away. If 1348 // the layer is no longer out of range, the moveTo 1349 // call below will turn on the layer. 1326 1350 layer.inRange = inRange; 1327 moveLayer = true; 1351 if (!inRange) { 1352 layer.display(false); 1353 } 1328 1354 this.events.triggerEvent("changelayer"); 1329 } else {1330 // If nothing has changed, then we only move the layer1331 // if it is visible and inrange.1332 moveLayer = (layer.visibility && layer.inRange);1333 1355 } 1334 1335 if (moveLayer) { 1356 if (inRange && layer.visibility) { 1336 1357 layer.moveTo(bounds, zoomChanged, dragging); 1337 1358 } sandbox/pagameba/transition-resize/lib/OpenLayers/Renderer/SVG.js
r5847 r5914 242 242 } 243 243 244 if (style.cursor ) {244 if (style.cursor != null) { 245 245 node.setAttributeNS(null, "cursor", style.cursor); 246 246 } sandbox/pagameba/transition-resize/lib/OpenLayers/Renderer/VML.js
r5847 r5914 247 247 } 248 248 249 if (style.cursor ) {249 if (style.cursor != null) { 250 250 node.style.cursor = style.cursor; 251 251 } sandbox/pagameba/transition-resize/tests/Control/test_Panel.html
r5822 r5914 47 47 "activated the other tool control, the first one is inactive and the toggle control still active."); 48 48 } 49 49 function test_02_Control_Panel_titles (t) { 50 t.plan(2); 51 var panel = new OpenLayers.Control.Panel(); 52 var toolControl = new OpenLayers.Control.ZoomBox({ 53 title:"Zoom box: Selecting it you can zoom on an area by clicking and dragging." 54 }); 55 panel.addControls([toolControl]); 56 t.eq(panel.controls.length, 1, "added a control to the panel"); 57 t.eq(panel.controls[0].title, toolControl.panel_div.title, "the title is correctly set"); 58 } 59 50 60 function test_Control_Panel_getBy(t) { 51 61 sandbox/pagameba/transition-resize/tests/Control/test_SelectFeature.html
r4232 r5914 34 34 35 35 function test_Control_SelectFeature_select(t) { 36 t.plan( 2);36 t.plan(7); 37 37 var map = new OpenLayers.Map("map"); 38 38 var layer = new OpenLayers.Layer.Vector(); … … 46 46 control.unselect(feature); 47 47 t.eq(feature.style.strokeColor, OpenLayers.Feature.Vector.style['default'].strokeColor, "feature style is set back to old style"); 48 49 // Don't ever overwrite my feature style with undefined properties from the selectStyle 50 feature.style = {externalGraphic: "foo.png", pointRadius: 39}; 51 control.selectStyle.pointRadius = undefined; 52 control.select(feature); 53 t.eq(feature.style.pointRadius, 39, "undefined style property inherited from original feature style"); 54 control.unselect(feature); 55 56 // Ok, that one went well. But I'm sure you cannot handle OL.Style. 57 feature.style = new OpenLayers.Style({externalGraphic: "foo.png", pointRadius: 39}); 58 control.select(feature); 59 t.eq(feature.style.pointRadius, 39, "undefined style property inherited from original feature style object"); 60 control.unselect(feature); 61 62 // Wow, but using OL.Style as selectStyle will break you. 63 control.selectStyle = new OpenLayers.Style({strokeColor: "green"}); 64 control.select(feature); 65 t.eq(feature.style.strokeColor, "green", "style correct if both feature.style and selectStyle are OL.Style"); 66 control.unselect(feature); 67 68 // Not bad, not bad. And what if I set feature.style back to a style hash? 69 feature.style = layer.style; 70 control.select(feature); 71 t.eq(feature.style.strokeColor, "green", "style still correct with only selectStyle being OL.Style"); 72 control.unselect(feature); 73 t.eq(feature.style.strokeColor, OpenLayers.Feature.Vector.style["default"].strokeColor, "style set back to original correctly"); 48 74 } 49 75 sandbox/pagameba/transition-resize/tests/Handler/test_Drag.html
r5822 r5914 88 88 89 89 function test_Handler_Drag_callbacks(t) { 90 t.plan(3 4);90 t.plan(33); 91 91 92 92 var map = new OpenLayers.Map('map', {controls: []}); … … 169 169 "mousedown default action is disabled"); 170 170 } else { 171 t.ok(evt.xy.x == testEvents.down.xy.x && 172 evt.xy.y == testEvents.down.xy.y, 171 t.fail( 173 172 "mousedown is prevented from falling to other elements"); 174 173 } sandbox/pagameba/transition-resize/tests/Layer/test_Markers.html
r5822 r5914 24 24 } 25 25 function test_98_Layer_Markers_addMarker_removeMarker (t) { 26 t.plan( 3);26 t.plan( 4 ); 27 27 28 28 var map = new OpenLayers.Map('map'); … … 41 41 layer.addMarker(marker); 42 42 t.ok( marker.icon.imageDiv.parentNode == layer.div, "addMarker adds marker image node into layer node." ); 43 44 layer.markers = null; 45 layer.removeMarker(marker); 46 t.ok(true, "removing marker when no markers present does not script error"); 47 43 48 } 44 49 function test_99_Layer_Markers_destroy (t) { sandbox/pagameba/transition-resize/tests/list-tests.html
r5822 r5914 1 1 <ul id="testlist"> 2 <li>test_Ajax.html</li> 2 3 <li>test_BaseTypes.html</li> 3 4 <li>BaseTypes/test_Bounds.html</li> … … 25 26 <li>Format/test_GML.html</li> 26 27 <li>Format/test_JSON.html</li> 28 <li>Format/test_OSM.html</li> 27 29 <li>Format/test_KML.html</li> 28 30 <li>Format/test_SLD.html</li> … … 73 75 <li>test_Control.html</li> 74 76 <li>Control/test_Attribution.html</li> 77 <li>Control/test_Button.html</li> 75 78 <li>Control/test_DragFeature.html</li> 76 79 <li>Control/test_DragPan.html</li> sandbox/pagameba/transition-resize/tests/test_Control.html
r5070 r5914 22 22 t.ok(map.controls[map.controls.length - 1] === control, "map.controls contains control"); 23 23 } 24 24 25 function test_Control_title(t) { 26 t.plan( 1 ); 27 var titleText = 'Title test'; 28 control = new OpenLayers.Control({title:titleText}); 29 t.eq( control.title, titleText, "control.title set correctly" ); 30 } 31 25 32 function test_Control_destroy(t) { 26 33 t.plan(3); sandbox/pagameba/transition-resize/tests/test_Handler.html
r4062 r5914 72 72 function test_Handler_deactivate(t) { 73 73 t.plan(52); 74 var map = new OpenLayers.Map('map'); 74 var map = new OpenLayers.Map('map', { controls: []}); 75 // No controls so that we don't get more thingies than we expect 76 // when we actually clean up after ourselves: r5891 caused this 77 // because we actually destroy things now on the navigation control. 75 78 var control = new OpenLayers.Control(); 76 79 map.addControl(control);
