Changeset 5339
- Timestamp:
- 12/04/07 07:46:24 (1 year ago)
- Files:
-
- sandbox/camptocamp/text/apidoc_config/Menu.txt (modified) (5 diffs)
- sandbox/camptocamp/text/doc/authors.txt (modified) (1 diff)
- sandbox/camptocamp/text/doc_config/Menu.txt (modified) (5 diffs)
- sandbox/camptocamp/text/examples/controls.html (modified) (1 diff)
- sandbox/camptocamp/text/examples/modify-feature.html (modified) (3 diffs)
- sandbox/camptocamp/text/examples/popups.html (modified) (1 diff)
- sandbox/camptocamp/text/examples/regular-polygons.html (modified) (3 diffs)
- sandbox/camptocamp/text/examples/select-feature.html (modified) (5 diffs)
- sandbox/camptocamp/text/examples/smoothDragging.html (copied) (copied from trunk/openlayers/examples/smoothDragging.html)
- sandbox/camptocamp/text/examples/spherical-mercator.html (modified) (2 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/BaseTypes.js (modified) (1 diff)
- sandbox/camptocamp/text/lib/OpenLayers/Control/Attribution.js (modified) (1 diff)
- sandbox/camptocamp/text/lib/OpenLayers/Control/EditingToolbar.js (modified) (1 diff)
- sandbox/camptocamp/text/lib/OpenLayers/Control/ModifyFeature.js (modified) (7 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Control/PanZoomBar.js (modified) (2 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Control/Scale.js (modified) (1 diff)
- sandbox/camptocamp/text/lib/OpenLayers/Control/SelectFeature.js (modified) (1 diff)
- sandbox/camptocamp/text/lib/OpenLayers/Events.js (modified) (1 diff)
- sandbox/camptocamp/text/lib/OpenLayers/Format/GML.js (modified) (8 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Format/GeoRSS.js (modified) (5 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Format/KML.js (modified) (7 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Geometry.js (modified) (1 diff)
- sandbox/camptocamp/text/lib/OpenLayers/Geometry/Collection.js (modified) (2 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Geometry/LinearRing.js (modified) (1 diff)
- sandbox/camptocamp/text/lib/OpenLayers/Geometry/Point.js (modified) (1 diff)
- sandbox/camptocamp/text/lib/OpenLayers/Handler/RegularPolygon.js (modified) (5 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Layer/Boxes.js (modified) (1 diff)
- sandbox/camptocamp/text/lib/OpenLayers/Layer/EventPane.js (modified) (2 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Layer/FixedZoomLevels.js (modified) (1 diff)
- sandbox/camptocamp/text/lib/OpenLayers/Layer/GeoRSS.js (modified) (1 diff)
- sandbox/camptocamp/text/lib/OpenLayers/Layer/Google.js (modified) (3 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Layer/Grid.js (modified) (6 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Layer/Text.js (modified) (5 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Layer/TileCache.js (modified) (1 diff)
- sandbox/camptocamp/text/lib/OpenLayers/Layer/Vector.js (modified) (1 diff)
- sandbox/camptocamp/text/lib/OpenLayers/Layer/VirtualEarth.js (modified) (2 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Layer/Yahoo.js (modified) (2 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Map.js (modified) (2 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Renderer/Elements.js (modified) (4 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Renderer/SVG.js (modified) (11 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Renderer/VML.js (modified) (11 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Tile/Image.js (modified) (6 diffs)
- sandbox/camptocamp/text/lib/OpenLayers/Util.js (modified) (6 diffs)
- sandbox/camptocamp/text/tests/Control/test_ModifyFeature.html (modified) (6 diffs)
- sandbox/camptocamp/text/tests/Format/test_GML.html (modified) (3 diffs)
- sandbox/camptocamp/text/tests/Format/test_GeoRSS.html (modified) (2 diffs)
- sandbox/camptocamp/text/tests/Format/test_KML.html (modified) (1 diff)
- sandbox/camptocamp/text/tests/Geometry/test_Point.html (modified) (2 diffs)
- sandbox/camptocamp/text/tests/Handler/test_RegularPolygon.html (modified) (1 diff)
- sandbox/camptocamp/text/tests/Layer/test_FixedZoomLevels.html (modified) (2 diffs)
- sandbox/camptocamp/text/tests/Layer/test_TileCache.html (modified) (1 diff)
- sandbox/camptocamp/text/tests/Layer/test_Vector.html (modified) (2 diffs)
- sandbox/camptocamp/text/tests/Renderer (copied) (copied from trunk/openlayers/tests/Renderer)
- sandbox/camptocamp/text/tests/Renderer/test_Elements.html (copied) (copied from trunk/openlayers/tests/Renderer/test_Elements.html)
- sandbox/camptocamp/text/tests/Renderer/test_SVG.html (copied) (copied from trunk/openlayers/tests/Renderer/test_SVG.html)
- sandbox/camptocamp/text/tests/Renderer/test_VML.html (copied) (copied from trunk/openlayers/tests/Renderer/test_VML.html)
- sandbox/camptocamp/text/tests/list-tests.html (modified) (1 diff)
- sandbox/camptocamp/text/tests/manual (copied) (copied from trunk/openlayers/tests/manual)
- sandbox/camptocamp/text/tests/manual/google-panning.html (copied) (copied from trunk/openlayers/tests/manual/google-panning.html)
- sandbox/camptocamp/text/tests/manual/ve-opacity.html (copied) (copied from trunk/openlayers/tests/manual/ve-opacity.html)
- sandbox/camptocamp/text/tests/test_BaseTypes.html (modified) (1 diff)
- sandbox/camptocamp/text/tests/test_Map.html (modified) (2 diffs)
- sandbox/camptocamp/text/tests/test_Renderer.html (modified) (1 diff)
- sandbox/camptocamp/text/tests/test_Util.html (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/camptocamp/text/apidoc_config/Menu.txt
r4223 r5339 51 51 Group: Control { 52 52 53 File: Control ( no auto-title,OpenLayers/Control.js)53 File: Control (OpenLayers/Control.js) 54 54 File: ArgParser (no auto-title, OpenLayers/Control/ArgParser.js) 55 File: ZoomToMaxExtent (no auto-title, OpenLayers/Control/ZoomToMaxExtent.js) 56 File: OverviewMap (no auto-title, OpenLayers/Control/OverviewMap.js) 55 File: Attribution (no auto-title, OpenLayers/Control/Attribution.js) 57 56 File: DragFeature (no auto-title, OpenLayers/Control/DragFeature.js) 58 57 File: DragPan (no auto-title, OpenLayers/Control/DragPan.js) … … 61 60 File: KeyboardDefaults (no auto-title, OpenLayers/Control/KeyboardDefaults.js) 62 61 File: LayerSwitcher (no auto-title, OpenLayers/Control/LayerSwitcher.js) 62 File: ModifyFeature (no auto-title, OpenLayers/Control/ModifyFeature.js) 63 63 File: MouseDefaults (no auto-title, OpenLayers/Control/MouseDefaults.js) 64 64 File: MousePosition (no auto-title, OpenLayers/Control/MousePosition.js) … … 66 66 File: Navigation (no auto-title, OpenLayers/Control/Navigation.js) 67 67 File: NavToolbar (no auto-title, OpenLayers/Control/NavToolbar.js) 68 File: OverviewMap (no auto-title, OpenLayers/Control/OverviewMap.js) 68 69 File: Panel (no auto-title, OpenLayers/Control/Panel.js) 70 File: PanZoom (no auto-title, OpenLayers/Control/PanZoom.js) 69 71 File: PanZoomBar (no auto-title, OpenLayers/Control/PanZoomBar.js) 70 72 File: Permalink (no auto-title, OpenLayers/Control/Permalink.js) … … 72 74 File: SelectFeature (no auto-title, OpenLayers/Control/SelectFeature.js) 73 75 File: ZoomBox (no auto-title, OpenLayers/Control/ZoomBox.js) 74 File: PanZoom (OpenLayers/Control/PanZoom.js)76 File: ZoomToMaxExtent (no auto-title, OpenLayers/Control/ZoomToMaxExtent.js) 75 77 } # Group: Control 76 78 … … 79 81 Group: Feature { 80 82 81 File: Feature (no auto-title, OpenLayers/Feature.js) 83 File: Feature (OpenLayers/Feature.js) 84 File: Vector (no auto-title, OpenLayers/Feature/Vector.js) 82 85 File: WFS (no auto-title, OpenLayers/Feature/WFS.js) 83 File: Vector (no auto-title, OpenLayers/Feature/Vector.js)84 86 } # Group: Feature 85 87 sandbox/camptocamp/text/doc/authors.txt
r3785 r5339 4 4 John Cole 5 5 Jeff Dege 6 Roald de Wit 6 7 Schuyler Erle 7 8 Christian López EspÃnola sandbox/camptocamp/text/doc_config/Menu.txt
r4223 r5339 53 53 File: Control (OpenLayers/Control.js) 54 54 File: ArgParser (no auto-title, OpenLayers/Control/ArgParser.js) 55 File: ZoomToMaxExtent (no auto-title, OpenLayers/Control/ZoomToMaxExtent.js) 56 File: OverviewMap (no auto-title, OpenLayers/Control/OverviewMap.js) 55 File: Attribution (no auto-title, OpenLayers/Control/Attribution.js) 57 56 File: DragFeature (no auto-title, OpenLayers/Control/DragFeature.js) 58 57 File: DragPan (no auto-title, OpenLayers/Control/DragPan.js) … … 61 60 File: KeyboardDefaults (no auto-title, OpenLayers/Control/KeyboardDefaults.js) 62 61 File: LayerSwitcher (no auto-title, OpenLayers/Control/LayerSwitcher.js) 62 File: ModifyFeature (no auto-title, OpenLayers/Control/ModifyFeature.js) 63 63 File: MouseDefaults (no auto-title, OpenLayers/Control/MouseDefaults.js) 64 64 File: MousePosition (no auto-title, OpenLayers/Control/MousePosition.js) … … 66 66 File: Navigation (no auto-title, OpenLayers/Control/Navigation.js) 67 67 File: NavToolbar (no auto-title, OpenLayers/Control/NavToolbar.js) 68 File: OverviewMap (no auto-title, OpenLayers/Control/OverviewMap.js) 68 69 File: Panel (no auto-title, OpenLayers/Control/Panel.js) 70 File: PanZoom (no auto-title, OpenLayers/Control/PanZoom.js) 69 71 File: PanZoomBar (no auto-title, OpenLayers/Control/PanZoomBar.js) 70 72 File: Permalink (no auto-title, OpenLayers/Control/Permalink.js) … … 72 74 File: SelectFeature (no auto-title, OpenLayers/Control/SelectFeature.js) 73 75 File: ZoomBox (no auto-title, OpenLayers/Control/ZoomBox.js) 74 File: PanZoom (no auto-title, OpenLayers/Control/PanZoom.js)76 File: ZoomToMaxExtent (no auto-title, OpenLayers/Control/ZoomToMaxExtent.js) 75 77 } # Group: Control 76 78 … … 80 82 81 83 File: Feature (OpenLayers/Feature.js) 84 File: Vector (no auto-title, OpenLayers/Feature/Vector.js) 82 85 File: WFS (no auto-title, OpenLayers/Feature/WFS.js) 83 File: Vector (no auto-title, OpenLayers/Feature/Vector.js)84 86 } # Group: Feature 85 87 sandbox/camptocamp/text/examples/controls.html
r5119 r5339 14 14 map = new OpenLayers.Map('map', { controls: [] }); 15 15 16 map.addControl(new OpenLayers.Control.PanZoomBar( ));16 map.addControl(new OpenLayers.Control.PanZoomBar({zoomWorldIcon:true})); 17 17 map.addControl(new OpenLayers.Control.MouseToolbar()); 18 18 map.addControl(new OpenLayers.Control.LayerSwitcher({'ascending':false})); sandbox/camptocamp/text/examples/modify-feature.html
r4272 r5339 54 54 polygon: new OpenLayers.Control.DrawFeature(vectors, 55 55 OpenLayers.Handler.Polygon), 56 regular: new OpenLayers.Control.DrawFeature(vectors, 57 OpenLayers.Handler.RegularPolygon, 58 {handlerOptions: {sides: 5}}), 56 59 modify: new OpenLayers.Control.ModifyFeature(vectors, 57 60 modifyOptions) … … 66 69 } 67 70 71 function update() { 72 var rotate = document.getElementById("rotate").checked; 73 controls.modify.rotate = rotate; 74 var resize = document.getElementById("resize").checked; 75 controls.modify.resize = resize; 76 var drag = document.getElementById("drag").checked; 77 controls.modify.drag = drag; 78 var sides = parseInt(document.getElementById("sides").value); 79 sides = Math.max(3, isNaN(sides) ? 0 : sides); 80 controls.regular.handler.sides = sides; 81 var irregular = document.getElementById("irregular").checked; 82 controls.regular.handler.irregular = irregular; 83 } 68 84 69 85 function toggleControl(element) { … … 103 119 </li> 104 120 <li> 121 <input type="radio" name="type" value="regular" id="regularToggle" onclick="toggleControl(this);" /> 122 <label for="regularToggle">draw regular polygon</label> 123 <label for="sides"> - sides</label> 124 <input id="sides" type="text" size="2" maxlength="2" 125 name="sides" value="5" onchange="update()" /> 126 <ul> 127 <li> 128 <input id="irregular" type="checkbox" 129 name="irregular" onchange="update()" /> 130 <label for="irregular">irregular</label> 131 </li> 132 </ul> 133 </li> 134 <li> 105 135 <input type="radio" name="type" value="modify" id="modifyToggle" 106 136 onclick="toggleControl(this);" /> 107 137 <label for="modifyToggle">modify feature</label> 138 <ul> 139 <li> 140 <input id="rotate" type="checkbox" 141 name="rotate" onchange="update()" /> 142 <label for="rotate">allow rotation</label> 143 </li> 144 <li> 145 <input id="resize" type="checkbox" 146 name="resize" onchange="update()" /> 147 <label for="resize">allow resizing</label> 148 </li> 149 <li> 150 <input id="drag" type="checkbox" 151 name="drag" onchange="update()" /> 152 <label for="drag">allow dragging</label> 153 </li> 154 </ul> 108 155 </li> 109 156 </ul> sandbox/camptocamp/text/examples/popups.html
r4308 r5339 8 8 } 9 9 </style> 10 <script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script> 10 11 <script src="../lib/OpenLayers.js"></script> 11 <script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>12 12 <script type="text/javascript"> 13 13 var map, layer, popup; sandbox/camptocamp/text/examples/regular-polygons.html
r4222 r5339 67 67 68 68 document.getElementById('noneToggle').checked = true; 69 document.getElementById('irregularToggle').checked = false; 69 70 } 70 71 function setOptions(options) { … … 147 148 </td> 148 149 </tr> 150 <tr> 151 <td> 152 irregular 153 </td> 154 <td> 155 <input id="irregularToggle" name="irregular" 156 type="checkbox" 157 onchange="setOptions({irregular: this.checked})") /> 158 </td> 159 </tr> 149 160 </tbody> 150 161 </table> … … 157 168 will toggle to non-snapping mode. 158 169 </p> 170 <p> 171 The <i>irregular</i> option allows drawing of irregular polygons. With this option, the fixed radius option is ignored. 159 172 </body> 160 173 </html> sandbox/camptocamp/text/examples/select-feature.html
r4222 r5339 1 1 <html xmlns="http://www.w3.org/1999/xhtml"> 2 2 <head> 3 <title>Select Feature</title> 3 4 <style type="text/css"> 4 5 #map { … … 14 15 <script type="text/javascript"> 15 16 var map, drawControls, select; 17 OpenLayers.Feature.Vector.style['default']['strokeWidth'] = '2'; 16 18 function init(){ 17 19 map = new OpenLayers.Map('map'); 18 var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS", 19 "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'}); 20 var wmsLayer = new OpenLayers.Layer.WMS( 21 "OpenLayers WMS", 22 "http://labs.metacarta.com/wms/vmap0", 23 {layers: 'basic'} 24 ); 20 25 21 var polygonLayer = new OpenLayers.Layer.Vector("Polygon Layer"); 22 23 map.addLayers([wmsLayer, polygonLayer]); 26 var vectors = new OpenLayers.Layer.Vector("Vector Layer"); 27 map.addLayers([wmsLayer, vectors]); 24 28 map.addControl(new OpenLayers.Control.LayerSwitcher()); 25 29 map.addControl(new OpenLayers.Control.MousePosition()); 26 30 27 31 drawControls = { 28 polygon: new OpenLayers.Control.DrawFeature(polygonLayer, 29 OpenLayers.Handler.Polygon), 30 select: new OpenLayers.Control.SelectFeature(polygonLayer), 31 hover: new OpenLayers.Control.SelectFeature(polygonLayer, 32 {hover: true}) 32 point: new OpenLayers.Control.DrawFeature( 33 vectors, OpenLayers.Handler.Point 34 ), 35 line: new OpenLayers.Control.DrawFeature( 36 vectors, OpenLayers.Handler.Path 37 ), 38 polygon: new OpenLayers.Control.DrawFeature( 39 vectors, OpenLayers.Handler.Polygon 40 ), 41 select: new OpenLayers.Control.SelectFeature(vectors), 42 hover: new OpenLayers.Control.SelectFeature( 43 vectors, {hover: true} 44 ) 33 45 }; 34 46 … … 53 65 </head> 54 66 <body onload="init()"> 55 <h 1>OpenLayers Draw Feature Example</h1>67 <h3>OpenLayers Select Feature Example</h3> 56 68 <div id="map"></div> 57 69 <ul id="controlToggle"> … … 60 72 onclick="toggleControl(this);" checked="checked" /> 61 73 <label for="noneToggle">navigate</label> 74 </li> 75 <li> 76 <input type="radio" name="type" value="point" id="pointToggle" 77 onclick="toggleControl(this);" /> 78 <label for="pointToggle">draw point</label> 79 </li> 80 <li> 81 <input type="radio" name="type" value="line" id="lineToggle" 82 onclick="toggleControl(this);" /> 83 <label for="lineToggle">draw line</label> 62 84 </li> 63 85 <li> … … 69 91 <input type="radio" name="type" value="select" id="selectToggle" 70 92 onclick="toggleControl(this);" /> 71 <label for="selectToggle">select polygonon click</label>93 <label for="selectToggle">select feature on click</label> 72 94 </li> 73 95 <li> 74 96 <input type="radio" name="type" value="hover" id="hoverToggle" 75 97 onclick="toggleControl(this);" /> 76 <label for="hoverToggle">select polygonon hover</label>98 <label for="hoverToggle">select feature on hover</label> 77 99 </li> 78 100 </ul> sandbox/camptocamp/text/examples/spherical-mercator.html
r5119 r5339 7 7 border: 1px solid gray; 8 8 } 9 .olControlAttribution { bottom: 0px!important } 9 10 </style> 10 11 11 12 <script src='http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js'></script> 12 <script src='http://maps.google.com/maps?file=api&v=2 &key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>13 <script src='http://maps.google.com/maps?file=api&v=2.82&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script> 13 14 <script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script> 14 15 … … 81 82 { 82 83 type: 'png', getURL: osm_getTileURL, 83 displayOutsideMaxExtent: true 84 displayOutsideMaxExtent: true, 85 attribution: '<a href="http://www.openstreetmap.org/">OpenStreetMap</a>' 84 86 } 85 87 ); sandbox/camptocamp/text/lib/OpenLayers/BaseTypes.js
r5119 r5339 88 88 } 89 89 return camelizedString; 90 }, 91 92 /** 93 * APIFunction: OpenLayers.String.format 94 * Given a string with tokens in the form ${token}, return a string 95 * with tokens replaced with properties from the given context 96 * object. Represent a literal "${" by doubling it, e.g. "${${". 97 * 98 * Parameters: 99 * template - {String} A string with tokens to be replaced. A template 100 * has the form "literal ${token}" where the token will be replaced 101 * by the value of context["token"]. 102 * context - {Object} An optional object with properties corresponding 103 * to the tokens in the format string. If no context is sent, the 104 * window object will be used. 105 * 106 * Returns: 107 * {String} A string with tokens replaced from the context object. 108 */ 109 format: function(template, context) { 110 if(!context) { 111 context = window; 112 } 113 var tokens = template.split("${"); 114 var item, last; 115 for(var i=1; i<tokens.length; i++) { 116 item = tokens[i]; 117 last = item.indexOf("}"); 118 if(last > 0) { 119 tokens[i] = context[item.substring(0, last)] + 120 item.substring(++last); 121 } else { 122 tokens[i] = "${" + item; 123 } 124 } 125 return tokens.join(""); 90 126 } 127 91 128 }; 92 129 sandbox/camptocamp/text/lib/OpenLayers/Control/Attribution.js
r4985 r5339 78 78 }, 79 79 80 /** @final @type String */81 80 CLASS_NAME: "OpenLayers.Control.Attribution" 82 81 }); sandbox/camptocamp/text/lib/OpenLayers/Control/EditingToolbar.js
r5002 r5339 45 45 * Method: draw 46 46 * calls the default draw, and then activates mouse defaults. 47 * 48 * Returns: 49 * {DOMElement} 47 50 */ 48 51 draw: function() { sandbox/camptocamp/text/lib/OpenLayers/Control/ModifyFeature.js
r5119 r5339 87 87 */ 88 88 virtualStyle: null, 89 89 90 /** 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, 101 102 /** 103 * Property: radiusHandle 104 * {<OpenLayers.Feature.Vector>} A handle for rotating/resizing a feature. 105 */ 106 radiusHandle: null, 107 108 /** 109 * APIProperty: drag 110 * {Boolean} Allow dragging of feature with a drag handle. 111 */ 112 drag: false, 113 114 /** 115 * Property: dragHandle 116 * {<OpenLayers.Feature.Vector>} A handle for dragging a feature. 117 */ 118 dragHandle: null, 119 90 120 /** 91 121 * APIProperty: onModificationStart … … 251 281 unselectFeature: function(feature) { 252 282 this.layer.removeFeatures(this.vertices); 253 this.layer.removeFeatures(this.virtualVertices);254 283 this.vertices = []; 284 this.layer.destroyFeatures(this.virtualVertices); 255 285 this.virtualVertices = []; 286 if(this.dragHandle) { 287 this.layer.destroyFeatures([this.dragHandle]); 288 delete this.dragHandle; 289 } 290 if(this.radiusHandle) { 291 this.layer.destroyFeatures([this.radiusHandle]); 292 delete this.radiusHandle; 293 } 256 294 this.feature = null; 257 295 this.dragControl.deactivate(); … … 275 313 dragStart: function(feature, pixel) { 276 314 // only change behavior if the feature is not in the vertices array 277 if(feature != this.feature && 278 OpenLayers.Util.indexOf(this.vertices, feature) == -1 && 279 OpenLayers.Util.indexOf(this.virtualVertices, feature) == -1) { 315 if(feature != this.feature && !feature.geometry.parent && 316 feature != this.dragHandle && feature != this.radiusHandle) { 280 317 if(this.feature) { 281 318 // unselect the currently selected feature … … 316 353 */ 317 354 dragVertex: function(vertex) { 355 /** 356 * Five cases: 357 * 1) dragging a simple point 358 * 2) dragging a virtual vertex 359 * 3) dragging a drag handle 360 * 4) dragging a radius handle 361 * 5) dragging a real vertex 362 */ 318 363 if(this.feature.geometry.CLASS_NAME == "OpenLayers.Geometry.Point") { 364 // dragging a simple point 319 365 if(this.feature != vertex) { 320 366 this.feature = vertex; 321 367 } 322 368 } else { 323 if(OpenLayers.Util.indexOf(this.virtualVertices, vertex) != -1) { 369 if(vertex._index) { 370 // dragging a virtual vertex 324 371 vertex.geometry.parent.addComponent(vertex.geometry, 325 372 vertex._index); 326 373 delete vertex._index; 327 374 OpenLayers.Util.removeItem(this.virtualVertices, vertex); 328 this.layer.removeFeatures(vertex); 329 } 330 } 331 this.layer.drawFeature(this.feature, this.selectControl.selectStyle); 332 this.layer.removeFeatures(this.virtualVertices); 375 } else if(vertex == this.dragHandle) { 376 // dragging a drag handle 377 this.layer.removeFeatures(this.vertices); 378 this.vertices = []; 379 if(this.radiusHandle) { 380 this.layer.destroyFeatures([this.radiusHandle]); 381 this.radiusHandle = null; 382 } 383 } 384 // dragging a radius handle - no special treatment 385 // dragging a real vertex - no special treatment 386 this.layer.destroyFeatures(this.virtualVertices); 387 this.virtualVertices = []; 388 this.layer.drawFeature(this.feature, this.selectControl.selectStyle); 389 } 333 390 // keep the vertex on top so it gets the mouseout after dragging 334 391 // this should be removed in favor of an option to draw under or … … 361 418 this.virtualVertices = []; 362 419 } 420 if(this.dragHandle) { 421 this.layer.destroyFeatures([this.dragHandle]); 422 this.dragHandle = null; 423 } 424 if(this.radiusHandle) { 425 this.layer.destroyFeatures([this.radiusHandle]); 426 this.radiusHandle = null; 427 } 363 428 if(this.feature && 364 429 this.feature.geometry.CLASS_NAME != "OpenLayers.Geometry.Point") { 365 this.collectVertices(this.feature.geometry); 366 this.layer.addFeatures(this.vertices); 367 this.layer.addFeatures(this.virtualVertices); 430 if(this.drag) { 431 this.collectDragHandle(); 432 } 433 if(this.rotate || this.resize) { 434 this.collectRadiusHandle(); 435 } else { 436 this.collectVertices(); 437 } 368 438 } 369 439 }, … … 386 456 if(vertex && 387 457 OpenLayers.Util.indexOf(this.vertices, vertex) != -1 && 388 !this.dragControl.dragHandler.dragging) { 458 !this.dragControl.dragHandler.dragging && 459 vertex.geometry.parent) { 389 460 // remove the vertex 390 461 vertex.geometry.parent.removeComponent(vertex.geometry); … … 443 514 } 444 515 } 445 } 446 collectComponentVertices(this.feature.geometry); 516 } 517 collectComponentVertices.call(this, this.feature.geometry); 518 this.layer.addFeatures(this.vertices); 519 this.layer.addFeatures(this.virtualVertices); 520 }, 521 522 /** 523 * Method: collectDragHandle 524 * Collect the drag handle for the selected geometry. 525 */ 526 collectDragHandle: function() { 527 var geometry = this.feature.geometry; 528 var center = geometry.getBounds().getCenterLonLat(); 529 var originGeometry = new OpenLayers.Geometry.Point( 530 center.lon, center.lat 531 ); 532 var origin = new OpenLayers.Feature.Vector(originGeometry); 533 originGeometry.move = function(x, y) { 534 OpenLayers.Geometry.Point.prototype.move.call(this, x, y); 535 geometry.move(x, y); 536 } 537 this.dragHandle = origin; 538 this.layer.addFeatures([this.dragHandle]); 539 }, 540 541 /** 542 * Method: collectRadiusHandle 543 * Collect the radius handle for the selected geometry. 544 */ 545 collectRadiusHandle: function() { 546 var geometry = this.feature.geometry; 547 var bounds = geometry.getBounds(); 548 var center = bounds.getCenterLonLat(); 549 var originGeometry = new OpenLayers.Geometry.Point( 550 center.lon, center.lat 551 ); 552 var radiusGeometry = new OpenLayers.Geometry.Point( 553 bounds.right, bounds.bottom 554 ); 555 var radius = new OpenLayers.Feature.Vector(radiusGeometry); 556 var resize = this.resize; 557 var rotate = this.rotate; 558 radiusGeometry.move = function(x, y) { 559 OpenLayers.Geometry.Point.prototype.move.call(this, x, y); 560 var dx1 = this.x - originGeometry.x; 561 var dy1 = this.y - originGeometry.y; 562 var dx0 = dx1 - x; 563 var dy0 = dy1 - y; 564 if(rotate) { 565 var a0 = Math.atan2(dy0, dx0); 566 var a1 = Math.atan2(dy1, dx1); 567 var angle = a1 - a0; 568 angle *= 180 / Math.PI; 569 geometry.rotate(angle, originGeometry); 570 } 571 if(resize) { 572 var l0 = Math.sqrt((dx0 * dx0) + (dy0 * dy0)); 573 var l1 = Math.sqrt((dx1 * dx1) + (dy1 * dy1)); 574 geometry.resize(l1 / l0, originGeometry); 575 } 576 } 577 this.radiusHandle = radius; 578 this.layer.addFeatures([this.radiusHandle]); 447 579 }, 448 580 sandbox/camptocamp/text/lib/OpenLayers/Control/PanZoomBar.js
r5028 r5339 48 48 divEvents: null, 49 49 50 /** 51 * Property: zoomWorldIcon 52 * {Boolean} 53 */ 54 zoomWorldIcon: false, 55 50 56 /** 51 57 * Constructor: <OpenLayers.Control.PanZoomBar> … … 116 122 var sz = new OpenLayers.Size(18,18); 117 123 var centered = new OpenLayers.Pixel(px.x+sz.w/2, px.y); 124 var wposition = sz.w; 125 126 if (this.zoomWorldIcon) { 127 centered = new OpenLayers.Pixel(px.x+sz.w, px.y); 128 } 118 129 119 130 this._addButton("panup", "north-mini.png", centered, sz); 120 131 px.y = centered.y+sz.h; 121 132 this._addButton("panleft", "west-mini.png", px, sz); 122 this._addButton("panright", "east-mini.png", px.add(sz.w, 0), sz); 133 if (this.zoomWorldIcon) { 134 this._addButton("zoomworld", "zoom-world-mini.png", px.add(sz.w, 0), sz); 135 136 wposition *= 2; 137 } 138 this._addButton("panright", "east-mini.png", px.add(wposition, 0), sz); 123 139 this._addButton("pandown", "south-mini.png", centered.add(0, sz.h*2), sz); 124 140 this._addButton("zoomin", "zoom-plus-mini.png", centered.add(0, sz.h*3+5), sz); sandbox/camptocamp/text/lib/OpenLayers/Control/Scale.js
r5002 r5339 36 36 * 37 37 * Returns: 38 * {DOMElemen }38 * {DOMElement} 39 39 */ 40 40 draw: function() { sandbox/camptocamp/text/lib/OpenLayers/Control/SelectFeature.js
r5122 r5339 219 219 }, 220 220 221 /** @final @type String */222 221 CLASS_NAME: "OpenLayers.Control.SelectFeature" 223 222 }); sandbox/camptocamp/text/lib/OpenLayers/Events.js
r5002 r5339 296 296 297 297 //actually remove the event listener from browser 298 if (element.removeEventListener) { 299 element.removeEventListener(name, observer, useCapture); 300 } else if (element && element.detachEvent) { 301 element.detachEvent('on' + name, observer); 298 if (foundEntry) { 299 if (element.removeEventListener) { 300 element.removeEventListener(name, observer, useCapture); 301 } else if (element && element.detachEvent) { 302 element.detachEvent('on' + name, observer); 303 } 302 304 } 303 305 return foundEntry; sandbox/camptocamp/text/lib/OpenLayers/Format/GML.js
r5028 r5339 73 73 74 74 /** 75 * APIProperty: xy 76 * {Boolean} Order of the GML coordinate true:(x,y) or false:(y,x) 77 * Changing is not recommended, a new Format should be instantiated. 78 */ 79 xy: true, 80 81 /** 75 82 * Constructor: OpenLayers.Format.GML 76 83 * Create a new parser for GML. …<
