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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:53:45+00:00 2026-05-17T16:53:45+00:00

i created custom overlays using next link . how can i get a list

  • 0

i created custom overlays using next link.

how can i get a list of created overlays (or array, or whatever)?

i need it, because i need ability to close some of them.

  • 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-17T16:53:45+00:00Added an answer on May 17, 2026 at 4:53 pm

    You need to keep track of which overlays you created in an array and if you need to close some of them you can find them in the array and setMap(null) on them or another method that gets rid of them (close() in the example below). It is useful to create a custom id for your markers or overlays in your array so you can quickly locate them.

    Here is an example of closing a custom InfoBox from the Google Maps Utils Library

    <html> 
    <head> 
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> 
    <script src="http://google-maps-utility-library-v3.googlecode.com/svn/tags/infobox/1.1/src/infobox.js"></script> 
    <script type="text/javascript"> 
    
        //this is the array to store our custom objects in 
         ibArray = [];
    
        //standard stuff
        function initialize() {
    
            var secheltLoc = new google.maps.LatLng(49.47216, -123.76307);
    
            var myMapOptions = {
                 zoom: 15
                ,center: secheltLoc
                ,mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            var theMap = new google.maps.Map(document.getElementById("map_canvas"), myMapOptions);
    
    
            var marker = new google.maps.Marker({
              map: theMap
             ,position: new google.maps.LatLng(49.47216, -123.76307)
             ,visible: true
            });
    
            var boxText = document.createElement("div");
            boxText.style.cssText = "border: 1px solid black; margin-top: 8px; background: yellow; padding: 5px;";
            boxText.innerHTML = "City Hall, Sechelt<br>British Columbia<br>Canada";
    
            var myOptions = {
                 content: boxText
                ,disableAutoPan: false
                ,maxWidth: 0
                ,pixelOffset: new google.maps.Size(-140, 0)         
                ,zIndex: null
                ,boxStyle: { 
                  background: "url('tipbox.gif') no-repeat"
                  ,opacity: 0.75
                  ,width: "280px"
    
                 }
                ,closeBoxMargin: "10px 2px 2px 2px"
                ,closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif"
                ,infoBoxClearance: new google.maps.Size(1, 1)
                ,isHidden: false
                ,pane: "floatPane"
                ,enableEventPropagation: false
    
            };
    
            var ib = new InfoBox(myOptions);
    
            //store your info box in the array with a custom id - there are number of ways you can index this - it really depends on what you are doing
            //you will need to all your objects that you want to close later. 
            ibArray.push({myId:"1234",box: ib});        
    
            //open the box
            ib.open(theMap, marker);
        }
    
        //close the box with an id passed to this function
        function closeBox(id){
    
            for (i=0;i<ibArray.length;i++) {
                if (ibArray[i].myId==id){
                    myBox = ibArray[i].box;
                    myBox.close();
                }
            }
        }
    </script> 
    
    </head> 
    <body onload="initialize()"> 
        <div id="map_canvas" style="width:100%; height:50%"></div> 
        <p> 
        <input type="button" value="close box with custom id" onclick="javascript:closeBox('1234')">
    </body> 
    
    </html> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.