-
Notifications
You must be signed in to change notification settings - Fork 1
/
features.htm
executable file
·697 lines (611 loc) · 25.9 KB
/
features.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>OpenLayers Editor</title>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
<style type="text/css">
#controlToggle li {
list-style: none;
}
</style>
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
<script src="./features/OpenLayers.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script type="text/javascript">
OpenLayers.ProxyHost = "http://localhost:8080/";
var map, vectors, formats, controls, snap;
function updateFormats() {
var in_options = {
'internalProjection': map.baseLayer.projection,
'externalProjection': new OpenLayers.Projection(OpenLayers.Util.getElement("inproj").value)
};
var out_options = {
'internalProjection': map.baseLayer.projection,
'externalProjection': new OpenLayers.Projection(OpenLayers.Util.getElement("outproj").value)
};
var gmlOptions = {
featureType: "feature",
featureNS: "http://example.com/feature"
};
var gmlOptionsIn = OpenLayers.Util.extend(
OpenLayers.Util.extend({}, gmlOptions),
in_options
);
var gmlOptionsOut = OpenLayers.Util.extend(
OpenLayers.Util.extend({}, gmlOptions),
out_options
);
var kmlOptionsIn = OpenLayers.Util.extend(
{extractStyles: true}, in_options);
formats = {
'in': {
wkt: new OpenLayers.Format.WKT(in_options),
geojson: new OpenLayers.Format.GeoJSON(in_options),
georss: new OpenLayers.Format.GeoRSS(in_options),
gml2: new OpenLayers.Format.GML.v2(gmlOptionsIn),
gml3: new OpenLayers.Format.GML.v3(gmlOptionsIn),
kml: new OpenLayers.Format.KML(kmlOptionsIn),
atom: new OpenLayers.Format.Atom(in_options),
gpx: new OpenLayers.Format.GPX(in_options),
encoded_polyline: new OpenLayers.Format.EncodedPolyline(in_options)
},
'out': {
wkt: new OpenLayers.Format.WKT(out_options),
geojson: new OpenLayers.Format.GeoJSON(out_options),
georss: new OpenLayers.Format.GeoRSS(out_options),
gml2: new OpenLayers.Format.GML.v2(gmlOptionsOut),
gml3: new OpenLayers.Format.GML.v3(gmlOptionsOut),
kml: new OpenLayers.Format.KML(out_options),
atom: new OpenLayers.Format.Atom(out_options),
gpx: new OpenLayers.Format.GPX(out_options),
encoded_polyline: new OpenLayers.Format.EncodedPolyline(out_options)
}
};
}
function init(){
// allow testing of specific renderers via "?renderer=Canvas", etc
var renderer = OpenLayers.Util.getParameters(window.location.href).renderer;
renderer = (renderer) ? [renderer] : OpenLayers.Layer.Vector.prototype.renderers;
vectors=new OpenLayers.Layer.Vector("WFS");
map = new OpenLayers.Map({
div: "map",
layers: [
new OpenLayers.Layer.OSM(),
new OpenLayers.Layer.Google("Google Streets", {visibility: false}),
// the SATELLITE layer has all 22 zoom level, so we add it first to
// become the internal base layer that determines the zoom levels of the
// map.
new OpenLayers.Layer.Google(
"Google Satellite",
{type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}
),
new OpenLayers.Layer.Google(
"Google Physical",
{type: google.maps.MapTypeId.TERRAIN, visibility: false}
),
new OpenLayers.Layer.Google(
"Google Streets", // the default
{numZoomLevels: 20, visibility: false}
),
new OpenLayers.Layer.Google(
"Google Hybrid",
{type: google.maps.MapTypeId.HYBRID, numZoomLevels: 22, visibility: false}
),
new OpenLayers.Layer("Blank",{isBaseLayer: true}),
//world,
vectors
],
center: new OpenLayers.LonLat(0, 0),
zoom: 6,
numZoomLevels: 60
});
OpenLayers.Feature.Vector.style['default']['strokeWidth'] = '2';
//map.addLayer(vectors);
//map.addLayers([wms, vectors]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.MousePosition());
map.addControl(new OpenLayers.Control.Navigation());
map.zoomToMaxExtent();
map.addControl(new OpenLayers.Control.EditingToolbar(vectors));
var options = {
hover: true,
onSelect: serialize
};
//var select = new OpenLayers.Control.SelectFeature(vectors, options);
//map.addControl(select);
//select.activate();
updateFormats();
// configure the snapping agent
snap = new OpenLayers.Control.Snapping({layer: vectors});
map.addControl(snap);
snap.activate();
// add behavior to snap elements
var snapCheck = document.getElementById("snap_toggle");
snapCheck.checked = true;
snapCheck.onclick = function() {
if(snapCheck.checked) {
snap.activate();
} else {
snap.deactivate();
}
};
// selection
vectors.events.on({
'featureselected': function(feature) {
document.getElementById('counter').innerHTML = this.selectedFeatures.length;
},
'featureunselected': function(feature) {
document.getElementById('counter').innerHTML = this.selectedFeatures.length;
}
});
if (console && console.log) {
function report(event) {
console.log(event.type, event.feature ? event.feature.id : event.components);
};
vectors.events.on({
"beforefeaturemodified": report,
"featuremodified": report,
"afterfeaturemodified": report,
"vertexmodified": report,
"sketchmodified": report,
"sketchstarted": report,
"sketchcomplete": report,
"featureselected": report,
"featureunselected": report
});
}
controls = {
point: new OpenLayers.Control.DrawFeature(vectors,
OpenLayers.Handler.Point),
line: new OpenLayers.Control.DrawFeature(vectors,
OpenLayers.Handler.Path),
polygon: new OpenLayers.Control.DrawFeature(vectors,
OpenLayers.Handler.Polygon),
regular: new OpenLayers.Control.DrawFeature(vectors,
OpenLayers.Handler.RegularPolygon,
{handlerOptions: {sides: 5}}),
modify: new OpenLayers.Control.ModifyFeature(vectors),
select: new OpenLayers.Control.SelectFeature(
vectors,
{
clickout: false, toggle: false,
multiple: false, hover: false,
toggleKey: "ctrlKey", // ctrl key removes from selection
multipleKey: "shiftKey", // shift key adds to selection
box: true
}
),
selecthover: new OpenLayers.Control.SelectFeature(
vectors,
{
multiple: false, hover: true,
toggleKey: "ctrlKey", // ctrl key removes from selection
multipleKey: "shiftKey" // shift key adds to selection
}
)
};
for(var key in controls) {
map.addControl(controls[key]);
}
map.setCenter(new OpenLayers.LonLat(0, 0), 3);
document.getElementById('noneToggle').checked = true;
}
function update() {
// reset modification mode
controls.modify.mode = OpenLayers.Control.ModifyFeature.RESHAPE;
var rotate = document.getElementById("rotate").checked;
if(rotate) {
controls.modify.mode |= OpenLayers.Control.ModifyFeature.ROTATE;
}
var resize = document.getElementById("resize").checked;
if(resize) {
controls.modify.mode |= OpenLayers.Control.ModifyFeature.RESIZE;
var keepAspectRatio = document.getElementById("keepAspectRatio").checked;
if (keepAspectRatio) {
controls.modify.mode &= ~OpenLayers.Control.ModifyFeature.RESHAPE;
}
}
var drag = document.getElementById("drag").checked;
if(drag) {
controls.modify.mode |= OpenLayers.Control.ModifyFeature.DRAG;
}
if (rotate || drag) {
controls.modify.mode &= ~OpenLayers.Control.ModifyFeature.RESHAPE;
}
controls.modify.createVertices = document.getElementById("createVertices").checked;
var sides = parseInt(document.getElementById("sides").value);
sides = Math.max(3, isNaN(sides) ? 0 : sides);
controls.regular.handler.sides = sides;
var irregular = document.getElementById("irregular").checked;
controls.regular.handler.irregular = irregular;
}
function toggleControl(element) {
for(key in controls) {
var control = controls[key];
if(element.value == key && element.checked) {
control.activate();
} else {
control.deactivate();
}
}
}
function removeSelected(){
vectors.removeFeatures(
vectors.selectedFeatures,
{
silent: true
}
);
}
function convertSelectedToPolygon(){
var features=vectors.selectedFeatures;
var ring = convertToRing(features,new OpenLayers.Geometry.LinearRing());
polygonFeature = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Polygon([ring]), null, null); //site_style
vectors.addFeatures([polygonFeature]);
}
function convertToRing(features, ring){
for(var fid in features){
if (features[fid] instanceof OpenLayers.Geometry.Point){
ring.addComponent(features[fid].clone());
} else if (features[fid].geometry instanceof OpenLayers.Geometry.Point){
ring.addComponent(features[fid].geometry.clone());
} else if (features[fid].geometry instanceof OpenLayers.Geometry.Collection){
ring=convertToRing(features[fid].geometry.components,ring);
} else {
ring=convertToRing(features[fid].components,ring);
}
}
return ring;
}
function convertSelectedToPoints(){
var features=vectors.selectedFeatures;
convertToPoints(features);
}
function convertToPoints(features){
for(var fid in features){
if (features[fid] instanceof OpenLayers.Geometry.Point){
vectors.addFeatures([new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(features[fid].x,features[fid].y))]);
} else if (features[fid].geometry instanceof OpenLayers.Geometry.Point){
vectors.addFeatures([new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(features[fid].geometry.clone()))]); //TODO check
} else if (features[fid].geometry instanceof OpenLayers.Geometry.Collection){
convertToPoints(features[fid].geometry.components);
} else {
convertToPoints(features[fid].components);
}
}
}
function addPointFeature(pointGeom){
polygonFeature = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Point(pointGeom), null, null); //site_style
vectors.addFeatures([polygonFeature]);
}
function serialize(feature) {
var type = document.getElementById("formatType").value;
// second argument for pretty printing (geojson only)
var pretty = document.getElementById("prettyPrint").checked;
var str = formats['out'][type].write(feature, pretty);
// not a good idea in general, just for this demo
str = str.replace(/,/g, ', ');
document.getElementById('output').value = str;
}
function serializeSelected(feature) {
serialize(vectors.selectedFeatures);
}
function deserialize() {
var element = document.getElementById('text');
var type = document.getElementById("formatType").value;
var features = formats['in'][type].read(element.value);
var bounds;
if(features) {
if(features.constructor != Array) {
features = [features];
}
for(var i=0; i<features.length; ++i) {
if (!bounds) {
bounds = features[i].geometry.getBounds();
} else {
bounds.extend(features[i].geometry.getBounds());
}
}
vectors.addFeatures(features);
//map.zoomToExtent(bounds);
var plural = (features.length > 1) ? 's' : '';
element.value = features.length + ' feature' + plural + ' added';
} else {
element.value = 'Bad input ' + type;
}
}
//////////////// SIMPLIFY
// Control behaviour
var lastValue = 0.01;
function simplify(){
var min = 0;
var max = 1;
var givenVal= parseFloat(document.getElementById('tolerance').value);
var useVal = lastValue;
if (!isNaN(givenVal)) {
if (givenVal >= min && givenVal <= max) {
useVal = givenVal;
} else {
useVal = (givenVal < min) ? min : max;
}
}
for(var i=0; i<vectors.features.length; ++i) {
if (vectors.features[i].geometry instanceof OpenLayers.Geometry.LineString){
var newLineString=vectors.features[i].geometry.simplify(useVal);
var originalVerticesCnt = vectors.features[i].geometry.components.length;
var simplifiedVerticesCnt = newLineString.getVertices().length;
vectors.removeFeatures(vectors.features[i]);
vectors.addFeatures([new OpenLayers.Feature.Vector(newLineString)]);
//var infotxt = '<ul><li>Original LineString: <strong>';
//infotxt += originalVerticesCnt + ' vertices</strong></li>';
//infotxt += ' <li>Simplified geometry: <strong>' + simplifiedVerticesCnt + ' vertices</strong></li>';
//infotxt += ' <li>Decreased by <strong>' + (((originalVerticesCnt-simplifiedVerticesCnt)/originalVerticesCnt)*100).toFixed(2) + ' per cent</strong></li></ul>';
//document.getElementById('info').innerHTML = infotxt;
}
}
lastValue = useVal;
document.getElementById('tolerance').value = lastValue;
};
///////////////SIMPLIFY ANIMATED
// document.getElementById('simplify').onclick = simplify;
// simplify();
var animationInterval;
function animationHandler(){
if (document.getElementById('animation').value === 'Start animation') {
document.getElementById('simplify').disabled = true;
document.getElementById('animation').value = "Stop animation";
animationInterval = window.setInterval(function(){
var tolerance = parseFloat(document.getElementById('tolerance').value);
if (tolerance < 1) {
tolerance+=0.01;
} else {
tolerance = 0.01;
}
document.getElementById('tolerance').value = tolerance.toFixed(2);
simplify();
}, 2000);
simplify();
} else {
if (animationInterval) {
window.clearInterval(animationInterval);
}
document.getElementById('simplify').disabled = false;
document.getElementById('animation').value = "Start animation";
}
};
/////////////////////// LABELs
function label(layer, features){
for(var fid=0; fid<features.length; ++fid) {
layer.drawFeature(features[fid],{
label:String(fid),
labelOffsetX: "10",
labelOffsetY: "10",
fontColor: "red",
fontSize: 12,
fontFamily: "Arial",
fontWeight: "bold",
labelAlign: "lt"
}
);
}
};
function labelize(){
label(vectors, vectors.selectedFeatures);
};
/*
$(document).ready(function(){
init();
var map = $("#map");
map.css("height", $("#controls").height());
});
*/
</script>
<body onload="init();">
<div class="container">
<div class="row-fluid">
<div class="span12">
<h1 id="title">OpenLayers Editor</h1>
<div id="shortdesc">A set of simple tools to import export and modify features on a map.</div>
</div>
</div>
<div class="row-fluid">
<div class="span8">
<div id="map" style='width: 100%; height:500px'></div>
</div>
<div class="span4">
<div id="controls">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" href="#collapseOne"><i class="icon-save"></i> Import/Export</a>
</div>
<div id="collapseOne" class="accordion-body collapse">
<div class="accordion-inner">
<div id="input">
<p>Use the drop-down below to select the input/output format
for vector features. New features can be added by using the drawing
tools above or by pasting their text representation below.</p>
<label for="formatType">Format</label>
<select name="formatType" id="formatType">
<option value="geojson" selected="selected">GeoJSON</option>
<option value="atom">Atom</option>
<option value="kml">KML</option>
<option value="georss">GeoRSS</option>
<option value="gml2">GML (v2)</option>
<option value="gml3">GML (v3)</option>
<option value="wkt">Well-Known Text (WKT)</option>
<option value="gpx">GPX</option>
<option value="encoded_polyline">Encoded Polyline</option>
</select>
<label for="prettyPrint">Pretty print</label>
<input id="prettyPrint" type="checkbox" name="prettyPrint" value="1">
<br>
Input Projection: <select id="inproj" onchange="updateFormats()">
<option value="EPSG:4326" selected="selected">EPSG:4326</option>
<option value="EPSG:900913">Spherical Mercator</option>
</select> <br>
Output Projection: <select id="outproj" onchange="updateFormats()">
<option value="EPSG:4326" selected="selected">EPSG:4326</option>
<option value="EPSG:900913">Spherical Mercator</option>
</select>
<br>
<textarea id="text" style='width: 100%; height: 300px;'></textarea>
<br>
<input type="button" value="add feature" onclick="deserialize();">
</div> <br /><br />
<div id="info">
<p>Use the tools to draw new polygons, lines, and points.
After drawing some new features, hover over a feature to see the
serialized version below.</p>
<textarea id="output" style='width: 100%; height: 300px;'></textarea>
</div>
</div>
</div>
</div>
<div class="accordion" id="accordion2">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#editor"><i class="icon-cog"></i>Editor</a>
</div>
<div id="editor" class="accordion-body collapse">
<div class="accordion-inner">
<ul id="controlToggle">
<!--
<li>
<label for="snap_toggle"></label>
<input type="checkbox" name="snapping" id="snap_toggle" checked="checked">
</li>
-->
<li>
<label class="radio">
<input type="radio" name="type" value="none" id="noneToggle" onclick="toggleControl(this);" checked="checked">navigate
</label>
</li>
<li>
<label class="radio">
<input type="radio" name="type" value="point" id="pointToggle" onclick="toggleControl(this);">draw point
</label>
</li>
<li>
<label class="radio">
<input type="radio" name="type" value="line" id="lineToggle" onclick="toggleControl(this);">draw line
</label>
</li>
<li>
<label class="radio">
<input type="radio" name="type" value="polygon" id="polygonToggle" onclick="toggleControl(this);">draw polygon
</label>
</li>
<li>
<label class="radio">
<input type="radio" name="type" value="regular" id="regularToggle" onclick="toggleControl(this);">draw regular polygon
</label>
<ul>
<li>
<input id="sides" type="text" placeholder="sides" size="2" maxlength="2" name="sides" onchange="update()">
</li>
<li>
<label class="checkbox">
<input type="checkbox" id="irregular" type="checkbox" name="irregular" onchange="update()"> Irregular
</label>
</li>
</ul>
</li>
<li>
<label class="radio">
<input type="radio" name="type" value="modify" id="modifyToggle" onclick="toggleControl(this);">modify feature
</label>
<ul>
<li>
<label class="checkbox">
<input type="checkbox" id="createVertices" type="checkbox" checked="" name="createVertices" onchange="update()">allow vertices creation
</label>
</li>
<li>
<label class="checkbox">
<input id="rotate" type="checkbox" name="rotate" onchange="update()">allow rotation
</label>
</li>
<li>
<label class="checkbox">
<input id="resize" type="checkbox" name="resize" onchange="update()">allow resizing
</label>
<ul>
<li>
<label class="checkbox">
<input id="keepAspectRatio" type="checkbox" name="keepAspectRatio" onchange="update()" checked="checked">keep aspect ratio
</label>
</li>
</ul>
</li>
<li>
<label class="checkbox">
<input id="drag" type="checkbox" name="drag" onchange="update()">allow dragging
</label>
</li>
</ul>
</li>
<!--li>
<input type="radio" name="type" value="selecthover" id="selecthoverToggle" onclick="toggleControl(this);">
<label for="selecthoverToggle">Select features on hover</label>
</li-->
<li>
<label class="radio">
<input type="radio" name="type" id="selectToggle" value="select" onclick="toggleControl(this);">select feature (<span id="counter">0</span> features selected)
</label>
<p>
Use the shift key to select multiple features. Use the ctrl key to
toggle selection on features one at a time. Note: the "clickout" option has no
effect when "hover" is selected.
</p>
<ul>
<li>
<label class="checkbox">
<input id="box" type="checkbox" name="box" checked="checked" onchange="update()">select features in a box
</label>
</li>
<li>
<label class="checkbox">
<input id="clickout" type="checkbox" name="clickout" checked="checked" onchange="update()">click out to unselect features
</label>
</li>
</ul>
<button type="submit" class="btn" onclick="removeSelected();">Remove features</button>
<button type="submit" class="btn" onclick="serializeSelected();"/>Dump features</button>
<button type="submit" class="btn" onclick="convertSelectedToPolygon();">Convert to polygon</button>
<button type="submit" class="btn" onclick="convertSelectedToPoints();">Convert to points</button>
<button type="submit" class="btn" onclick="labelize();">Label features</button>
</li>
<li>
<div id="control-simplify">
<label for="tolerance">Tolerance factor:</label>
<input name="tolerance" id="tolerance" type="number" min="0" max="1" step="0.01" value="0.01">
<button type="submit" class="btn" id="simplify" onclick="simplify();">Simplify LineString</button>
<button type="submit" class="btn" id="animation" onclick="animationHandler();">Start animation</button>
<div id="info"></div>
</div>
</li>
</ul>
</div>
</div>
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#global"><i class="icon-cog"></i>Global</a>
</div>
<div id="global" class="accordion-body collapse">
<div class="accordion-inner">
<label class="checkbox">
<input type="checkbox" name="snapping" id="snap_toggle" checked="checked"> Snap to points
</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body></html>