Changeset 5518
- Timestamp:
- 12/19/07 17:17:27 (1 year ago)
- Files:
-
- sandbox/enjahova/openlayers/apidoc_config/Menu.txt (modified) (1 diff)
- sandbox/enjahova/openlayers/doc/authors.txt (modified) (1 diff)
- sandbox/enjahova/openlayers/doc_config/Menu.txt (modified) (1 diff)
- sandbox/enjahova/openlayers/examples/click-handler.html (copied) (copied from trunk/openlayers/examples/click-handler.html)
- sandbox/enjahova/openlayers/examples/custom-control.html (modified) (1 diff)
- sandbox/enjahova/openlayers/examples/geojson.html (copied) (copied from trunk/openlayers/examples/geojson.html)
- sandbox/enjahova/openlayers/examples/georss-flickr.html (copied) (copied from trunk/openlayers/examples/georss-flickr.html)
- sandbox/enjahova/openlayers/examples/intersects.html (copied) (copied from trunk/openlayers/examples/intersects.html)
- sandbox/enjahova/openlayers/examples/modify-feature.html (modified) (2 diffs)
- sandbox/enjahova/openlayers/examples/select-feature.html (modified) (4 diffs)
- sandbox/enjahova/openlayers/examples/xml/georss-flickr.xml (copied) (copied from trunk/openlayers/examples/xml/georss-flickr.xml)
- sandbox/enjahova/openlayers/lib/OpenLayers.js (modified) (6 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/BaseTypes/Bounds.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/BaseTypes/LonLat.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Control/ModifyFeature.js (modified) (11 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Control/MousePosition.js (modified) (2 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Control/Permalink.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Control/Scale.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Control/SelectFeature.js (modified) (8 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Events.js (modified) (4 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Format/GeoJSON.js (modified) (13 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Format/KML.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Format/Text.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Format/Text.js)
- sandbox/enjahova/openlayers/lib/OpenLayers/Format/XML.js (modified) (2 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Geometry.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Geometry/Collection.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Geometry/LineString.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Geometry/LinearRing.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Geometry/Point.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Geometry/Polygon.js (modified) (2 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Handler.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Handler/Box.js (modified) (2 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Handler/Click.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Handler/Click.js)
- sandbox/enjahova/openlayers/lib/OpenLayers/Handler/Feature.js (modified) (5 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Handler/Path.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Handler/Point.js (modified) (2 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Handler/Polygon.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Handler/RegularPolygon.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Layer.js (modified) (5 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Layer/EventPane.js (modified) (3 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Layer/FixedZoomLevels.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Layer/GeoRSS.js (modified) (2 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Layer/Google.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Layer/Markers.js (modified) (2 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Layer/SphericalMercator.js (modified) (2 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Layer/Text.js (modified) (2 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Layer/Vector.js (modified) (4 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Layer/WFS.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Layer/WMS.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Map.js (modified) (10 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Popup/AnchoredBubble.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Projection.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Projection.js)
- sandbox/enjahova/openlayers/lib/OpenLayers/Renderer/Elements.js (modified) (2 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Renderer/SVG.js (modified) (9 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Renderer/VML.js (modified) (5 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Rule (copied) (copied from trunk/openlayers/lib/OpenLayers/Rule)
- sandbox/enjahova/openlayers/lib/OpenLayers/Rule.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Rule.js)
- sandbox/enjahova/openlayers/lib/OpenLayers/Rule/Comparison.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Rule/Comparison.js)
- sandbox/enjahova/openlayers/lib/OpenLayers/Rule/FeatureId.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Rule/FeatureId.js)
- sandbox/enjahova/openlayers/lib/OpenLayers/Rule/Logical.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Rule/Logical.js)
- sandbox/enjahova/openlayers/lib/OpenLayers/Style.js (copied) (copied from trunk/openlayers/lib/OpenLayers/Style.js)
- sandbox/enjahova/openlayers/lib/OpenLayers/Tile/Image.js (modified) (1 diff)
- sandbox/enjahova/openlayers/lib/OpenLayers/Util.js (modified) (5 diffs)
- sandbox/enjahova/openlayers/release-license.txt (copied) (copied from trunk/openlayers/release-license.txt)
- sandbox/enjahova/openlayers/repository-license.txt (copied) (copied from trunk/openlayers/repository-license.txt)
- sandbox/enjahova/openlayers/tests/BaseTypes/test_Bounds.html (modified) (1 diff)
- sandbox/enjahova/openlayers/tests/BaseTypes/test_LonLat.html (modified) (1 diff)
- sandbox/enjahova/openlayers/tests/Control/test_DragFeature.html (modified) (7 diffs)
- sandbox/enjahova/openlayers/tests/Control/test_LayerSwitcher.html (modified) (2 diffs)
- sandbox/enjahova/openlayers/tests/Control/test_ModifyFeature.html (modified) (4 diffs)
- sandbox/enjahova/openlayers/tests/Control/test_MousePosition.html (modified) (2 diffs)
- sandbox/enjahova/openlayers/tests/Control/test_PanZoom.html (modified) (1 diff)
- sandbox/enjahova/openlayers/tests/Format/test_GML.html (modified) (11 diffs)
- sandbox/enjahova/openlayers/tests/Format/test_GeoJSON.html (modified) (5 diffs)
- sandbox/enjahova/openlayers/tests/Format/test_GeoRSS.html (modified) (3 diffs)
- sandbox/enjahova/openlayers/tests/Format/test_KML.html (modified) (4 diffs)
- sandbox/enjahova/openlayers/tests/Format/test_XML.html (modified) (4 diffs)
- sandbox/enjahova/openlayers/tests/Handler/test_Click.html (copied) (copied from trunk/openlayers/tests/Handler/test_Click.html)
- sandbox/enjahova/openlayers/tests/Handler/test_Feature.html (modified) (3 diffs)
- sandbox/enjahova/openlayers/tests/Handler/test_Path.html (modified) (3 diffs)
- sandbox/enjahova/openlayers/tests/Handler/test_Polygon.html (modified) (3 diffs)
- sandbox/enjahova/openlayers/tests/Handler/test_RegularPolygon.html (modified) (4 diffs)
- sandbox/enjahova/openlayers/tests/Layer/test_EventPane.html (modified) (1 diff)
- sandbox/enjahova/openlayers/tests/Layer/test_Google.html (modified) (1 diff)
- sandbox/enjahova/openlayers/tests/Layer/test_KaMap.html (modified) (10 diffs)
- sandbox/enjahova/openlayers/tests/Layer/test_MapServer.html (modified) (17 diffs)
- sandbox/enjahova/openlayers/tests/Layer/test_Markers.html (modified) (1 diff)
- sandbox/enjahova/openlayers/tests/Layer/test_SphericalMercator.html (modified) (3 diffs)
- sandbox/enjahova/openlayers/tests/Layer/test_TMS.html (modified) (7 diffs)
- sandbox/enjahova/openlayers/tests/Layer/test_Text.html (modified) (2 diffs)
- sandbox/enjahova/openlayers/tests/Layer/test_Vector.html (modified) (6 diffs)
- sandbox/enjahova/openlayers/tests/Layer/test_WFS.html (modified) (3 diffs)
- sandbox/enjahova/openlayers/tests/Layer/test_WMS.html (modified) (3 diffs)
- sandbox/enjahova/openlayers/tests/Layer/test_WrapDateLine.html (modified) (6 diffs)
- sandbox/enjahova/openlayers/tests/Marker/test_Box.html (modified) (1 diff)
- sandbox/enjahova/openlayers/tests/Popup/test_AnchoredBubble.html (copied) (copied from trunk/openlayers/tests/Popup/test_AnchoredBubble.html)
- sandbox/enjahova/openlayers/tests/Renderer/test_SVG.html (modified) (3 diffs)
- sandbox/enjahova/openlayers/tests/Renderer/test_VML.html (modified) (1 diff)
- sandbox/enjahova/openlayers/tests/Rule (copied) (copied from trunk/openlayers/tests/Rule)
- sandbox/enjahova/openlayers/tests/Rule/test_Comparison.html (copied) (copied from trunk/openlayers/tests/Rule/test_Comparison.html)
- sandbox/enjahova/openlayers/tests/Rule/test_FeatureId.html (copied) (copied from trunk/openlayers/tests/Rule/test_FeatureId.html)
- sandbox/enjahova/openlayers/tests/Rule/test_Logical.html (copied) (copied from trunk/openlayers/tests/Rule/test_Logical.html)
- sandbox/enjahova/openlayers/tests/auto-tests.html (copied) (copied from trunk/openlayers/tests/auto-tests.html)
- sandbox/enjahova/openlayers/tests/data (copied) (copied from trunk/openlayers/tests/data)
- sandbox/enjahova/openlayers/tests/data/geos_wkt_intersects.js (copied) (copied from trunk/openlayers/tests/data/geos_wkt_intersects.js)
- sandbox/enjahova/openlayers/tests/index.html (copied) (copied from trunk/openlayers/tests/index.html)
- sandbox/enjahova/openlayers/tests/list-tests.html (modified) (3 diffs)
- sandbox/enjahova/openlayers/tests/manual/draw-feature.html (copied) (copied from trunk/openlayers/tests/manual/draw-feature.html)
- sandbox/enjahova/openlayers/tests/run-tests.html (modified) (2 diffs)
- sandbox/enjahova/openlayers/tests/test_Events.html (modified) (2 diffs)
- sandbox/enjahova/openlayers/tests/test_Feature.html (modified) (1 diff)
- sandbox/enjahova/openlayers/tests/test_Geometry.html (modified) (2 diffs)
- sandbox/enjahova/openlayers/tests/test_Map.html (modified) (7 diffs)
- sandbox/enjahova/openlayers/tests/test_Popup.html (modified) (2 diffs)
- sandbox/enjahova/openlayers/tests/test_Projection.html (copied) (copied from trunk/openlayers/tests/test_Projection.html)
- sandbox/enjahova/openlayers/tests/test_Rule.html (copied) (copied from trunk/openlayers/tests/test_Rule.html)
- sandbox/enjahova/openlayers/tests/test_Style.html (copied) (copied from trunk/openlayers/tests/test_Style.html)
- sandbox/enjahova/openlayers/tests/test_Util.html (modified) (11 diffs)
- sandbox/enjahova/openlayers/theme/default/style.css (modified) (3 diffs)
- sandbox/enjahova/openlayers/tools/mergejs.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/enjahova/openlayers/apidoc_config/Menu.txt
r5289 r5518 169 169 } # Group: Marker 170 170 171 File: Projection (no auto-title, OpenLayers/Projection.js) 172 171 173 Group: Popup { 172 174 sandbox/enjahova/openlayers/doc/authors.txt
r5238 r5518 14 14 Philip Lindsay 15 15 Corey Puffault 16 Gregers Rygg 16 17 Tim Schaub 17 18 Christopher Schmidt sandbox/enjahova/openlayers/doc_config/Menu.txt
r5289 r5518 169 169 } # Group: Marker 170 170 171 File: Projection (no auto-title, OpenLayers/Projection.js) 172 171 173 Group: Popup { 172 174 sandbox/enjahova/openlayers/examples/custom-control.html
r5362 r5518 34 34 35 35 notice: function (bounds) { 36 alert(bounds); 36 var ll = map.getLonLatFromPixel(new OpenLayers.Pixel(bounds.left, bounds.bottom)); 37 var ur = map.getLonLatFromPixel(new OpenLayers.Pixel(bounds.right, bounds.top)); 38 alert(ll.lon.toFixed(4) + ", " + 39 ll.lat.toFixed(4) + ", " + 40 ur.lon.toFixed(4) + ", " + 41 ur.lat.toFixed(4)); 37 42 } 38 43 }); sandbox/enjahova/openlayers/examples/modify-feature.html
r5362 r5518 70 70 71 71 function update() { 72 // reset modification mode 73 controls.modify.mode = OpenLayers.Control.ModifyFeature.RESHAPE; 72 74 var rotate = document.getElementById("rotate").checked; 73 controls.modify.rotate = rotate; 75 if(rotate) { 76 controls.modify.mode |= OpenLayers.Control.ModifyFeature.ROTATE; 77 } 74 78 var resize = document.getElementById("resize").checked; 75 controls.modify.resize = resize; 79 if(resize) { 80 controls.modify.mode |= OpenLayers.Control.ModifyFeature.RESIZE; 81 } 76 82 var drag = document.getElementById("drag").checked; 77 controls.modify.drag = drag; 83 if(drag) { 84 controls.modify.mode |= OpenLayers.Control.ModifyFeature.DRAG; 85 } 86 // disable reshape mode if at least one of modes rotate, resize, 87 // drag is enabled 88 if (rotate || resize || drag) { 89 controls.modify.mode &= ~OpenLayers.Control.ModifyFeature.RESHAPE; 90 } 78 91 var sides = parseInt(document.getElementById("sides").value); 79 92 sides = Math.max(3, isNaN(sides) ? 0 : sides); … … 98 111 <body onload="init()"> 99 112 <h3 id="title">OpenLayers Modify Feature Example</h3> 100 <div id="shortdesc">A demonstrat on of the ModifyFeature control for editing vector features.</div>113 <div id="shortdesc">A demonstration of the ModifyFeature control for editing vector features.</div> 101 114 <div id="map"></div> 102 115 <div id="controls"> sandbox/enjahova/openlayers/examples/select-feature.html
r5362 r5518 14 14 <script src="../lib/OpenLayers.js"></script> 15 15 <script type="text/javascript"> 16 var map, drawControls , select;16 var map, drawControls; 17 17 OpenLayers.Feature.Vector.style['default']['strokeWidth'] = '2'; 18 18 function init(){ … … 39 39 vectors, OpenLayers.Handler.Polygon 40 40 ), 41 select: new OpenLayers.Control.SelectFeature(vectors), 42 hover: new OpenLayers.Control.SelectFeature( 43 vectors, {hover: true} 41 select: new OpenLayers.Control.SelectFeature( 42 vectors, 43 { 44 clickout: false, toggle: false, 45 multiple: false, hover: false, 46 toggleKey: "ctrlKey", // ctrl key removes from selection 47 multipleKey: "shiftKey" // shift key adds to selection 48 } 44 49 ) 45 50 }; … … 60 65 control.deactivate(); 61 66 } 67 } 68 } 69 70 function update() { 71 var clickout = document.getElementById("clickout").checked; 72 drawControls.select.clickout = clickout; 73 var hover = document.getElementById("hover").checked; 74 drawControls.select.hover = hover; 75 if(hover && drawControls.select.active) { 76 // turn on/off to clear feature property of handler 77 drawControls.select.deactivate(); 78 drawControls.select.activate(); 62 79 } 63 80 } … … 95 112 <input type="radio" name="type" value="select" id="selectToggle" 96 113 onclick="toggleControl(this);" /> 97 <label for="selectToggle">select feature on click</label> 114 <label for="selectToggle">select feature</label> 115 <ul> 116 <li> 117 <input id="clickout" type="checkbox" 118 name="clickout" onchange="update()" /> 119 <label for="clickout">click out to unselect features</label> 120 </li> 121 <li> 122 <input id="hover" type="checkbox" 123 name="hover" onchange="update()" /> 124 <label for="hover">hover to select features</label> 125 </li> 126 </ul> 98 127 </li> 99 <li> 100 <input type="radio" name="type" value="hover" id="hoverToggle" 101 onclick="toggleControl(this);" /> 102 <label for="hoverToggle">select feature on hover</label> 103 </li> 104 </ul> 128 </ul> 129 <p>Use the shift key to select multiple features. Use the ctrl key to 130 toggle selection on features one at a time. Note: the "clickout" option has no 131 effect when "hover" is selected.</p> 105 132 </body> 106 133 </html> sandbox/enjahova/openlayers/lib/OpenLayers.js
r5413 r5518 79 79 "OpenLayers/Ajax.js", 80 80 "OpenLayers/Events.js", 81 "OpenLayers/Projection.js", 81 82 "OpenLayers/Map.js", 82 83 "OpenLayers/Layer.js", … … 116 117 "OpenLayers/Feature/WFS.js", 117 118 "OpenLayers/Handler.js", 119 "OpenLayers/Handler/Click.js", 118 120 "OpenLayers/Handler/Point.js", 119 121 "OpenLayers/Handler/Path.js", … … 168 170 "OpenLayers/Layer/Vector.js", 169 171 "OpenLayers/Layer/GML.js", 172 "OpenLayers/Style.js", 173 "OpenLayers/Rule.js", 174 "OpenLayers/Rule/FeatureId.js", 175 "OpenLayers/Rule/Logical.js", 176 "OpenLayers/Rule/Comparison.js", 170 177 "OpenLayers/Format.js", 171 178 "OpenLayers/Format/XML.js", … … 175 182 "OpenLayers/Format/WFS.js", 176 183 "OpenLayers/Format/WKT.js", 184 "OpenLayers/Format/Text.js", 177 185 "OpenLayers/Format/JSON.js", 178 186 "OpenLayers/Format/GeoJSON.js", … … 183 191 ); // etc. 184 192 185 186 187 var allScriptTags = ""; 188 var host = OpenLayers._getScriptLocation() + "lib/"; 189 193 var agent = navigator.userAgent; 194 var docWrite = (agent.match("MSIE") || agent.match("Safari")); 195 if(docWrite) { 196 var allScriptTags = new Array(jsfiles.length); 197 } 198 var host = OpenLayers._getScriptLocation() + "lib/"; 190 199 for (var i = 0; i < jsfiles.length; i++) { 191 if ( /MSIE/.test(navigator.userAgent) || /Safari/.test(navigator.userAgent)) {192 var currentScriptTag = "<script src='" + host + jsfiles[i] + "'></script>";193 allScriptTags += currentScriptTag;200 if (docWrite) { 201 allScriptTags[i] = "<script src='" + host + jsfiles[i] + 202 "'></script>"; 194 203 } else { 195 204 var s = document.createElement("script"); … … 201 210 } 202 211 } 203 if ( allScriptTags) {204 document.write(allScriptTags );212 if (docWrite) { 213 document.write(allScriptTags.join("")); 205 214 } 206 215 } sandbox/enjahova/openlayers/lib/OpenLayers/BaseTypes/Bounds.js
r4985 r5518 426 426 return quadrant; 427 427 }, 428 429 /** 430 * APIMethod: transform 431 * Transform the Bounds object from source to dest. 432 * 433 * Parameters: 434 * source - {<OpenLayers.Projection>} Source projection. 435 * dest - {<OpenLayers.Projection>} Destination projection. 436 * 437 * Returns: 438 * {<OpenLayers.Bounds>} Itself, for use in chaining operations. 439 */ 440 transform: function(source, dest) { 441 var ll = OpenLayers.Projection.transform( 442 {'x': this.left, 'y': this.bottom}, source, dest); 443 var ur = OpenLayers.Projection.transform( 444 {'x': this.right, 'y': this.top}, source, dest); 445 this.left = ll.x; 446 this.bottom = ll.y; 447 this.right = ur.x; 448 this.top = ur.y; 449 return this; 450 }, 428 451 429 452 /** sandbox/enjahova/openlayers/lib/OpenLayers/BaseTypes/LonLat.js
r4985 r5518 113 113 return equals; 114 114 }, 115 116 /** 117 * APIMethod: transform 118 * Transform the LonLat object from source to dest. 119 * 120 * Parameters: 121 * source - {<OpenLayers.Projection>} Source projection. 122 * dest - {<OpenLayers.Projection>} Destination projection. 123 * 124 * Returns: 125 * {<OpenLayers.LonLat>} Itself, for use in chaining operations. 126 */ 127 transform: function(source, dest) { 128 var point = OpenLayers.Projection.transform( 129 {'x': this.lon, 'y': this.lat}, source, dest); 130 this.lon = point.x; 131 this.lat = point.y; 132 return this; 133 }, 115 134 116 135 /** sandbox/enjahova/openlayers/lib/OpenLayers/Control/ModifyFeature.js
r5301 r5518 30 30 31 31 /** 32 * APIProperty: clickout 33 * {Boolean} Unselect features when clicking outside any feature. 34 * Default is true. 35 */ 36 clickout: true, 37 38 /** 39 * APIProperty: toggle 40 * {Boolean} Unselect a selected feature on click. 41 * Default is true. 42 */ 43 toggle: true, 44 45 /** 32 46 * Property: layer 33 47 * {<OpenLayers.Layer.Vector>} … … 89 103 90 104 /** 91 * APIProperty: rotate 92 * {Boolean} Allow rotation of feature instead of vertex modification. 93 */ 94 rotate: false, 95 96 /** 97 * APIProperty: resize 98 * {Boolean} Allow resizing of feature instead of vertex modification. 99 */ 100 resize: false, 105 * APIProperty: mode 106 * {Integer} Bitfields specifying the modification mode. Defaults to 107 * OpenLayers.Control.ModifyFeature.RESHAPE. To set the mode to a 108 * combination of options, use the | operator. or example, to allow 109 * the control to both resize and rotate features, use the following 110 * syntax 111 * (code) 112 * control.mode = OpenLayers.Control.ModifyFeature.RESIZE | 113 * OpenLayers.Control.ModifyFeature.ROTATE; 114 * (end) 115 */ 116 mode: null, 101 117 102 118 /** … … 106 122 radiusHandle: null, 107 123 108 /**109 * APIProperty: drag110 * {Boolean} Allow dragging of feature with a drag handle.111 */112 drag: false,113 114 124 /** 115 125 * Property: dragHandle … … 160 170 this.styleVirtual.strokeOpacity = 0.3; 161 171 this.deleteCodes = [46, 100]; 172 this.mode = OpenLayers.Control.ModifyFeature.RESHAPE; 162 173 OpenLayers.Control.prototype.initialize.apply(this, [options]); 163 174 if(!(this.deleteCodes instanceof Array)) { … … 169 180 var selectOptions = { 170 181 geometryTypes: this.geometryTypes, 182 clickout: this.clickout, 183 toggle: this.toggle, 171 184 onSelect: function(feature) { 172 185 control.selectFeature.apply(control, [feature]); … … 428 441 if(this.feature && 429 442 this.feature.geometry.CLASS_NAME != "OpenLayers.Geometry.Point") { 430 if( this.drag) {443 if((this.mode & OpenLayers.Control.ModifyFeature.DRAG)) { 431 444 this.collectDragHandle(); 432 445 } 433 if(this.rotate || this.resize) { 446 if((this.mode & (OpenLayers.Control.ModifyFeature.ROTATE | 447 OpenLayers.Control.ModifyFeature.RESIZE))) { 434 448 this.collectRadiusHandle(); 435 } else { 449 } 450 if((this.mode & OpenLayers.Control.ModifyFeature.RESHAPE)) { 436 451 this.collectVertices(); 437 452 } … … 516 531 } 517 532 collectComponentVertices.call(this, this.feature.geometry); 518 this.layer.addFeatures(this.vertices );519 this.layer.addFeatures(this.virtualVertices );533 this.layer.addFeatures(this.vertices, {silent: true}); 534 this.layer.addFeatures(this.virtualVertices, {silent: true}); 520 535 }, 521 536 … … 536 551 } 537 552 this.dragHandle = origin; 538 this.layer.addFeatures([this.dragHandle] );553 this.layer.addFeatures([this.dragHandle], {silent: true}); 539 554 }, 540 555 … … 554 569 ); 555 570 var radius = new OpenLayers.Feature.Vector(radiusGeometry); 556 var resize = this.resize;557 var rotate = this.rotate;571 var resize = (this.mode & OpenLayers.Control.ModifyFeature.RESIZE); 572 var rotate = (this.mode & OpenLayers.Control.ModifyFeature.ROTATE); 558 573 radiusGeometry.move = function(x, y) { 559 574 OpenLayers.Geometry.Point.prototype.move.call(this, x, y); … … 576 591 } 577 592 this.radiusHandle = radius; 578 this.layer.addFeatures([this.radiusHandle] );593 this.layer.addFeatures([this.radiusHandle], {silent: true}); 579 594 }, 580 595 … … 594 609 CLASS_NAME: "OpenLayers.Control.ModifyFeature" 595 610 }); 611 612 /** 613 * Constant: RESHAPE 614 * {Integer} Constant used to make the control work in reshape mode 615 */ 616 OpenLayers.Control.ModifyFeature.RESHAPE = 1; 617 /** 618 * Constant: RESIZE 619 * {Integer} Constant used to make the control work in resize mode 620 */ 621 OpenLayers.Control.ModifyFeature.RESIZE = 2; 622 /** 623 * Constant: ROTATE 624 * {Integer} Constant used to make the control work in rotate mode 625 */ 626 OpenLayers.Control.ModifyFeature.ROTATE = 4; 627 /** 628 * Constant: DRAG 629 * {Integer} Constant used to make the control work in drag mode 630 */ 631 OpenLayers.Control.ModifyFeature.DRAG = 8; sandbox/enjahova/openlayers/lib/OpenLayers/Control/MousePosition.js
r4985 r5518 19 19 /** 20 20 * APIProperty: prefix 21 * {String} 21 22 */ 22 23 prefix: '', … … 109 110 110 111 lonLat = this.map.getLonLatFromPixel(evt.xy); 112 if (!lonLat) { 113 // map has not yet been properly initialized 114 return; 115 } 111 116 this.lastXy = evt.xy; 112 117 } sandbox/enjahova/openlayers/lib/OpenLayers/Control/Permalink.js
r4985 r5518 89 89 this.div.className = this.displayClass; 90 90 this.element = document.createElement("a"); 91 this.element.style.fontSize="smaller";92 91 this.element.innerHTML = "Permalink"; 93 92 this.element.href=""; sandbox/enjahova/openlayers/lib/OpenLayers/Control/Scale.js
r5333 r5518 43 43 this.element = document.createElement("div"); 44 44 this.div.className = this.displayClass; 45 this.element.style.fontSize="smaller";46 45 this.div.appendChild(this.element); 47 46 } sandbox/enjahova/openlayers/lib/OpenLayers/Control/SelectFeature.js
r5157 r5518 17 17 18 18 /** 19 * Property: multipleKey 20 * {String} An event modifier ('altKey' or 'shiftKey') that temporarily sets 21 * the <multiple> property to true. Default is null. 22 */ 23 multipleKey: null, 24 25 /** 26 * Property: toggleKey 27 * {String} An event modifier ('altKey' or 'shiftKey') that temporarily sets 28 * the <toggle> property to true. Default is null. 29 */ 30 toggleKey: null, 31 32 /** 19 33 * APIProperty: multiple 20 * {Boolean} Allow selection of multiple geometries 34 * {Boolean} Allow selection of multiple geometries. Default is false. 21 35 */ 22 36 multiple: false, 37 38 /** 39 * APIProperty: clickout 40 * {Boolean} Unselect features when clicking outside any feature. 41 * Default is true. 42 */ 43 clickout: true, 44 45 /** 46 * APIProperty: toggle 47 * {Boolean} Unselect a selected feature on click. Default is false. Only 48 * has meaning if hover is false. 49 */ 50 toggle: false, 23 51 24 52 /** … … 86 114 this.callbacks = OpenLayers.Util.extend({ 87 115 click: this.clickFeature, 116 clickout: this.clickoutFeature, 88 117 over: this.overFeature, 89 118 out: this.outFeature 90 119 }, this.callbacks); 91 var handlerOptions = { geometryTypes: this.geometryTypes};120 var handlerOptions = { geometryTypes: this.geometryTypes}; 92 121 this.handler = new OpenLayers.Handler.Feature(this, layer, 93 122 this.callbacks, … … 96 125 97 126 /** 127 * Method: unselectAll 128 * Unselect all selected features. 129 */ 130 unselectAll: function() { 131 // we'll want an option to supress notification here 132 while (this.layer.selectedFeatures.length > 0) { 133 this.unselect(this.layer.selectedFeatures[0]); 134 } 135 }, 136 137 /** 98 138 * Method: clickFeature 99 * Called when the feature handler detects a click on a feature 139 * Called on click in a feature 140 * Only responds if this.hover is false. 100 141 * 101 142 * Parameters: … … 106 147 return; 107 148 } 108 if (this.multiple) { 109 if(OpenLayers.Util.indexOf(this.layer.selectedFeatures, feature) > -1) { 149 var selected = (OpenLayers.Util.indexOf(this.layer.selectedFeatures, 150 feature) > -1); 151 if(!this.multiple && !this.handler.evt[this.multipleKey]) { 152 // perhaps an "except" argument 153 this.unselectAll(); 154 } 155 if(selected) { 156 if(this.toggle || this.handler.evt[this.toggleKey]) { 157 // notify here 110 158 this.unselect(feature); 111 159 } else { 160 // don't notify here - could be removed if unselectAll is modified 112 161 this.select(feature); 113 162 } 114 163 } else { 115 if(OpenLayers.Util.indexOf(this.layer.selectedFeatures, feature) > -1) { 116 this.unselect(feature); 117 } else { 118 if (this.layer.selectedFeatures) { 119 for (var i = 0; i < this.layer.selectedFeatures.length; i++) { 120 this.unselect(this.layer.selectedFeatures[i]); 121 } 122 } 123 this.select(feature); 124 } 164 this.select(feature); 165 } 166 }, 167 168 /** 169 * Method: clickoutFeature 170 * Called on click outside a previously clicked (selected) feature. 171 * Only responds if this.hover is false. 172 * 173 * Parameters: 174 * feature - {<OpenLayers.Vector.Feature>} 175 */ 176 clickoutFeature: function(feature) { 177 if(!this.hover && this.clickout) {
