Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:17:34+00:00 2026-06-14T18:17:34+00:00

I am trying to integrate Sencha 4.1 (ExtJS) with the Leaflet mapping library while

  • 0

I am trying to integrate Sencha 4.1 (ExtJS) with the Leaflet mapping library while using Sencha Architect.

When the page loads, the tiles are mixed up and appear offset. I need to drag the page up to be able to see the tiles.

The full project is available here: https://github.com/breizo/SenchaLeaflet.

Here is an excerpt of the custom component created (see full code here: https://github.com/breizo/SenchaLeaflet/blob/master/ux/LeafletMap.js).

constructor: function () {
    this.callParent(arguments);
    this.on({
        resize: 'doResize',
        scope: this
    });
    var ll = window.L;
    if (!ll) {
        this.setHtml('Leaflet library is required');
    }
}

 onRender: function() {
    this.callParent(arguments); 
    var renderTo = arguments[0].dom.id;
    debugger;
    var me = this,
        ll = window.L,
        element = me.mapContainer,
        mapOptions = me.getMapOptions(),
        map,
        tileLayer;


    if (ll) {
        // if no center property is given -> use default position
        if (!mapOptions.hasOwnProperty('center') || !(mapOptions.center instanceof ll.LatLng)) {
            mapOptions.center = new ll.LatLng(47.36865, 8.539183); // default: Zuerich
        }

        me.setTileLayer(new ll.TileLayer(me.getTileLayerUrl(), me.getTileLayerOptions()));
        tileLayer = me.getTileLayer();
        mapOptions.layers = [tileLayer];

        me.setMap(new ll.Map(renderTo, mapOptions));
        map = me.getMap();

        // track map events
        map.on('zoomend', me.onZoomEnd, me);
        map.on('movestart', me.onMoveStart, me);
        map.on('moveend', me.onMoveEnd, me);
        me.fireEvent('maprender', me, map, tileLayer);
    }
},

When debugging it appears that when onRender is called, the parent container of the map is not properly sized yet, in particular its height is only enough to contain the attrib text, about 16 pix. WHen the doResize is called, the container is properly sized, but it doesn’t change the end result: the tiles are mixed up and offset.

I tried various changes to the container, but nothing worked…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:17:35+00:00Added an answer on June 14, 2026 at 6:17 pm

    1) Problem with mixed layers is caused by CSS. Your leaflet.css has wrong path in html, so it’s not attached in the document. To fix mixing issue set correct path to css file, or attach it from CDN:

    <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4/leaflet.css" />
    

    2) Wrong map offset is caused by extjs generated div:

    <div class="x-llmap x-fit-item x-llmap-default" ...></div>
    

    It pushes map container to the bottom and wrong offset calculations are made. You can also fix this using inline style or CSS:

    .leaflet-map-pane {
        top: 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to integrate passport into my nodejs server using connect, but can't seem
I'm trying to integrate bean validation using hibernate validator to my web application :
While trying to integrate Yahoo Media Player into my own website, I want to
We are trying to integrate tests in our daily builds using TestComplete, so far
I am trying to integrate facebook with in my asp.net mvc web application using
I'm trying to integrate dropbox into my BB Playbook app using adobe air in
Im trying to integrate my PHPUnit tests into Hudson using the xUnit plugin. After
I'm trying to integrate a Facebook send button into my site using Facebook app.
I am trying to integrate Dust with node.js. I am using Express as node.js
I'm trying to integrate SVN with BugTracker.NET. On the page that accesses SVN I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.