Google Maps API Javascript Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SyPhy

    Google Maps API Javascript Problem

    Hi all,

    First post to this group and I hope I can get some help. I have been
    stuck on this all day....

    I am using the Google Maps API to plot markers grouped into categories
    via checkboxes. Some categories of markers are to load when the page
    loads, which are contained in a single XML file, other categories are
    to load after the user toggles the checkbox associated with a group of
    markers on.

    Please see this link for clarification:



    Some categories are being read from "location.x ml", which loads when
    the page loads (http://fddc.987mb.com/location.xml), specifically
    these: APDs & DSIs, Independent Living, Airports, Stadiums, and Social
    Security. All other categories are to load "on demand" after the user
    specifically toggles its checkbox on. For instance, "Targets" is to be
    read from "targets.xm l", located here: http://fddc.987mb.com/targets.xml

    I can't figure out how to do this to save my life. I am assuming that
    what I need
    is a JS function that sends the signal to load various XML files based
    on which checkbox is clicked. If anybody could help me figure out how
    to do this it would be greatly appreciated. Thank
    you!!!!!!!!!!!! !!!!!!!!!
  • Thomas 'PointedEars' Lahn

    #2
    Re: Google Maps API Javascript Problem

    SyPhy wrote:
    Please see this link for clarification:
    >

    >
    Some categories are being read from "location.x ml", which loads when the
    page loads (http://fddc.987mb.com/location.xml), specifically these:
    APDs & DSIs, Independent Living, Airports, Stadiums, and Social Security.
    All other categories are to load "on demand" after the user specifically
    toggles its checkbox on. For instance, "Targets" is to be read from
    "targets.xm l", located here: http://fddc.987mb.com/targets.xml
    >
    I can't figure out how to do this to save my life. I am assuming that
    what I need is a JS function that sends the signal to load various XML
    files based on which checkbox is clicked.
    This might give you some idea:

    var loadedXML = {
    location: true,
    targets: false
    };

    function showHideMarkers (type, bShow)
    {
    if (bShow)
    {
    // show markers
    }
    else
    {
    // hide markers
    }
    }

    function handleClick(che ckbox)
    {
    var type = checkbox.value;

    if (checkbox.check ed)
    {
    if (!loadedXML[type])
    {
    GDownloadUrl(ty pe + ".xml",
    function(data) {
    loadedXML[type] = true;
    createSetMarker s(data);
    showHideMarkers (type, true);
    });
    }
    else
    {
    showHideMarkers (type, true);
    }
    }
    else
    {
    showHideMarkers (type, false);
    }
    }

    <input type="checkbox" name="markers" value="targets"
    onclick="handle Click(this)">
    If anybody could help me figure out how to do this it would be greatly
    appreciated. Thank you!!!!!!!!!!!! !!!!!!!!!
    You're welcome. BTW: Your keyboard appears to be broken.


    PointedEars

    Comment

    Working...