Skip to content

OpenLayers zoom control icons not loading for subpages #1465

@jpatokal

Description

@jpatokal

If you browse to a subpage like https://openflights.org/airport/SIN or https://openflights.org/user/jpatokal, the images for the OpenLayers controls don't load properly:

image

The paths appear to be hardcoded into js/OpenLayers.js as relative paths (img/north-mini.png etc), so it's trying to load things like https://openflights.org/airport/img/zoom-minus-mini.png and failing.

Possible solutions: we can either add redirects/rewrites to img for each of user/img, trip/img, airport/img, and airline/img, or hack the minified JS to make the paths absolute.

I spent some time trying to hack this into the nginx config, but this is not working for reasons I don't understand. Fixes or better ideas?

    location ~ \.png$ {
      rewrite "^/(.+)/img/(.+)$" /img/$2 break;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions