When using OpenLayers.js slim version locally found here https://github.com/developmentseed/openlayers_slim/blob/master/OpenLayer...
My map loads correctly in preset edition, but not with views, according to firebug the openlayers.js is correctly loaded.
When using OpenLayers.js regular 2.11 version I have no problem.
I woud like to use the slimmed one, to reduce my page loading and use headjs module to parallel my javascript.
When using headjs with OpenLayers 2.11, the map is not loading. According this issue, it seems related to the weight of OpenLayers.js, things i could easily understand around 900K !
Any idea ?
Comments
Comment #1
heyyo CreditAttribution: heyyo commentedAfter other testing, it seems that OSM is working correctly with slim version but Google Map.
Comment #2
nod_not a bug. check out OL docs at build profiles.
Comment #3
heyyo CreditAttribution: heyyo commentedI successfully created a lighter custom build. But it still doesn't load my map if headjs is enabled.
my Openlayers.js is now around 375KB unzipped, really better than more 900KB...But not sure if the weight is the cause of this bug.
Anyone succeeded to use OpenLayers and headjs at the same time ?
Comment #4
nod_I believe it's a core thing. Drupal's JS is pretty terrible.
Drupal.js execute behaviors on dom ready, openlayers.js declare a behavior that needs OL.js to be loaded to run. But i believe you load OL.js with headjs and it's not loaded before dom ready. So you load everything (including drupal.js) with headjs and hope it runs or you're pretty much screwed and you can't use headjs to load OL.js.
Comment #5
heyyo CreditAttribution: heyyo commentedThanks for you fast answer, but it seems that it won't help me so much :-(
My website:
http://guides-israel.com/fr/visiter/sud
If you have any idea to make it load faster...
Comment #6
ken-g CreditAttribution: ken-g as a volunteer and commented