[ckan-dev] GeoJSON preview misses resources in non-debug mode

Philippe Duchesne pduchesne at gmail.com
Fri Jun 21 13:50:56 UTC 2013


Hello all,

i have had problems previewing geoJSON containing single points, as the
icon is not rendered in the browser.

After some debugging, it turns out that:

 - leaflet.js uses some regex to build icons URLs from the leaflet script
URL (see leaflet-src.js:3033 & 3039)

 - when in no-debug mode, fanstatic is configured to generate bundled
resources URLs (middleware.py:87), resulting in :
http://master.ckan.org/fanstatic/ckanext-spatial/:version:2013-06-20T14:07:36/
*:bundle:js*/vendor/leaflet/leaflet.js;js/geojson_preview.js

 - my guess is that the leaflet mechanism chokes on those bundled URLs and
produces wrong icon URLs :
http://master.ckan.org/fanstatic/ckanext-spatial/:version:2013-06-20T14:07:36/
*:bundle:js*/vendor/leaflet/images/marker-icon.png
(here i'm guessing that's what would happen on master.ckan.org)

I temporarily solved this by deactivating the bundling altogether ; don't
know if there's a way to force a specific script (here leaflet.js) to be
left out of the bundle.

--p.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130621/2b3ff8dd/attachment.html>


More information about the ckan-dev mailing list