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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:29:44+00:00 2026-06-13T14:29:44+00:00

I have a web app with a map in it. I’ve added a nice

  • 0

I have a web app with a map in it. I’ve added a nice little custom map control to turn on and off different layers on the map. Currently there are only two layers, and it all works nice and fine in most browsers.

Except for IE8+7. None of the layers are showing on the map when turned on. As far as I can tell the map is loading the kmz/kml files (when preserveViewport is set to false, the map moves to the right location) but they’re just not appearing. One layer contains polylines, and the other contains markers. The code I use is below:

function someFunction() {
    //code to initialise map etc goes here...
    var layers = [];

    //Create 1st layer
    var exchangeslayer = new google.maps.KmlLayer('http://link.to.file/exchanges.kmz'
        suppressInfoWindows: true,
        preserveViewport: true
    });
    layers.push({name: "Exchanges", layer: exchangeslayer});

    //Code to create second layer
    var nyclayer = new google.maps.KmlLayer('http://www.nyc.gov/html/dot/downloads/misc/cityracks.kml'
        suppressInfoWindows: true,
        preserveViewport: false
    });
    layers.push({name: "NY City Tracks", layer: nyclayer});

    addCustomLayerControls(layers);
}

function addCustomLayerControls(layers) {
    //there is code here that would generate the divs for the custom map control
    var container; //container is a div element created via javascript

    for (var i = 0; i < layers.length; i++) {
        this.addLayerLabelToContainer(layers[i], container);
    }

    //some more code
}

function addLayerLabelToContainer(layer, container) {
    var map; //Assume I get a reference to the map

    //some code here to make pretty labels for the map controls...
    var layerLabel; // layerLabel is a div element created via javascript

    google.maps.event.addDomListener(layerLabel, 'click', function() {
        if(layer.layer.map == null) {
            layer.layer.setMap(map);
        } else {
            layer.layer.setMap(null);
        }
    });
}
  • 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-13T14:29:45+00:00Added an answer on June 13, 2026 at 2:29 pm

    So as it turns out my problem related to CSS. One of my stylesheets was applying max-width: 100% to all img tags. This was playing havok with the map markers/polylines.

    Its obvious now that I see it, but when you think the problem is to do with the javascript its not so obvious. As such, I’ll leave this answer here for anyone else who makes the same mistake as me.

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

Sidebar

Related Questions

I have an intranet web app that uses CSS httpFolder to map a webdav
I have a GWT web-app with a nearly full page Google map window. Inside
I am currently developing a web app that uses Google's Static Map API, in
I'm creating a little web app where people can choose colors for different parts
I have developed MVC web app. Now, I want to use custom form authentication
I currently have a web app that uses the google maps API, PHP, and
I have a web-app with a Java back-end that uses Tomcat jdbc-pool for database
I have a web app that runs fine in Visual web developer. But when
I have a web app built with Dojo 1.7.2, using RequireJS to load individual
I have another web app, that uses the liferay user database. But before a

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.