View Full Version : Leaflet library breaks on production build

18 Nov 2012, 4:49 AM
Hello everyone

I'm trying to build my Sencha Touch application which is using the Leaflet Library (http://leafletjs.com/). As soon as I'm doing a production build with Sencha Cmd the L variable gets overwritten by the compressed microloader in the index.html file.

L variable in index.html:

function L(a,b){var c=k.createElement("iframe");m.push({iframe:c,callback:b});c.src=a+".html";c.style.cssText=

When I manually disable the ClosureCompressor in the [SenchaCmd]/plugins/touch/current/app-build.js file on line 355

//compressor = new ClosureCompressor();

the microloader doesn't get compressed and my app works again.

Is there a way to tell the compressor not to use the L variable?

Thanks in advance!

31 Jan 2013, 5:55 AM
I use SenchaTouch 2.1 and leaflet 0.4, I did this and my app not run.

What happened with this problems, the microloader still overwrite the leaflet instance in production build?

31 Jan 2013, 6:13 AM
I didn't find a proper solution for this so far. I'm still using the workaround I posted above.

23 Sep 2013, 8:46 AM
Also ran into this problem, this fork of Juerg Hunziker's component from the Sencha Market works correctly in production builds by strictly using window.L to access leaflet rather than L alone.


28 Sep 2013, 6:58 AM
Thanks for the reply. I updated my component with your code. See: https://github.com/tschortsch/Ext.ux.LeafletMap/releases/tag/v1.2.0