Add Terrain Limit Rings To Skyaware Map

ADD TERRAIN LIMIT RINGS TO SKYAWARE MAP

STEP -1: Include Terrain Limit Ring in your map at IP-of-PI/skyaware/

 

1.1 - First generate heywhatsthat.com panorama for your location.

To do this, follow the steps in first post of the following thread:

What is the Maximum Range I can Get?

1.2 - Once your panorama is generated, look near the top left of your newly created panorama page. See screenshot below.

You will see URL of your panorama there. The URL will be:
http://www.heywhatsthat.com/?view=XXXXXXXX
where XXXXXXXX is the ID for your panorama.

Copy-Paste your heywhatsthat panorama ID in Notepad and save it.

 

 

1.3 - Use following command to download the generated panorama’s JSON file to your RPi

The above command will save it as upintheair.json in the folder /usr/share/skyaware/html (replace XXXXXXXX in the command below by your panorama’s ID).

sudo wget -O /usr/share/skyaware/html/upintheair.json "http://www.heywhatsthat.com/api/upintheair.json?id=XXXXXXXX&refraction=0.25&alts=12192"  

To keep map un-cluttered, I have used only 1 ring in the wget command above, i.e. the 12192 meters (40,000 feet) ring.

1.4 - Reload your browser (Ctrl+F5). Clear browser cache if necessary (Ctrl+Shift+Delete)

 

STEP-2 (OPTIONAL): Change Terrain Ring from solid-black line to dashed-blue line.

(This will make Terrain Rings distinct from Range Circles).

 

2.1 - Make a backup copy of file script.js. This is important, as it will enable you to revert if you make a mistake or damage the file during editing.

cd /usr/share/skyaware/html/   
sudo cp script.js script.js.bak    

# To make sure that copy has been made, give following command
ls script*   

# The above command should list following files
script.js  script.js.bak

2.2 - Open file script.js for editing

sudo nano /usr/share/skyaware/html/script.js   

2.3 - Press Ctrl+W and type:

var ringStyle

then press Enter key. The cursor will jump to line starting with var ringStyle

2.4 - Change

color: '#000000'
to
color: '#0000ff'

2.5 - Add a new line:

lineDash:[4,4],

 

Please see below for steps 2.4 & 2.5:

 

                var ringStyle = new ol.style.Style({
                        fill: null,
                        stroke: new ol.style.Stroke({ 
                                // change color from #000000 to #0000ff as below
                                color: '#0000ff',
                                // add line below for dashed terrain ring
                                lineDash:[4,4],  
                                width: 1
                        })
                });

2.6 - Save file (Ctrl+O) and close it (Ctrl+X)

2.7 - Reload browser (Ctrl+F5)

 

ADDITIONAL INFO:

To keep map un-cluttered, in the wget command above, I have used only 1 ring at 40,000 feet (12192 meters).

You can create as many rings as you want by adding elevations (in meters) at the end of URL given in the wget command above after &alts=, separated by commas.

10,000 ft = 3048 m
20,000 ft = 6096 m
25,000 ft = 7620 m
30,000 ft = 9144 m
40,000 ft = 12192 m

Hence if you want to add:

  • Two rings, one at 10,000 feet (3048 m) and other at 40,000 feet (12192 m), the string at the end of wget URL will become &alts=3048,12192

  • All the 5 elevation rings noted above, the string at the end of wget URL will become &alts=3048,6096,7620,9144,12192

Important:
Use altitude in meters in the wget URL above.
Do NOT use feet.

6 Likes

This is so freaking cool! Thanks for sharing this AND doing such a great job with the instructions!!!

Thanks @adcd567 i’v done the above and followed it to the letter, have checked the file and it has changed the parameters for colour and dashed line but still only shows a black solid line…any clues as to where i’v gone wrong please?

Kind Regards

Neil

Clear browser cache (Ctrl + Shift + Delete)
Reload browser (Ctrl + F5)

Tried that…still hasnt solved it :pleading_face:. How do I remove the whole script to get back to my original rings? :wink:

I’m pretty much left with this…(changed my rings to a single at 215 just to declutter the page)…

Repeat clear cache + reload browser several time.
If that does not work, try another browser
Also make sure first 2 lines of code end with a coma, while the 3rd (last one) is without coma

If you have created a back-up copy of script.js before making changes as per step " 2.1 - Make a backup copy of file script.js", it is easy to revert/restore. Just give following commands to copy back-up script.js.bak over the edited file script.js

cd /usr/share/skyaware/html/   
sudo cp script.js.bak script.js

 

Tried a different browser and it worked…thank you :smiley: Tried clearing the cache again in my original browser and it didnt work, so uninstalled it and re-installed it…Now working fine on that one too :+1:t2:

1 Like

How to you remove the terrain rings if you don’t have a script.js.bak file? Is it a full reinstall.

Issue this command and reload browser (Ctrl+F5)

sudo rm /usr/share/skyaware/html/upintheair.json  

 

1 Like

Thank you, glad I didn’t have to reinstall everything.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.