Changeset 5969
- Timestamp:
- 02/01/08 18:41:51 (1 year ago)
- Files:
-
- sandbox/tschaub/fractional/doc/authors.txt (modified) (1 diff)
- sandbox/tschaub/fractional/examples/boxes-vector.html (copied) (copied from trunk/openlayers/examples/boxes-vector.html)
- sandbox/tschaub/fractional/examples/georss-flickr.html (modified) (2 diffs)
- sandbox/tschaub/fractional/examples/hover-handler.html (copied) (copied from trunk/openlayers/examples/hover-handler.html)
- sandbox/tschaub/fractional/examples/osm (copied) (copied from trunk/openlayers/examples/osm)
- sandbox/tschaub/fractional/examples/osm-layer.html (copied) (copied from trunk/openlayers/examples/osm-layer.html)
- sandbox/tschaub/fractional/examples/osm/sutton_coldfield.osm (copied) (copied from trunk/openlayers/examples/osm/sutton_coldfield.osm)
- sandbox/tschaub/fractional/examples/panel.html (modified) (1 diff)
- sandbox/tschaub/fractional/examples/point-track-markers.html (copied) (copied from trunk/openlayers/examples/point-track-markers.html)
- sandbox/tschaub/fractional/examples/proxy.cgi (modified) (1 diff)
- sandbox/tschaub/fractional/examples/sld.html (modified) (1 diff)
- sandbox/tschaub/fractional/examples/tasmania/sld-tasmania.xml (modified) (2 diffs)
- sandbox/tschaub/fractional/examples/vector-features.html (modified) (1 diff)
- sandbox/tschaub/fractional/examples/wfs-t.html (modified) (1 diff)
- sandbox/tschaub/fractional/examples/wmc.html (copied) (copied from trunk/openlayers/examples/wmc.html)
- sandbox/tschaub/fractional/examples/wms-untiled.html (modified) (2 diffs)
- sandbox/tschaub/fractional/examples/xml/track1.xml (copied) (copied from trunk/openlayers/examples/xml/track1.xml)
- sandbox/tschaub/fractional/lib/OpenLayers.js (modified) (5 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Ajax.js (modified) (3 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Control.js (modified) (2 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Control/ArgParser.js (modified) (3 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Control/Button.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Control/Button.js)
- sandbox/tschaub/fractional/lib/OpenLayers/Control/ModifyFeature.js (modified) (1 diff)
- sandbox/tschaub/fractional/lib/OpenLayers/Control/MousePosition.js (modified) (2 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Control/Navigation.js (modified) (1 diff)
- sandbox/tschaub/fractional/lib/OpenLayers/Control/Panel.js (modified) (1 diff)
- sandbox/tschaub/fractional/lib/OpenLayers/Control/SelectFeature.js (modified) (3 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Control/ZoomBox.js (modified) (2 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Feature/Vector.js (modified) (3 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Format/GeoRSS.js (modified) (1 diff)
- sandbox/tschaub/fractional/lib/OpenLayers/Format/OSM.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Format/OSM.js)
- sandbox/tschaub/fractional/lib/OpenLayers/Format/SLD.js (modified) (4 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Format/WFS.js (modified) (8 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Format/WMC (copied) (copied from trunk/openlayers/lib/OpenLayers/Format/WMC)
- sandbox/tschaub/fractional/lib/OpenLayers/Format/WMC.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Format/WMC.js)
- sandbox/tschaub/fractional/lib/OpenLayers/Format/WMC/v1.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Format/WMC/v1.js)
- sandbox/tschaub/fractional/lib/OpenLayers/Format/WMC/v1_0_0.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Format/WMC/v1_0_0.js)
- sandbox/tschaub/fractional/lib/OpenLayers/Format/WMC/v1_1_0.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Format/WMC/v1_1_0.js)
- sandbox/tschaub/fractional/lib/OpenLayers/Format/XML.js (modified) (2 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Handler/Click.js (modified) (2 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Handler/Drag.js (modified) (2 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Handler/Hover.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Handler/Hover.js)
- sandbox/tschaub/fractional/lib/OpenLayers/Layer.js (modified) (5 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Layer/GML.js (modified) (3 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Layer/GeoRSS.js (modified) (5 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Layer/Markers.js (modified) (1 diff)
- sandbox/tschaub/fractional/lib/OpenLayers/Layer/PointTrack.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Layer/PointTrack.js)
- sandbox/tschaub/fractional/lib/OpenLayers/Layer/SphericalMercator.js (modified) (1 diff)
- sandbox/tschaub/fractional/lib/OpenLayers/Layer/TMS.js (modified) (1 diff)
- sandbox/tschaub/fractional/lib/OpenLayers/Layer/Text.js (modified) (4 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Layer/TileCache.js (modified) (1 diff)
- sandbox/tschaub/fractional/lib/OpenLayers/Layer/WFS.js (modified) (3 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Map.js (modified) (3 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Projection.js (modified) (1 diff)
- sandbox/tschaub/fractional/lib/OpenLayers/Renderer/Elements.js (modified) (1 diff)
- sandbox/tschaub/fractional/lib/OpenLayers/Renderer/SVG.js (modified) (2 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Renderer/VML.js (modified) (2 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Rule.js (modified) (1 diff)
- sandbox/tschaub/fractional/lib/OpenLayers/Style.js (modified) (3 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Tile.js (modified) (1 diff)
- sandbox/tschaub/fractional/lib/OpenLayers/Tile/Image.js (modified) (3 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Tile/WFS.js (modified) (4 diffs)
- sandbox/tschaub/fractional/lib/OpenLayers/Util.js (modified) (1 diff)
- sandbox/tschaub/fractional/tests/Control/test_Button.html (copied) (copied from trunk/openlayers/tests/Control/test_Button.html)
- sandbox/tschaub/fractional/tests/Control/test_Panel.html (modified) (1 diff)
- sandbox/tschaub/fractional/tests/Control/test_SelectFeature.html (modified) (2 diffs)
- sandbox/tschaub/fractional/tests/Format/test_GeoRSS.html (modified) (1 diff)
- sandbox/tschaub/fractional/tests/Format/test_OSM.html (copied) (copied from trunk/openlayers/tests/Format/test_OSM.html)
- sandbox/tschaub/fractional/tests/Format/test_WMC.html (copied) (copied from trunk/openlayers/tests/Format/test_WMC.html)
- sandbox/tschaub/fractional/tests/Handler/test_Drag.html (modified) (2 diffs)
- sandbox/tschaub/fractional/tests/Handler/test_Hover.html (copied) (copied from trunk/openlayers/tests/Handler/test_Hover.html)
- sandbox/tschaub/fractional/tests/Layer/test_GML.html (modified) (3 diffs)
- sandbox/tschaub/fractional/tests/Layer/test_GeoRSS.html (modified) (3 diffs)
- sandbox/tschaub/fractional/tests/Layer/test_Markers.html (modified) (2 diffs)
- sandbox/tschaub/fractional/tests/Layer/test_PointTrack.html (copied) (copied from trunk/openlayers/tests/Layer/test_PointTrack.html)
- sandbox/tschaub/fractional/tests/Layer/test_Text.html (modified) (1 diff)
- sandbox/tschaub/fractional/tests/Layer/test_WFS.html (modified) (2 diffs)
- sandbox/tschaub/fractional/tests/Renderer/test_SVG.html (modified) (2 diffs)
- sandbox/tschaub/fractional/tests/Tile/test_Image.html (modified) (4 diffs)
- sandbox/tschaub/fractional/tests/Tile/test_WFS.html (modified) (3 diffs)
- sandbox/tschaub/fractional/tests/data/osm.js (copied) (copied from trunk/openlayers/tests/data/osm.js)
- sandbox/tschaub/fractional/tests/list-tests.html (modified) (5 diffs)
- sandbox/tschaub/fractional/tests/manual/tiles-loading.html (copied) (copied from trunk/openlayers/tests/manual/tiles-loading.html)
- sandbox/tschaub/fractional/tests/mice.xml (copied) (copied from trunk/openlayers/tests/mice.xml)
- sandbox/tschaub/fractional/tests/run-tests.html (modified) (1 diff)
- sandbox/tschaub/fractional/tests/test_Ajax.html (copied) (copied from trunk/openlayers/tests/test_Ajax.html)
- sandbox/tschaub/fractional/tests/test_Control.html (modified) (1 diff)
- sandbox/tschaub/fractional/tests/test_Handler.html (modified) (1 diff)
- sandbox/tschaub/fractional/tests/test_Layer.html (modified) (2 diffs)
- sandbox/tschaub/fractional/tests/test_OpenLayers.html (copied) (copied from trunk/openlayers/tests/test_OpenLayers.html)
- sandbox/tschaub/fractional/tests/test_Projection.html (modified) (2 diffs)
- sandbox/tschaub/fractional/tests/test_Style.html (modified) (5 diffs)
- sandbox/tschaub/fractional/tests/test_Tile.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/tschaub/fractional/doc/authors.txt
r5415 r5969 11 11 Pierre Giraud 12 12 Andreas Hocevar 13 Ian Johnson 13 14 Eric Lemoine 14 15 Philip Lindsay 16 Martijn van Oosterhout 15 17 Corey Puffault 16 18 Gregers Rygg sandbox/tschaub/fractional/examples/georss-flickr.html
r5429 r5969 29 29 // create a property style that reads the externalGraphic url from 30 30 // the thumbail attribute of the rss item 31 style = new OpenLayers.Style({ 32 externalGraphic: "${thumbnail}", 33 pointRadius: 20}); 31 style = new OpenLayers.Style({externalGraphic: "${thumbnail}"}); 34 32 35 33 // create a rule with a point symbolizer that will make the thumbnail … … 42 40 rule.value2regex("*"); 43 41 44 style.addRules([rule]); 42 // If the above rule does not apply, use a smaller pointRadius. 43 var elseRule = new OpenLayers.Rule({ 44 symbolizer: {"Point": {pointRadius: 20}}}); 45 46 style.addRules([rule, elseRule]); 45 47 46 48 markerLayer = new OpenLayers.Layer.Vector("", {style: style}); sandbox/tschaub/fractional/examples/panel.html
r5362 r5969 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/tschaub/fractional/examples/proxy.cgi
r4371 r5969 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/tschaub/fractional/examples/sld.html
r5530 r5969 66 66 hover = new OpenLayers.Control.SelectFeature(gmlLayers[2], { 67 67 selectStyle: waterStyle["Hover Styler"], 68 hover: true, 69 select: select 68 hover: true 70 69 }); 71 70 map.addControl(hover); 72 71 hover.activate(); 73 }74 75 // replaces OpenLayers.Control.Select.select76 var select = function(feature) {77 // store layer style78 var style = feature.layer.style;79 // set temporary layer style for hover rendering80 feature.layer.style = hover.selectStyle;81 OpenLayers.Control.SelectFeature.prototype.select.apply(hover, arguments);82 // restore layer style83 feature.layer.style = style;84 72 } 85 73 sandbox/tschaub/fractional/examples/tasmania/sld-tasmania.xml
r5520 r5969 51 51 </sld:Stroke> 52 52 </sld:PolygonSymbolizer> 53 </sld:Rule> 54 <sld:Rule> 55 <sld:Name>testRuleNameElse</sld:Name> 56 <sld:Title>title</sld:Title> 57 <sld:Abstract>Abstract</sld:Abstract> 58 <ogc:ElseFilter/> 53 59 </sld:Rule> 54 60 </sld:FeatureTypeStyle> … … 114 120 </sld:PolygonSymbolizer> 115 121 </sld:Rule> 116 122 <sld:Rule> 123 <sld:Name>testRuleNameHoverElse</sld:Name> 124 <sld:Title>title</sld:Title> 125 <sld:Abstract>Abstract</sld:Abstract> 126 <ogc:ElseFilter/> 127 </sld:Rule> 117 128 </sld:FeatureTypeStyle> 118 129 </sld:UserStyle> sandbox/tschaub/fractional/examples/vector-features.html
r5362 r5969 38 38 var style_green = { 39 39 strokeColor: "#00FF00", 40 strokeOpacity: 1,41 40 strokeWidth: 3, 42 41 pointRadius: 6, sandbox/tschaub/fractional/examples/wfs-t.html
r5362 r5969 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/tschaub/fractional/examples/wms-untiled.html
r5362 r5969 17 17 function init(){ 18 18 map = new OpenLayers.Map( 'map' ); 19 layer = new OpenLayers.Layer.WMS.Untiled( "OpenLayers WMS", 20 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} ); 19 layer = new OpenLayers.Layer.WMS( 20 "OpenLayers WMS", 21 "http://labs.metacarta.com/wms/vmap0", 22 {layers: 'basic'}, 23 {singleTile: true} 24 ); 21 25 map.addLayer(layer); 22 26 … … 31 35 <div id="tags"> 32 36 </div> 33 <p id="shortdesc">34 Shows an example of the Untiled wms layer, which requests a single image for the entire map view</a>. 35 </p> 36 37 <p id="shortdesc"> 38 Shows an example of an "untiled" WMS layer, which requests a single 39 image for the entire map view. 40 </p> 37 41 <div id="map"></div> 38 39 <div id="docs"> 40 An untiled map will only request a single image at a time. 41 </div> 42 <div id="docs"> 43 An untiled layer will only request a single image at a time. 44 This is equivalent to using the deprecated 45 OpenLayers.Layer.WMS.Untiled class, which will be removed at 3.0. 46 </div> 42 47 </body> 43 48 </html> sandbox/tschaub/fractional/lib/OpenLayers.js
r5614 r5969 44 44 if (src) { 45 45 var index = src.lastIndexOf(scriptName); 46 // set path length for src up to a query string 47 var pathLength = src.lastIndexOf('?'); 48 if (pathLength < 0) { 49 pathLength = src.length; 50 } 46 51 // is it found, at the end of the URL? 47 if ((index > -1) && (index + scriptName.length == src.length)) {48 scriptLocation = src.slice(0, -scriptName.length);52 if ((index > -1) && (index + scriptName.length == pathLength)) { 53 scriptLocation = src.slice(0, pathLength - scriptName.length); 49 54 break; 50 55 } … … 118 123 "OpenLayers/Handler.js", 119 124 "OpenLayers/Handler/Click.js", 125 "OpenLayers/Handler/Hover.js", 120 126 "OpenLayers/Handler/Point.js", 121 127 "OpenLayers/Handler/Path.js", … … 129 135 "OpenLayers/Control.js", 130 136 "OpenLayers/Control/Attribution.js", 137 "OpenLayers/Control/Button.js", 131 138 "OpenLayers/Control/ZoomBox.js", 132 139 "OpenLayers/Control/ZoomToMaxExtent.js", … … 165 172 "OpenLayers/Renderer/VML.js", 166 173 "OpenLayers/Layer/Vector.js", 174 "OpenLayers/Layer/PointTrack.js", 167 175 "OpenLayers/Layer/GML.js", 168 176 "OpenLayers/Style.js", … … 178 186 "OpenLayers/Format/WFS.js", 179 187 "OpenLayers/Format/WKT.js", 188 "OpenLayers/Format/OSM.js", 180 189 "OpenLayers/Format/SLD.js", 181 190 "OpenLayers/Format/Text.js", 182 191 "OpenLayers/Format/JSON.js", 183 192 "OpenLayers/Format/GeoJSON.js", 193 "OpenLayers/Format/WMC.js", 194 "OpenLayers/Format/WMC/v1.js", 195 "OpenLayers/Format/WMC/v1_0_0.js", 196 "OpenLayers/Format/WMC/v1_1_0.js", 184 197 "OpenLayers/Layer/WFS.js", 185 198 "OpenLayers/Control/MouseToolbar.js", sandbox/tschaub/fractional/lib/OpenLayers/Ajax.js
r5644 r5969 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/tschaub/fractional/lib/OpenLayers/Control.js
r5614 r5969 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/tschaub/fractional/lib/OpenLayers/Control/ArgParser.js
r5614 r5969 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. */ … … 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/tschaub/fractional/lib/OpenLayers/Control/ModifyFeature.js
r5623 r5969 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/tschaub/fractional/lib/OpenLayers/Control/MousePosition.js
r5614 r5969 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/tschaub/fractional/lib/OpenLayers/Control/Navigation.js
r5695 r5969 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/tschaub/fractional/lib/OpenLayers/Control/Panel.js
r5631 r5969 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/tschaub/fractional/lib/OpenLayers/Control/SelectFeature.js
r5614 r5969 128 128 /** 129 129 * Method: unselectAll 130 * Unselect all selected features. 131 */ 132 unselectAll: function() { 130 * Unselect all selected features. To unselect all except for a single 131 * feature, set the options.except property to the feature. 132 * 133 * Parameters: 134 * options - {Object} Optional configuration object. 135 */ 136 unselectAll: function(options) { 133 137 // we'll want an option to supress notification here 134 while (this.layer.selectedFeatures.length > 0) { 135 this.unselect(this.layer.selectedFeatures[0]); 138 var feature; 139 for(var i=this.layer.selectedFeatures.length-1; i>=0; --i) { 140 feature = this.layer.selectedFeatures[i]; 141 if(!options || options.except != feature) { 142 this.unselect(feature); 143 } 136 144 } 137 145 }, … … 146 154 */ 147 155 clickFeature: function(feature) { 148 if(this.hover) { 149 return; 150 } 151 var selected = (OpenLayers.Util.indexOf(this.layer.selectedFeatures, 152 feature) > -1); 153 if(!this.multiple && !this.handler.evt[this.multipleKey]) { 154 // perhaps an "except" argument 155 this.unselectAll(); 156 } 157 if(selected) { 158 if(this.toggle || this.handler.evt[this.toggleKey]) { 159 // notify here 160 this.unselect(feature); 156 if(!this.hover) { 157 var selected = (OpenLayers.Util.indexOf(this.layer.selectedFeatures, 158 feature) > -1); 159 if(selected) { 160 if(this.toggleSelect()) { 161 this.unselect(feature); 162 } else if(!this.multipleSelect()) { 163 this.unselectAll({except: feature}); 164 } 161 165 } else { 162 // don't notify here - could be removed if unselectAll is modified 166 if(!this.multipleSelect()) { 167 this.unselectAll({except: feature}); 168 } 163 169 this.select(feature); 164 170 } 165 } else { 166 this.select(feature); 167 } 171 } 172 }, 173 174 /** 175 * Method: multipleSelect 176 * Allow for multiple selected features based on <multiple> property and 177 * <multipleKey> event modifier. 178 * 179 * Returns: 180 * {Boolean} Allow for multiple selected features. 181 */ 182 multipleSelect: function() { 183 return this.multiple || this.handler.evt[this.multipleKey]; 184 }, 185 186 /** 187 * Method: toggleSelect 188 * Event should toggle the selected state of a feature based on <toggle> 189 * property and <toggleKey> event modifier. 190 * 191 * Returns: 192 * {Boolean} Toggle the selected state of a feature. 193 */ 194 toggleSelect: function() { 195 return this.toggle || this.handler.evt[this.toggleKey]; 168 196 }, 169 197 … … 221 249 select: function(feature) { 222 250 // Store feature style for restoration later 223 if(feature.originalStyle == null) {251 if(feature.originalStyle != feature.style) { 224 252 feature.originalStyle = feature.style; 225 253 } 226 254 this.layer.selectedFeatures.push(feature); 227 feature.style = this.selectStyle; 255 256 var selectStyle = this.selectStyle; 257 258 if (feature.style.CLASS_NAME == "OpenLayers.Style") { 259 feature.style = feature.style.createStyle(feature); 260 } else { 261 feature.style = OpenLayers.Util.extend({}, feature.style); 262 } 263 if (selectStyle.CLASS_NAME == "OpenLayers.Style") { 264 selectStyle = selectStyle.createStyle(feature); 265 } 266 OpenLayers.Util.extend(feature.style, selectStyle); 267 228 268 this.layer.drawFeature(feature); 229 269 this.onSelect(feature); sandbox/tschaub/fractional/lib/OpenLayers/Control/ZoomBox.js
r5614 r5969 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/fractional/lib/OpenLayers/Feature/Vector.js
r5625 r5969 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/tschaub/fractional/lib/OpenLayers/Format/GeoRSS.js
r5614 r5969 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/fractional/lib/OpenLayers/Format/SLD.js
r5553 r5969 107 107 } 108 108 109 options = options || {}; 109 110 OpenLayers.Util.applyDefaults(options, { 110 111 withNamedLayer: false, … … 207 208 var rule = this.parseFilter(filter[0]); 208 209 } else { 209 // rule applies to all features 210 // rule applies to all features (no filter or ElseFilter) 210 211 var rule = new OpenLayers.Rule(); 211 212 } … … 219 220 ); 220 221 if (minScale && min
