When I connect to my dump1090 server locally over the network with any browser i.e 10.0.0.96:8080 everything works perfectly
When I port forward my public ip address to port 8080 on the Raspberry Pi and try to connect to it from outside of my network, the right hand part of the screen with all the statistics works perfectly, however google maps comes up with an error.
This used to work for me and is something that I only recently became aware of when I re-enabled port forwarding so that a friend that was interested in PiAware could take a look at it up in action.
Existing installs might continue to work but it depends on exactly how you access them, as the grandfathering is done on a domain-by-domain basis. New installs, or access to old installs via a new IP/domain, won’t work.
I have a work in progress that changes dump1090 to use alternative map providers here: github.com/mutability/dump1090/tree/ol3
Alternatively you can apply for a google maps API key and insert that into your local install.
I dropped my key information into that spot within gmap.html and it failed to work from inside my network as well as from the outside.
I pulled the key info back out and everything is working fine again inside my local network, but still no joy for the rest of the world trying to access it from outside.
Ok finally got the dump1090 server to display maps publicly. Please see: 73.92.161.105:8080
And Obj was absolutely correct on where to add the Google API Key to the script in gmaps.html
The error I made was in the API settings under HTTP referrals. I added my external IP address and port, thinking they were asking what IP address the API was associated with. When in reality, you can limit the API to specific HTTP referrers, If you leave that field blank, your server can accept requests from anyone.
Once I cleaned that setting up, everything worked like magic.
The process of getting your FREE API key is a simple one and should take no more then 1 minute.
Here is the link to get your Free Google maps API key.
I merged my openlayers work to master, so dump1090-mutability should now work without needing a google api key (and, unfortunately, without being able to use the google imagery; but you can enable Bing if you like with a key)
I had a slightly different problem after I enabled the API key. I got a javascript error “TypeError: a is undefined”. The error was coming from the google map api script. I did not have any IP information in the API setup. After some googling around, it seems that this error means the parameters to the map request are not constructed properly. It fails in Firefox and IE.
Now if I remove the API key, everything works fine, as it has for many months. Very strange. I’m guessing including the API key results in a different version of the google map JS which looks at the parms differently. I should be “grandfathered” so I’ll just skip using the key for now.
running dump1090-mutability 1.15~dev.
Update: I spent some time today looking at this. The error is related to an undefined a.lat variable in the google maps javascript. The problem goes away if Lat/Long are NOT specified in /etc/default/dump1090-mutability. I had them both in there, for some reason I can’t recall. I commented out those two line, and my new API key worked like a charm. I just wanted to update this in case anyone else hit the same problem.
Update 2: or maybe not! I put lat/long back in the config file, so that first time users will get their map centered in the right place to see the planes my receiver is picking up. and it worked! so, I don’t know what caused this JS TypeError, nor what I did to fix it. oh well.
What I do use use two different ports, say, x and y, and forward one to one of my Pis, and the other to the other one. Port 8080 from the outside world doesn’t see my Pi.
BTW, probably not a good idea to post a link that connects directly to your Pi. It won’t take long for bots to pick it up and flood it with requests. In my previous post I explain how I use a DNS service. It has worked perfectly for me without ever a google maps issue.