Changeset 8471 in genesis for nodes/nodemap.html
- Timestamp:
- Sep 19, 2010, 10:18:48 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nodes/nodemap.html
r8469 r8471 68 68 } 69 69 70 OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { 70 OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { 71 71 defaultHandlerOptions: { 72 72 'single': true, … … 95 95 lonlat = lonlat.transform( projection_smp, projection_wgs); 96 96 var url = coordConvert(lonlat.lon, lonlat.lat); 97 alert("You clicked near " + lonlat.lon + " N, " + lonlat.lat + " E\n\n" +98 'Copy/paste URL in NEW browser window to get your RDNAP coordinates\n\n' + url);97 document.getElementById('coordOutput').href = url; 98 document.getElementById('coordOutput').innerHTML = Math.round(lonlat.lon * 1000) / 1000 + " N, " + Math.round(lonlat.lat * 1000) / 1000 + " E"; 99 99 } 100 100 … … 291 291 292 292 293 var vectors = new OpenLayers.Layer.Vector("Vector Layer"); 294 map.addLayer(vectors); 293 // XXX: Enable if we found some use for it somewhere 294 // var vectors = new OpenLayers.Layer.Vector("Vector Layer"); 295 // map.addLayer(vectors); 296 // map.addControl(new OpenLayers.Control.EditingToolbar(vectors)); 297 295 298 map.addControl(new OpenLayers.Control.MousePosition({ 'displayProjection' : projection_wgs })); 296 map.addControl(new OpenLayers.Control.EditingToolbar(vectors));297 299 map.addControl(new OpenLayers.Control.LayerSwitcher()); 298 300 map.addControl(new OpenLayers.Control.OverviewMap()); … … 389 391 } 390 392 391 392 393 393 function toggleFieldById(field) { 394 var e = document.getElementById(field); 395 if (e.style.visibility == "hidden") { 396 e.style.visibility = "visible"; 397 } else { 398 e.style.visibility = "hidden"; 399 } 400 } 394 401 395 402 function toggleClickControl() { 403 toggleFieldById('coordField'); 396 404 if (!clickControl.active) { 397 405 clickControl.activate(); … … 404 412 } 405 413 414 406 415 function toggleRulerControl() { 407 416 if (!rulerControl.active) { … … 419 428 } 420 429 421 function toggleInfo() {422 var e = document.getElementById('infofield');423 if (e.style.visibility == "hidden") {424 e.style.visibility = "visible";425 } else {426 e.style.visibility = "hidden";427 }428 }429 430 431 430 // http://openlayers.org/dev/examples/strategy-cluster-threshold.html 432 431 // ]]> … … 438 437 <div id="basicMap"> 439 438 <div id="controller" style="position: absolute; top: 10px; left : 80px; z-index:1004"> 440 <img id="ruler" src="ruler_off.png" onclick="toggleRulerControl()" alt="ruler"/> 439 <img id="ruler" src="ruler_off.png" 440 onclick="toggleRulerControl()" alt="ruler" title="Measure distance between points"/> 441 441 <img height="22" src="http://maps.google.com/mapfiles/kml/pal3/icon23.png" title="Reset focus" onclick="defaultFocus()" alt="Focus reset" /> 442 442 <img height="22" 443 443 src="http://maps.google.com/mapfiles/kml/pal3/icon36.png" 444 title="Information" onclick="toggle Info()" alt="information" />444 title="Information" onclick="toggleFieldById('infoField')" alt="information" /> 445 445 <img id="click" height="22" 446 446 src="http://maps.google.com/mapfiles/kml/pal3/icon28.png" 447 title=" Coordinate converter" onclick="toggleClickControl()"447 title="Get RD coordinates for use in Genesis" onclick="toggleClickControl()" 448 448 alt="coordinate converter"/> 449 449 <div id="output"></div> 450 450 </div> 451 <div id="info field" style="position: absolute; bottom: 40px; left : 10px; z-index:1004; background-color: red; visibility: hidden">451 <div id="infoField" style="position: absolute; bottom: 40px; left : 10px; z-index:1004; background-color: red; visibility: hidden"> 452 452 <ul> 453 453 <li>holding down shift, whilst dragging the mouse to do box zooming</li> … … 462 462 </p> 463 463 </div> 464 <div id="coordField" style="position: absolute; bottom: 40px; left : 10px; z-index:1005; background-color: green; visibility: hidden"> 465 Click on a location on the map to receive a link to calculate the RD coordinates: <br /> 466 <a id="coordOutput" href="#" target="_blank">Click on MAP first</a> 467 </div> 464 468 </div> 465 469 </body>
Note:
See TracChangeset
for help on using the changeset viewer.