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

Toby Dacre toby.okfn at gmail.com
Mon Jun 24 08:56:58 UTC 2013


On 21 June 2013 14:50, Philippe Duchesne <pduchesne at gmail.com> wrote:
> 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.

dont_bundle would do this http://docs.ckan.org/en/latest/resources.html#main


>
> --p.
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>



-- 
Toby Dacre

The Open Knowledge Foundation

Empowering through Open Knowledge
http://okfn.org/  |  @okfn




More information about the ckan-dev mailing list