• Hei
    I have some sides where I want to show GPX-tracks in maps and gives people the opportunity to download it. When I change to https the tracks stop showing in the maps. The downloadsfiles still works.

    Here is the code i have on the side: [leaflet-gpx src=https://www.nutafant.no/wp-content/uploads/2020/05/Lierfjell.gpx color=Red]

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor hupe13

    (@hupe13)

    CORS is blocking the request. Please open the Developer Console.

    Translated:

    Cross-source request blocked: The same source rule prohibits reading the external resource at https://usercontent.one/wp/www.nutafant.no/wp-content/uploads/2020/05/Lierfjell. gpx. (Reason: CORS header 'Access-Control-Allow-Origin' is missing).
    
    Thread Starter nutafant

    (@nutafant)

    I have contacted my server provider and they have check. They send me this overview.

    SetEnvIf Origin “^(|https://www\.nutafant\.no/|https://www\.usecontent\.one/)$” CORS=$0
    </IfModule>
    Header set Access-Control-Allow-Origin %{CORS}e env=CORS
    Header append Vary “Origin” env=CORS
    Header set Access-Control-Allow-Credentials “true” env=CORS
    Header set Access-Control-Allow-Methods “*” env=CORS
    Header set Access-Control-Allow-Headers “*” env=CORS
    Header set Access-Control-Expose-Headers “*” env=CORS

    What is wrong with this, when i can download the files from the pages, but i can’t show the same file in Leaflet-maps on det same page?

    Plugin Author bozdoz

    (@bozdoz)

    Doesn’t look like the headers are being set properly. @hupe13 is right. Still getting CORS issues. No ‘Access-Control-Allow-Origin’ header present. Somehow they are not setting the headers properly

    Thread Starter nutafant

    (@nutafant)

    Do you have any idees about whats wrong?

    Plugin Contributor hupe13

    (@hupe13)

    https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin

    The Firefox addon https://addons.mozilla.org/en-US/firefox/addon/laboratory-by-mozilla/ helps to generate a proper Content Security Policy (CSP) header for your website.
    Among other things it generates the rule
    connect-src https://usercontent.one/wp/www.nutafant.no/wp-content/uploads/2020/05/Lierfjell.gpx;

    If you don’t have access to .htaccess, your provider should change this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘GPX-track dosn’t show in map’ is closed to new replies.