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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:57:47+00:00 2026-05-23T20:57:47+00:00

I am using a google map with markers and I have a search form

  • 0

I am using a google map with markers and I have a search form above the map. I am trying to get onchange to update the GDownloadUrl() , thus narrowing the markers that load on the page.

Here is what I have tried:

<script type="text/javascript">
            function load() {
                if (GBrowserIsCompatible()) {
                    var map = new GMap2(document.getElementById("map"));
                    map.addControl(new GSmallMapControl());
                    map.addControl(new GMapTypeControl());
                    map.setCenter(new GLatLng(38.85682, -96.943359), 4);
                    var selector = document.getElementById("sport");
var url = "url here ?sport="+selector.options[selector.selectedIndex].value+"";
                    GDownloadUrl(url, function(data) {
                        var xml = GXml.parse(data);
                        var markers = xml.documentElement.getElementsByTagName("marker");
                        for (var i = 0; i < markers.length; i++) {
                            var name = markers[i].getAttribute("name");
                            var address = markers[i].getAttribute("address");
                            var type = markers[i].getAttribute("type");
                            var title = markers[i].getAttribute("title");
                            var id = markers[i].getAttribute("id");
                            var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                            parseFloat(markers[i].getAttribute("lng")));
                            var marker = createMarker(point, name, address, type, title, id);
                            map.addOverlay(marker);
                        }
                    });
                }
            }
            </script> 

Link to page: http://michaelstevens.dyndns.org/athletenation/index.php?option=com_athletenation&view=Events&Itemid=3

  • 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-23T20:57:48+00:00Added an answer on May 23, 2026 at 8:57 pm

    I figured it out, it was pretty easy once I took a step back and thought about what I was trying to do:

    function changeme(){
    
      var map; //clears current icons
    
    //get the value of each input:
    var e = document.getElementById("sport");
    var strUser = e.options[e.selectedIndex].value;
    
    var event = document.getElementById("event");
    var strUserevent = event.options[event.selectedIndex].value;
    
    var price = document.getElementById("price");
    var strUserprice = price.options[price.selectedIndex].value;
    
    var miles = document.getElementById("miles");
    var strUsermiles = miles.options[miles.selectedIndex].value;
    
    var zip = document.getElementById("zip");
    var strUserzip = document.getElementById('zip').value;
    
      xmlurlsport = "?sport="+ strUser +"";
      xmlurlevent = "&event="+ strUserevent +"";
      xmlurlprice = "&price="+ strUserprice +"";
      xmlurlmiles = "&miles="+ strUsermiles +"";
      xmlurlzip = "&zip="+ strUserzip +"";
    
     var xmlurl = " url here "+xmlurlsport+""+xmlurlevent+""+xmlurlprice+""+xmlurlmiles+""+xmlurlzip+"";
    
    
                        var map = new GMap2(document.getElementById("map"));
                        map.addControl(new GSmallMapControl());
                        map.addControl(new GMapTypeControl());
                        map.setCenter(new GLatLng(38.85682, -96.943359), 4);
    
    
                        GDownloadUrl(xmlurl, function(data) {
                            var xml = GXml.parse(data);
                            var markers = xml.documentElement.getElementsByTagName("marker");
                            for (var i = 0; i < markers.length; i++) {
                                var name = markers[i].getAttribute("name");
                                var address = markers[i].getAttribute("address");
                                var type = markers[i].getAttribute("type");
                                var title = markers[i].getAttribute("title");
                                var id = markers[i].getAttribute("id");
                                var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                                parseFloat(markers[i].getAttribute("lng")));
                                var marker = createMarker(point, name, address, type, title, id);
                                map.addOverlay(marker);
                            }
                        });
    
    
    
    
    alert(xmlurl);
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add markers to a Google maps using V3. I have my
I'm trying to add markers to a map on my page using Google's Javascript
Currently I have JavaScript that displays markers on a Google map using the Google
I have a map with multiple markers of companies using google maps API v3.
I am using Primefaces google map component. I have some markers and info windows
I'm using the Google Maps API to build a map full of markers, but
I'm using the Google Maps API v2. I add markers to the map and
I have a scenario where I am using Google Map JavaScript API to process
I am trying to add a bunch of map markers to a map using
I have a MapActivity. It shows a Google map with some markers on it.

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.