1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Winterthur, Switzerland
    Posts
    22
    Vote Rating
    1
    tschortsch is on a distinguished road

      0  

    Default Leaflet library breaks on production build

    Leaflet library breaks on production build


    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 3.0.0.250 the L variable gets overwritten by the compressed microloader in the index.html file.

    L variable in index.html:
    Code:
    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

    Code:
    //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!
    tschortsch

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Location
    Caracas
    Posts
    2
    Vote Rating
    0
    rbruno is on a distinguished road

      0  

    Default


    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?
    Last edited by rbruno; 31 Jan 2013 at 6:00 AM. Reason: add description

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Location
    Winterthur, Switzerland
    Posts
    22
    Vote Rating
    1
    tschortsch is on a distinguished road

      0  

    Default


    I didn't find a proper solution for this so far. I'm still using the workaround I posted above.

  4. #4
    Sencha Premium Member
    Join Date
    Apr 2008
    Posts
    251
    Vote Rating
    26
    themightychris will become famous soon enough themightychris will become famous soon enough

      0  

    Default


    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.

    https://github.com/JarvusInnovations.../LeafletMap.js
    Chief Architect @ Jarv.us Innovations
    Co-captain @ Code for Philly
    Co-founder @ Devnuts - Philadelphia Hackerspace

  5. #5
    Sencha User
    Join Date
    Nov 2011
    Location
    Winterthur, Switzerland
    Posts
    22
    Vote Rating
    1
    tschortsch is on a distinguished road

      0  

    Default


    Thanks for the reply. I updated my component with your code. See: https://github.com/tschortsch/Ext.ux...ses/tag/v1.2.0

Thread Participants: 2