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 7844943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:03:42+00:00 2026-06-02T17:03:42+00:00

Leaflet is rendering because I can see all of its elements in the DOM,

  • 0

Leaflet is rendering because I can see all of its elements in the DOM, but nothing else comes to life. All I see is gray.

The only way I can get map tiles to appear is if I delete the position:absolute on the map container, but that creates a bunch of jumbled map tiles. I checked the GIT history to see if I accidentally changed a style, but no luck.

Here’s the code initializing the map:

// init everything on page show
$("#map").live('pageshow',function() {
    if(window.localStorage.getItem("lat")!=undefined) { var lat = window.localStorage.getItem("lat")} else { var lat = '49.264'; }
    if(window.localStorage.getItem("lng")!=undefined) { var lng = window.localStorage.getItem("lng")} else { var lng = '-123.123'; }
    try {         
        var map = window.map
        map = new L.Map('map-container');
        var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/006282296d334e66a593e55aca6b5ce0/54803/256/{z}/{x}/{y}.png';
        var cloudmadeAttribution = 'Map Data © 2011 OpenStreetMap';
        var cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
        map.setView(new L.LatLng(lat, lng), 12).addLayer(cloudmade);
        map.invalidateSize();
    } catch(e) {console.log(e)}
    userMarkers[1] = new L.Marker( new L.LatLng( lat,lng ) , {icon: new iconUser, clickable: true} );
    map.addLayer( userMarkers[1] );
});

The environment includes jQuery mobile. Unfortunately, the console does not log any errors and the localStorage above indeed holds valid LatLng values when I inspect it.

A screenshot:
screenshot

Any guesses?

  • 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-02T17:03:43+00:00Added an answer on June 2, 2026 at 5:03 pm

    I’m not sure how the problem started, but to fix it I went and erased all map container styles and then declared:

    #map-container {
        position:absolute;
        top:0;
        bottom:0;
        left:0;
        right:0;
        margin: 0;
        padding: 0;
    }
    

    And now the problem is fixed. I’ve never used such styling before so I cannot speculate on how the problem started.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build a map application using leaflet.js and I can not
In the Leaflet JS library, it says: Pans the map to a given center.
Here's my code. It tries to load Leaflet library. When I turn crossDomain option
Using the following code to add json points to a map using Leaflet. var
I am working on a course leaflet system for the college I work at,
I have an accordion menu working on the page, but when I click one
I have been asked to setup a course leaflet system for a college. For
Can anyone suggest how I can access then animate the red polyline here using
What exactly does a layer represent in the Leaflet Mapping Library ? Conceptually, to
Just started using Sencha Touch 2 and need to integrate the Leaflet plugin https://github.com/VinylFox/Ext.ux.touch.Leaflet/tree/master/src

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.