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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:39:32+00:00 2026-05-19T02:39:32+00:00

The final goal is to display a few kml overlays on one map and

  • 0

The final goal is to display a few kml overlays on one map and set the transparency value by clicking on a control button for each kml layer (depending on how much layers there are).

My first idea was changing opacity/transparency directly by the div layer.. but I can’t find any way to address the div where the kml layer is shown in the map.

Does someone know a way to address the div where the KML is inserted by the KmlLayer(..)?

Now I’m trying to find a way to do it via the KmlLayer Object..
but so far no luck either..

Any ideas how to handle this?

The Code is:

(function() {
  window.onload = function(){

  var myLatlng = new google.maps.LatLng(48.1497, 11.5795);
  var myOptions = {
  zoom: 10,
  center: myLatlng,
  mapTypeId: google.maps.MapTypeId.ROADMAP
}

var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

var georssLayer = new google.maps.KmlLayer('somemap.kml',({'suppressInfoWindows': true}));
georssLayer.setMap(map);
}
})();
  • 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-05-19T02:39:32+00:00Added an answer on May 19, 2026 at 2:39 am

    To the best of my knowledge it is not possible via standard google api but you can do this using jquery or some other library. KML images are just part of the DOM so if you can find the nodes you can manipulate their properties.
    If you have multiple KML files you will probably need to name your images so that the name reflects which KML image belongs to. so if you have KML1 prepend KML1 to all your image names in that KML and search for that string using jQuery selector.

    Here is an example using jquery which targets all images (for searches on substrings see http://api.jquery.com/attribute-contains-selector/):

        <!DOCTYPE html> 
        <html> 
        <head> 
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> 
        <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
        <title>Google Maps JavaScript API v3 Example: KmlLayer KML</title> 
        <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
        <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> 
        <script type="text/javascript"> 
        $(document).ready(function(){
        $(".b_opacity").click(function(){
    //this will find all the images in the map canvas container. Normally you would want to target specific images by the value of src
        $("#map_canvas").find("img").css("opacity","0.4")
    
        })
        })
    
    
        function initialize() {
          var chicago = new google.maps.LatLng(41.875696,-87.624207);
          var myOptions = {
            zoom: 11,
            center: chicago,
            mapTypeId: google.maps.MapTypeId.ROADMAP
          }
    
          var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    
          var ctaLayer = new google.maps.KmlLayer('http://code.google.com/apis/kml/documentation/KML_Samples.kml');
          ctaLayer.setMap(map);
        }
        </script> 
        </head> 
        <body onload="initialize()"> 
    
          <div id="map_canvas" style="width: 600px;height: 600px;"></div> 
          <input type="button" value="dim the lights" class="b_opacity">
        </body> 
        </html>
    

    NOTE: please bear in mind that the css property opacity does not work in IE you have to use filter:alpha(opacity=40) for IE or you can use jQuery .fade() method.

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

Sidebar

Related Questions

Final goal: Have a few java objects sharing the same base class persisted into
My final goal is to write the program which can run on the Unix
I want to extract kernel symbols from a u-boot image The final goal is
My final goal is to write a simple program for myself. It should periodically
Lets begin with the final goal - I need to able to paste a
I'm getting close to my final goal, which is to generate a nice graph
My goal is to display a family tree starting from Person X and showing
Original goal: I have a TreeMenu that i use to display my Menu. In
My final goal of my plugin project is to let an image be uploaded
I'm trying to make a progressbar advance using a BackgroundWorker . The final goal

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.