@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | $id = $spotter_item['Waypoint']['@attributes']['id']; |
24 | 24 | if ($id == 0 || !is_numeric($id)) $id = $j; |
25 | 25 | $output .= '{"type": "Feature",'; |
26 | - $output .= '"id": '.$id.','; |
|
27 | - $output .= '"properties": {'; |
|
26 | + $output .= '"id": '.$id.','; |
|
27 | + $output .= '"properties": {'; |
|
28 | 28 | $output .= '"type": "'.$spotter_item['@attributes']['type'].'",'; |
29 | 29 | //$output .= '"id": "'.$spotter_item['Waypoint']['@attributes']['id'].'",'; |
30 | 30 | $output .= '"name": "'.$spotter_item['Waypoint']['@attributes']['name'].'",'; |
@@ -35,31 +35,31 @@ discard block |
||
35 | 35 | } elseif ($spotter_item['@attributes']['type'] == 'Finish') { |
36 | 36 | $output .= '"icon": "/images/tsk/tsk-finish.png"'; |
37 | 37 | } else $output .= '"icon": "/images/tsk/number_'.$id.'.png"'; |
38 | - $output .= '},'; |
|
39 | - $output .= '"geometry": {'; |
|
38 | + $output .= '},'; |
|
39 | + $output .= '"geometry": {'; |
|
40 | 40 | $output .= '"type": "Point",'; |
41 | 41 | $output .= '"coordinates": ['; |
42 | - $output .= $spotter_item['Waypoint']['Location']['@attributes']['longitude'].', '.$spotter_item['Waypoint']['Location']['@attributes']['latitude']; |
|
42 | + $output .= $spotter_item['Waypoint']['Location']['@attributes']['longitude'].', '.$spotter_item['Waypoint']['Location']['@attributes']['latitude']; |
|
43 | 43 | $output .= ']'; |
44 | - $output .= '}'; |
|
44 | + $output .= '}'; |
|
45 | 45 | $output .= '},'; |
46 | 46 | $j++; |
47 | 47 | } |
48 | 48 | // Lines |
49 | 49 | $output .= '{"type": "Feature",'; |
50 | - $output .= '"properties": {'; |
|
50 | + $output .= '"properties": {'; |
|
51 | 51 | $output .= '"type": "'.$spotter_array['@attributes']['type'].'"'; |
52 | - $output .= '},'; |
|
53 | - $output .= '"geometry": {'; |
|
52 | + $output .= '},'; |
|
53 | + $output .= '"geometry": {'; |
|
54 | 54 | $output .= '"type": "LineString",'; |
55 | 55 | $output .= '"coordinates": ['; |
56 | 56 | foreach($spotter_array['Point'] as $spotter_item) |
57 | 57 | { |
58 | - $output .= '['.$spotter_item['Waypoint']['Location']['@attributes']['longitude'].', '.$spotter_item['Waypoint']['Location']['@attributes']['latitude'].'],'; |
|
58 | + $output .= '['.$spotter_item['Waypoint']['Location']['@attributes']['longitude'].', '.$spotter_item['Waypoint']['Location']['@attributes']['latitude'].'],'; |
|
59 | 59 | } |
60 | 60 | $output = substr($output, 0, -1); |
61 | 61 | $output .= ']'; |
62 | - $output .= '}'; |
|
62 | + $output .= '}'; |
|
63 | 63 | $output .= '},'; |
64 | 64 | $output = substr($output, 0, -1); |
65 | 65 | } |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | }; |
344 | 344 | |
345 | 345 | <?php |
346 | - if (isset($_GET['tsk'])) { |
|
346 | + if (isset($_GET['tsk'])) { |
|
347 | 347 | ?> |
348 | 348 | function tskPopup (feature, layer) { |
349 | 349 | var output = ''; |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | }; |
379 | 379 | update_tsk(); |
380 | 380 | <?php |
381 | - } |
|
381 | + } |
|
382 | 382 | ?> |
383 | 383 | map.on('moveend', function() { |
384 | 384 | //if (map.getZoom() > 7) { |
@@ -394,10 +394,10 @@ discard block |
||
394 | 394 | setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
395 | 395 | |
396 | 396 | <?php |
397 | - // Add support for custom json via $globalMapJson |
|
398 | - if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
397 | + // Add support for custom json via $globalMapJson |
|
398 | + if (isset($globalMapJson) && is_array($globalMapJson)) { |
|
399 | 399 | foreach ($globalMapJson as $json) { |
400 | - if (isset($json['url'])) { |
|
400 | + if (isset($json['url'])) { |
|
401 | 401 | ?> |
402 | 402 | update_genLayer('<?php print $json['url']; ?>'); |
403 | 403 | <?php |
@@ -406,9 +406,9 @@ discard block |
||
406 | 406 | setInterval(function(){update_genLayer('<?php print $json['url']; ?>')}, <?php print $json['refresh']; ?>); |
407 | 407 | <?php |
408 | 408 | } |
409 | - } |
|
409 | + } |
|
410 | + } |
|
410 | 411 | } |
411 | - } |
|
412 | 412 | |
413 | 413 | ?> |
414 | 414 | //adds the bootstrap tooltip to the map icons |