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

using a non-default tile. #1319

Open
berlin2123 opened this issue Sep 3, 2024 · 0 comments
Open

using a non-default tile. #1319

berlin2123 opened this issue Sep 3, 2024 · 0 comments

Comments

@berlin2123
Copy link

berlin2123 commented Sep 3, 2024

Issue
In some countries or regions, *.openstreetmap.org is Blocked by ISP, which can prevent the map from loading.

Solution I am using in maps version 1.2.0
Just using anoter tile server, such as tile.openstreetmap.de, by changing the js file:

# Edit <nextcloud_path>/apps/maps/js/maps-main.js
# Change
......{id:"osm",name:"Street map",type:Mt,url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",......
# to
......{id:"osm",name:"Street map",type:Mt,url:"https://tile.openstreetmap.de/{z}/{x}/{y}.png",......

It works fine in 1.2.0 and nextcloud 27.

Issue in maps version 1.4.0
However after update to 1.4.0, this kind of edit js file no longer work, Refused by CSP in browser :

Refused to load the image 'https://tile.openstreetmap.de/2/1/1.png' because it violates the following Content Security Policy directive:

I tried to add tile.openstreetmap.de into csp by

# Edit <nextcloud_path>/apps/maps/lib/Controller/PublicPageController.php
# add a new line in line 217:
            $csp->addAllowedImageDomain('https://*.tile.openstreetmap.org');
            $csp->addAllowedImageDomain('https://tile.openstreetmap.de');                             # new added line
            $csp->addAllowedImageDomain('https://server.arcgisonline.com');

However it still not work.

Describe alternatives you've considered
Official support for custom tile servers

Additional context
Is it possible to fix the csp issue before the custom tile is officially supported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant