Project

General

Profile

Problems using downloaded version of Leaflet

Added by Alexandra S almost 4 years ago

The provided leaflet example works fine on my computer with the hosted Leaflet. But I would like to use a downloaded version of Leaflet. So I tried modifying the example to do that. I placed all the downloaded Leaflet files in

examples/leaflet/leaflet and modified the wt_config.xml in examples/leaflet/approot like this

<server>
  <application-settings location="*">
    <properties>
      <property name="leafletJSURL">/leaflet/leaflet.js</property>
      <property name="leafletCSSURL">/leaflet/leaflet.css</property>
      <!-- <property name="leafletJSURL">https://unpkg.com/leaflet@1.5.1/dist/leaflet.js</property> -->
      <!-- <property name="leafletCSSURL">https://unpkg.com/leaflet@1.5.1/dist/leaflet.css</property> -->
    </properties>
  </application-settings>
</server>

I am in the examples/leaflet folder and start the example with

../../build/examples/leaflet/leaflet.wt --docroot ".;/resources" --http-listen 0.0.0.0:8080 --approot ./approot

But the map doesn't load while it loads fine with the unmodified wt_config.xml. What am I doing wrong?


Replies (2)

RE: Problems using downloaded version of Leaflet - Added by Roel Standaert almost 4 years ago

It looks like your issue isn't related to leaflet, but rather to your docroot argument. It's set to .;/resources, which means that any path that starts with something other than /resources will be interpreted as an internal path, and not as a static resource. You should add leaflet to your docroot argument: .;/resources,/leaflet.

RE: Problems using downloaded version of Leaflet - Added by Alexandra S almost 4 years ago

Thank you for answering so fast! That was the solution! And now I understand better what the docroot argument does :)

    (1-2/2)