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

  • Home
  • SEARCH
  • 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 3324266
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:24:03+00:00 2026-05-17T23:24:03+00:00

have created a map that I’m trying to have function similar to ‘My Maps’.

  • 0

have created a map that I’m trying to have function similar to ‘My Maps’. I have two dropdownlists on the right side, based on the selection in those ddl’s, you can add a custom marker / icon. You select a marker type, then click the ‘+’ button in the top right corner of the map, and then click where you want the marker added. My issue is, this works fine in IE, Safari, and Chrome, but not in firefox. The click event doesn’t seem to fire.

Here is the location of the map : https://ait.saultcollege.ca/Michael.Armstrong/Index.html

The button to add the marker in the top right has an onclick event pointing to my ‘placeMarker()’ function. Here is the code for placeMarker(), createMarker() …

function placeMarker() {

    select("placeMarker");

    var infowindow = new google.maps.InfoWindow({}); 
    var catID = document.getElementById('category');
    var typeID = document.getElementById('ddlType');
    var category = catID.options[catID.selectedIndex].value;
    var markerType = typeID.options[typeID.selectedIndex].value;

    if (!markerType) {
        alert("You must select an icon type.");
    } 
    else {
        var moveListener = google.maps.event.addListener(customMap, 'mousemove', function(event) {
            if (mapMarker) {
                mapMarker.setPosition(event.latLng);
            } else {
                mapMarker = createMarker(event.latLng, "test", markerType, "test");
            }
        });

        var clickListener = google.maps.event.addListener(customMap, 'click', function(event) {
            if (mapMarker) {
                select("hand_b");
                google.maps.event.clearListeners(customMap, 'mousemove');
                google.maps.event.removeListener(listener);
                mapMarker = createMarker(event.latLng, "test2", markerType, "test");

                var htmlInfo = "" +
                    "Category:" + category + "" +
                    "Item:" + markerType + "" +
                    "Notes:" +
                    "Location:" + mapMarker.getPosition().toString() + "" +
                    "" +
                    "";

                //infowindow.setContent(htmlInfo);
                //infowindow.open(customMap, mapMarker);
            }
        });
    }
}

function createMarker(latlng, title, icon, html) {
    var mapMarker = new google.maps.Marker({
        position: latlng,
        map: customMap,
        title: title,
        icon: 'Images/' + icon + '.png'
    });
    return mapMarker;
}

function select(buttonId) {
    document.getElementById("hand_b").className = "unselected";
    document.getElementById("placeMarker").className = "unselected";
    document.getElementById(buttonId).className = "selected";
}

Any help or suggestions would be awesome. Could this perhaps be a bug in ff?

  • 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-17T23:24:04+00:00Added an answer on May 17, 2026 at 11:24 pm

    I did something very similar for an open-source disaster software package. In this case, lets assume I selected "Fire" in my dropdown menu and this triggers addFire(). The listener on the markers will delete the point on a click or allow you to drag it. The map can only have one listener at a time, but each marker can still have its own listener at the same time.

    Here is the code that worked on Chrome, Firefox and IE8:

    //This function sets up the map for adding a fire icon
    function addFire() {
     //Kill old listener
     if(listening)
      google.maps.event.removeListener(listenerhandle);
     
     //Start new listener
     listenerhandle = google.maps.event.addListener(disasterMap, 'click', addFirePoint);
     listening = true;
    }//end addFire
    
    //This function adds new fire points to the map and controls dragging and clicking
    function addFirePoint(event) {
     //Create the marker
     var fireMarker = new google.maps.Marker({
      icon: "./mapimgs/fire.png", position: event.latLng, map: disasterMap, draggable: true });
     
     newFireMarkers.push(fireMarker);
     fireMarker.setTitle("Fire");
     
     //Listen for clicks on the new marker
     google.maps.event.addListener(fireMarker, 'click', function() {
          fireMarker.setMap(null);
       //remove the marker from the array
       for(i=0;i<newFireMarkers.length;i++) {
        if(fireMarker.getPosition() == newFireMarkers[i].getPosition()) {
         newFireMarkers.splice(i,1);
         break;
        }
       }
      }
     ); //end click listener
    }//end addFirePoint
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a system that automatically registers function objects (functors) into a map
I have created a map marker that is positioned on my map by finding
So, I have created many map applications before, but the one that I am
I am trying to display the map i have created using the Iterator. The
I have created a simple map app that shows the local garage sales in
I have created one class that directly map to ConfigSection of web. config. My
I have created a function that loops through a set of returned JSON. I
I hope someone can help with this. I have created a map app that
I have created a google map located at: http://calwestcultural.com/sgs/example_map.html I am trying to link
I have created an application that allows users to capture information for entities based

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.