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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:26:50+00:00 2026-06-03T03:26:50+00:00

I tried to implement this code (http://stackoverflow.com/questions/10318316/how-to-hide-or-display-a-google-maps-layer/) on my page, to put the weather/clouds

  • 0

I tried to implement this code (http://stackoverflow.com/questions/10318316/how-to-hide-or-display-a-google-maps-layer/) on my page, to put the weather/clouds on/off my map,
but somehow it interferes with my current code. I tried the two options that were presented in the above link already, but perhaps I did something wrong, or it interferes with the Fusion Tables selections that are already in my map?

Could someone please help me with the right snippet of code?
My page is here http://www.strahlen.org/map/mapplusweather.htm.
The (de)select buttons are already in the bottom right corner.

Thanks in advance,
Frank

ps: although an admin deleted your posting, thanks to Alexander Farber for your previous help!

ps 2: I of course have the weather layer working, see http://www.strahlen.org/map/mapweather.htm, but I cannot toggle it on/off

* final edit *
to prevent link-rot: I used the code here in my “production-version” now -> http://www.strahlen.org/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-06-03T03:26:54+00:00Added an answer on June 3, 2026 at 3:26 am

    I’ve taken a look at your site and I believe you just have to make some basic changes to your existing code. First, add two new vars within you initialize() function:

    function initialize() {
        var tableId = 3167783;
        var cloudDisplayIsOn = false;
        var weatherDisplayIsOn = false;
    

    Then, in your existing cloud click listener code, make these changes:

    google.maps.event.addDomListener(document.getElementById('cloud'),
        'click', function() {
            if ( cloudDisplayIsOn ) {
                cloudLayer.setMap( null );
                cloudDisplayIsOn = false;
            }
            else {              
                cloudLayer.setMap( map );
                cloudDisplayIsOn = true;
            }
        });
    

    And finally, in your existing weather click listener code, make very similar changes:

    google.maps.event.addDomListener(document.getElementById('weather'),
        'click', function() {
            if ( weatherDisplayIsOn ) {
                weatherLayer.setMap( null );
                weatherDisplayIsOn = false;
            }
            else {
                weatherLayer.setMap( map );
                weatherDisplayIsOn = true;
            }
        });
    

    Now you may have to do a little minor debugging, but I believe this will add the display on/off code for the cloudLayer and the weatherLayer that you need.

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

Sidebar

Related Questions

I have tried to implement this jQuery active menu code: http://docs.jquery.com/Tutorials:Auto-Selecting_Navigation $(function(){ var path
I tried to implement FizzBuzz in DCPU-16. I use this web emulator: http://mappum.github.com/DCPU-16/ (repository:
Trying to implement this gallery on my website. http://coffeescripter.com/code/ad-gallery/ It is noted in the
I am using instructions provided at http://code.google.com/appengine/articles/openid.html to enable Federated Authentication in App Engine.
I tried to implement this captcha http://www.dracon.biz/captcha.php to a script But It seems really
See Code: http://jsbin.com/amavud/2 Problem: In browsers which implement requestAnimationFrame, when tab with animation is
I tried to implement a small authentication via http and copied this bit of
Ok, So I have tried to implement a coverflow found on codeplex http://silverlightcoverflow.codeplex.com/ I
I want to do something like this: I tried to implement it by myself
I have tried to implement css sticky footer on my page but it doesn't

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.