Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for OpenAIP #231

Closed

Conversation

starnutoditopo
Copy link
Contributor

@starnutoditopo starnutoditopo commented Dec 16, 2023

This pull request adds support for OpenAIP (aviation maps).

Note that in configure.ac an API key should be provided (as for Thunderforest); look at line 599:

[VIK_CONFIG_OPENAIP_KEY="\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\""]) // <- Replace XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX with your API key

(as for the Thunderforest maps, it would be great if the project's owners can supply a default API key)

Support is provided to let the user set it at compile time, using the .configure script with the --with-openaip_apikey flag:

./configure --with-openaip_apikey=<OpenAIP API key>

This is an example showing the OpenAIP layer over OpenTopoMap (OpenAIP provides alpha channel):

image

(my personal API key has been used for the example above)

@rnorris
Copy link
Collaborator

rnorris commented Dec 18, 2023

Thank you for your continued interest in Viking, but I think I will decline to include this pull request for a few reasons:

  • As is, it will include a Map menu entry that won't work until someone (me?) provides an API key for Viking Project use.
  • I presume most users don't compile from source and use a pre-built distribution version (inc. Windows).
  • I feel that OpenAIP is a slightly special interest and thus not quite the right fit for inclusion in the default list of generic built in maps. (Thunderforest \ Cycle maps have had a long association with OSM). But could be persuaded...
  • I won't be averse for just adding a single map instance into osm.c - rather than creating a new openaip.c;
    • As then at some later date perhaps could spin off a new file e.g. something like misc-sources.c for non OSM maps (and other data-source tools).
  • The API key method (as used in the Thunderforest version is some what of a hack) - and I don't think many (if indeed anyone) actually does go to the bother of defining their own keys via the configure method. But of course does give it the flexibility at the expensive of making the build system more complex.

ATM Probably much simpler to just add something like this to your maps.xml file (creating it if necessary):

<objects>
    <object class="VikSlippyMapSource">
        <property name="id">928</property>
        <property name="name">OpenAIP</property>
        <property name="label">OpenAIP</property>
        <property name="url">https://api.tiles.openaip.net/api/data/openaip/%d/%d/%d.png?apiKey=YOUR_KEY_HERE</property>
        <property name="file-extension">.png</property>
        <property name="follow-location">4</property>
        <property name="zoom-min">4</property>
        <property name="zoom-max">14</property>
        <property name="copyright">© OpenStreetMap contributors</property>
        <property name="license">CC BY-NC 4.0</property>
        <property name="license-url">https://creativecommons.org/licenses/by-nc/4.0/</property>
        <property name="check-file-server-time">TRUE</property>
    </object>
</objects>

@starnutoditopo
Copy link
Contributor Author

starnutoditopo commented Dec 20, 2023 via email

@rnorris rnorris closed this Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants