Coder Social home page Coder Social logo

Comments (3)

skuderos avatar skuderos commented on June 16, 2024

After some more testing, I am getting a bit closer as to why it suddenly stops working over https. As I mentioned in the previous comment, serving the tiles over http works without any issues. When trying to load my map over https I for some reason keep getting 404 responses to any tile request. I decided to open the console and have a look at each individual tile request. What I noticed is that the z/x/y coordinates that are being requested do not match up to the ones that are requested over http. When I copy the url for a specific tile that works in the http version (for example, .../ehaa_256/11/1056/673.png) and then load that over the https version, I get the correct image of the correct tile. When checking the request that gets sent out from the HTTPS version, I notice that the x and y values are often significantly higher than I would expect them to be on that particular section of map (for example, .../ehaa_256/13/4234/2695.png). This set of coordinates does not make sense, and I imagine this is the reason for my troubles.

This means there is no problem with data not being presented properly over https or something along those lines. What I now need to figure out is why the https request changes the coordinates that tiles are being requested for.

from tilehut.

skuderos avatar skuderos commented on June 16, 2024

I have found the solution! In retrospect, it was pretty simple and had nothing to do with the coordinates...

All I needed to do was set the response header for tilehut to state access-control-allow-origin, anonymous. (res.header('Access-Control-Allow-Origin', 'anonymous');)

from tilehut.

b-g avatar b-g commented on June 16, 2024

Hi @skuderos, sorry for the slow response! Very busy here with the start of the semester ... Glad that you figured it out! Congrats! Could you share the exact lines in case someone else has trouble with the same issue? I guess it is here, or?

tilehut/server.js

Lines 46 to 51 in 377330b

app.use('*', function(req, res, next) {
// set CORS response header
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'X-Requested-With');
next();
});

from tilehut.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.