App.accessRule and openstreetmap


#1

Hey,

iam trying to allow my mobile app to load images from openstreetmap
i added this to my mobile-config.js

App.accessRule('*openstreetmap.*', { external: true });

but it is still not working what iam doing wrong?


#2

I think it should be *://www.openstreetmap.org/* or similar? The rule is not a random glob expression, refer to Cordova documentation to see what works for you. https://cordova.apache.org/docs/en/4.0.0/guide_appdev_whitelist_index.md.html


#3

the problem is that openstreetmap is loadinf rom different sub domains and different top level domains.

for example:

a.openstreetmap.fr/some.png

b.openstreetmap.org/someDiff.png

but i will look into the cordova guide


#4

Have you tried with

App.accessRule('http://*.openstreetmap.*', { external: true });

?


#5

The issue seems to be that there is not a single subdomain, but the rabbit hole goes deeper :wink:

This works for me on iOS:

 App.accessRule('*://*.tile.openstreetmap.org');

This is in combination with the corresponding tile URL in the following format:

var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';

How and where do you define the tile URL? Or is it entirely dynamic?