AHAAAAAAA / mapbh

Visualizing Bahrain with old maps
https://mapbh.org
11 stars 0 forks source link

Dependencies fail to load navigating directly to non-base path #1

Closed AHAAAAAAA closed 2 years ago

AHAAAAAAA commented 3 years ago

Website works fine going to https://mapbh.org but not https://mapbh.org/en/map. Error given is leaflet.groupedcontrollayers failed to load

AHAAAAAAA commented 3 years ago

We load main.js before the groupedcontrollayer and side-by-side scripts which extend Leaflet classes. main.js immediately attempts to construct the map before the latter two scripts are loaded which results in missing functions. Possible solution is to bundle the 2 scripts into main.js with webpack (or cljs interop magic) and load them before we call the init-map function.