Friday, September 7, 2007

Live APRS maps on your own web page!

It's now possible to put APRS maps on your own web page. It's free, and it's easy. Show the current location of your car, airplane, boat, motorcycle or ship, or all the APRS activity in your town. Just copy and paste the following HTML code on your page (replace OH2RCH with your own APRS callsign):

<p>
<script type="text/javascript">
he_track = "OH2RCH"; // track this callsign
</script>
<script type="text/javascript" src="http://aprs.he.fi/js/embed.js">
</script>
</p>

It's also possible to start the embedded map at certain coordinates (showing all APRS targets in the area, or limiting shown targets like in the Options of aprs.he.fi). The map updates automatically (every few seconds, just like the real thing) without need for the user to reload the page to get new data. Read more detailed instructions on embedding APRS maps on your web page!


19 comments:

Anonymous said...

This is easily the best Google based APRS site I've every seen. That includes my own for balloon flight prediction at nearspaceventures.com, I sure hope I can learn more from this site.

Anonymous said...

Very cool, I love it de EI7IG

Unknown said...

I have just added this script to my own website. www.gb3dc.co.uk

I must say it is superb.

I wonder is there anyway to change the trace colour? and can the units be changed from KM to miles as on the full website version?

Again many thanks Dominic G7NPW

Anonymous said...

I was JUST about to ask when you guys were going to do something like this... Awesome stuff!

I would like the ability to set to MPH and FT - but I'm sure that's on it's way.

You guys rock!
Keep it up!
- Kris

Hessu said...

Thanks for the kind words, guys.

The track colours cannot currently be changed per tracking target. They are selected in a round-robin fashion from a pool of fixed colours, so that each target always gets the same colour. I could, however, pay more attention to the colours used. Looking at Dominic's site I now see that blue, red and green are not good choices in the UK. If you look at the map somewhere in Finland, you'll notice all of our roads are yellow or orange. Those colours are currently not used for tracks. :)

I'll try to improve this somehow.

Unit selection for embedded maps would be easy. Though, it might be better to make it use the same logic as the real site - use imperial+fahrenheit for US visitors, imperial+celsius for UK users, and metric+C for others by default and let the visitor himself select something else from aprs.he.fi Options in case something else is preferred. The end-user usually knows his preferences better than the webmaster.

I fixed the weather graphs page, by the way. It was broken for a couple days.

Unknown said...

Great News. Yes Blue,Red & Green are not good on the UK maps. I guess Yellow would make a nice choice in the uk? i look forward to your thoughts Heikki.

I also agree it would be good for the user to choose prefered unit selection but to also provide some generic defaults like imperial/celsius for the uk.

I wonder is there a way to display a trace of a call and also display any other APRS stations that might be in the area on the same map.

Cheers again its looking really good.

Dom G7NPW

Unknown said...

Just noticed on my UK map that a "Red" road changes to "Orange" when zooming in.

Im thinking a purple might be a good colour here also.

Dom

Stan Olson said...

Very awesome site! I would also like to see the imperial / F units able to be selected on the embedded script.

units = 'imperial';
units_temp = 'F';

Keep up the good work!! 73..

Stan, K9SWX

Anonymous said...

Long time since i have seen your callsign. Hope you are well Hessu
Linda g0ylm

Hessu said...

Hi Linda, really nice to see you here! Thanks, I'm well, I hope you're too!

To the embedded map users: there's now a parameter to make other stations than the tracked one visible: he_show_others = 1; Please note that the tracked station might disappear when this is set if there are no current reports from it, since the map only shows a time range of 1 hour at a time.

The embedded map also now uses the same automatic measurement unit logic as the main site, so US/UK visitors should get imperial units, and US visitors should get temperatures in Fahrenheit. At least on some browsers (not my Firefox, though) the user-selected units from aprs.he.fi apply here. Let's see how this works out.

Andrew - KE5GDB said...

Just wanted to say that we are using this on W5KUB's site as he goes to Dayton this year. Thanks a lot for giving me the information about this feature. Tom (W5KUB) and I really like the map and the ease of installation. Again, thanks and 73s.

http://www.w5kub.com/

Anonymous said...

yes nice site but one problem..i need it for trace a gasballoon flight for maybe 20 yours and more.... but only the last hour tracked...can i change it?? www.ballon.org

Hessu said...

Unfortunately the embedded map is limited to the last 1 hour. You'll need to surf to http://aprs.fi/ to look at a longer history, sorry.

Erwin (ON8AR) said...

Is it possible to ad variable so users can see local time, now it is UTC wich is not always easy to explain :)

Great feature !
also seen @ www.on8ar.be

Unknown said...

Hello!

I've sent you a couple of e-mails about the embedded function not working. Today I googled for the js link to your script that builds the iframe. I can not find any site anywhere (including the sample in your blog) that works in Firefox, *except* the one in aprs.fi/pages/embed. They all seem to work in IE.

Hessu said...

Auspicious,

I sent a reply a few minutes back. I figured out so much that it fails on some browsers, in some configurations, but usually works.

It does work on my Windows PC, on IE7, Chrome, Safari, *and* FireFox 3.0.5. It *doesn't* work on my Linux PC, FireFox 3.0.3. I think it's got something to do with the security settings, or cookies, or cross-site scripting protection, there's probably something fishy going on in there.

Let's try to figure out the configuration difference.

Hessu said...

Auspicious figured out that the problem seems to be with 3rd-party cookies, which the new FF 3.0.5 installation disables by default. Enabling them fixes the problem.

Omar Filipovic said...

Is it possible to set a longer time range for the embedded script? Say 7 days?

Perhaps something similar to the time range in seconds as used for linking?

Unknown said...

Is it possible to change the tail length (time) on an embedded APRS.fi map?