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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:34:07+00:00 2026-06-10T01:34:07+00:00

Learning how Google Maps APIv3 works, I use an example to shoy and hide

  • 0

Learning how Google Maps APIv3 works, I use an example to shoy and hide markers on the map (https://developers.google.com/maps/documentation/javascript/examples/overlay-remove), so I try to add the draggable property, but on IExplorer 9, when the marker is moved to an other place, it generate an other marker behind, and I don’t want it, some ideas of whats happening?

<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
    <style type="text/css">  
      html { height: 100% }  
      body { height: 100%; margin: 0px; padding: 0px }  
      #map_canvas { height: 100% }
    </style>
    <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
    <script>
      var map;
      var markers = [];

      function initialize() {
        var haightAshbury = new google.maps.LatLng(23.886419417295673, -101.86367187500001);
        var mapOptions = {
          zoom: 5,
          center: haightAshbury,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        map = new google.maps.Map(document.getElementById('map-canvas'),
            mapOptions);

        google.maps.event.addListener(map, 'click', function(event) {
          addMarker(event.latLng);
        });
      }
      // Add a marker to the map and push to the array.
      function addMarker(location) {
        marker = new google.maps.Marker({
          'position': location,
          'draggable':true,     ////// HERE /////
          map: map
        });
        markers.push(marker);
        }

      // Sets the map on all markers in the array.
      function setAllMap(map) {
        for (var i = 0; i < markers.length; i++) {
          markers[i].setMap(map);
        }
      }

      // Removes the overlays from the map, but keeps them in the array.
      function clearOverlays() {
        setAllMap(null);
      }

      // Shows any overlays currently in the array.
      function showOverlays() {
        setAllMap(map);
      }

      // Deletes all markers in the array by removing references to them.
      function deleteOverlays() {
        clearOverlays();
        markers = [];
      }

      google.maps.event.addDomListener(window, 'load', initialize);
    </script>
  </head>
  <body>
    <div id="map-canvas" style="width:100%; height:100%"></div>
  </body>
</html>
  • 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-10T01:34:08+00:00Added an answer on June 10, 2026 at 1:34 am

    thanks for the interest, I copied the entire code into a new file and works, I guess there was something odd at the original file.

    maybe the problem was with the key I have been using, I changed it and everything works better.

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

Sidebar

Related Questions

I am learning GWT, so I am following this tutorial from Google GWT https://developers.google.com/web-toolkit/tools/gwtdesigner/tutorials/stockwatcher
I'm learning the Google Maps API and I was wondering whether I can use
I am starting with google maps. just learning. while ago, it was working. now
As part of my learning, i am developing a google maps V3 application, to
I´ve just started learning GWT and I´m trying to implement http://gwt.google.com/samples/Showcase/Showcase.html#!CwFileUpload and but failing
I'm learning dhtml using google's sample http://code.google.com/edu/ajax/tutorials/samples/dhtmltest.html however, when i add below doctype dtd
I'm learning Objective-C using GNUstep, but i searched at Google for some example of
I am learning how to use Google App Engine / Python. (webapp) I am
I am learning jinja2 because Google App Engine recommends it. I found this example
Using eclispe Helios with Google app plugin. I am learning to use google app

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.