Page 1 of 3

Open AIP

Posted: Sun Apr 10, 2016 2:49 pm
by nitro999
Sorry if this has been raised before. I did a search but couldn't find any mention.

Would it be possible to have OpenAIP as a map option? It seems to use Open StreetMap as a base layer and then overlay onto it nav aids, aviation charts, etc. Would be really cool to have this as an option in VRS. Links below:

Map with overlays: http://maps.openaip.net
Website: http://www.openaip.net

Re: Open AIP

Posted: Mon Apr 11, 2016 12:58 am
by agw
Open StreetMap might be a problem, having lots of VRS users all fetching from the same tile server could hammer it a bit. If a Google Maps overlay could be built from the data then that would be easier to integrate into VRS.

Re: Open AIP

Posted: Wed Apr 27, 2016 9:42 pm
by nitro999
If anyone's interested, I have got this working now:

Image

The airspace and airport data comes from http://www.openaip.net

You'll need to register and then download the AIP format files from their webpage. There's then several bits of software on their apps page to convert AIP format to KML format, which can then be used as a layer on Google maps per the instructions here.

Hope that helps others who might be looking for ways to add airspace and airport data to their VRS.

Re: Open AIP

Posted: Sun May 01, 2016 11:47 pm
by amlink
Your overlay is exactly what I have been looking for. I've downloaded the aip files and converted them to kml but I'm not sure how to adjust VRS to use the overlay. Am I right in assuming you have written content for the custom plugin? Any help would be much appreciated.

Re: Open AIP

Posted: Mon May 02, 2016 6:36 pm
by nitro999
Here's the code to make it work using the custom content plugin. You'll need to change the URL to wherever you are hosting your KML files:

Code: Select all

<script type="text/javascript">
    if(VRS && VRS.globalDispatch && VRS.serverConfig) {
        VRS.globalDispatch.hook(VRS.globalEvent.bootstrapCreated, function(bootStrap) {
          
            if(bootStrap.hookMapInitialised) {

                bootStrap.hookMapInitialised(function(pageSettings) {

                    if(pageSettings.mapPlugin && pageSettings.mapPlugin.getNativeType() === 'GoogleMaps') {

                        var map = pageSettings.mapPlugin.getNative();
                        
                   
//Add airports layer

        var ctaLayer = new google.maps.KmlLayer({
          url: 'http://webpage.com/Airports.kml',
          map: map
        });

//Add hotspots layer

        var ctaLayer = new google.maps.KmlLayer({
          url: 'http://webpage.com/Hotspot.kml',
          map: map
        });

//Add airspace layer


        var ctaLayer = new google.maps.KmlLayer({
        url: 'http://webpage.com/Airspace.kml',
        map: map
        });



                    }
                });
            }
        });
    }
</script>
The above puts the overlay on all the time. If anyone knows how to write a function to toggle them on / off then please do let me know.

Re: Open AIP

Posted: Mon Aug 08, 2016 12:51 am
by Falcon_viper55
Hi,

You have more info for this?
With what program you convert the files.

Thanks

Re: Open AIP

Posted: Mon Aug 08, 2016 8:22 pm
by nitro999
Falcon_viper55 wrote: With what program you convert the files.
Hello! I used this program to convert the AIP files to KML files, which can then be displayed on the VRS map using the code above

http://afterflight.org/qopenaip2kml/releases-downloads/

Re: Open AIP

Posted: Tue Aug 09, 2016 12:01 am
by Falcon_viper55
nitro999 wrote:
Falcon_viper55 wrote: With what program you convert the files.
Hello! I used this program to convert the AIP files to KML files, which can then be displayed on the VRS map using the code above

http://afterflight.org/qopenaip2kml/releases-downloads/
I have now convert the file and save the code as (html) put i custom plugin and the kml files are i root map of custom plug.

But noting to display...
I see missing something?

And the airport and hotspot file i get not convert only the airspace file are convert to kml.

Re: Open AIP

Posted: Tue Aug 09, 2016 7:45 pm
by nitro999
Falcon_viper55 wrote: I have now convert the file and save the code as (html) put i custom plugin and the kml files are i root map of custom plug.
I couldn't get it to work by putting the KML files in the VRS root folder, so mine are hosted somewhere else. You could try putting the KML files in a public Dropbox or Onedrive folder, change the URL in the code, and see if that works temporarily. At least then you'll know what the problem is and you can look to fix it.

Be careful though, as the Dropbox or Onedrive folder location will then be visible in the webpage source code for the world to see...

Re: Open AIP

Posted: Fri Aug 12, 2016 7:44 am
by Mac
Hi,

Amazing work getting these overlays working.
I have attempted it myself but haven't had much success to be honest ! :?

I have created a Site root folder called "Overlays" on the C:\ of my VRS machine and put the KML files in there and the HTML code you posted in this thread into into a .html file there.

I've tried editing the html file URL's to look for /Airspace.kml and also tried uploading the kml to a publicly available URL and editing the HTML file to look for this address but still nothing...

On the plugin screen I have the "Inject File" filed set to the path of the HTML in C:\Overlays
AT is set to END of HEAD
Address is set to *
Its enabled.
Site root folder is set to C:\Overlays

I'm probably missing something obvious.. Any help appreciated! :)