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

  • SEARCH
  • Home
  • 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

How can I force a new layer added to the map in Leaflet to
I'm using leaflet js for maps and its default popups. I included the proper
I am using maps and backbone.js together. Map JS library used is Leaflet, but
How can I rotate a marker in leaflet? I will have a lot of
I am trying to build a map application using leaflet.js and I can not
Pretty simple question: How can I make the map markers in Leaflet clickable and
I'm using Leaflet to draw a map, within the popups I've added a link
I have started using leaflet as an open source map, http://leaflet.cloudmade.com/ The following jQuery
I am working with Leaflet for a map on my site. I want to
I want to create something like a leaflet/magazine using Latex. Is it possible to

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.