Google Groups Home
Help | Sign in
Message from discussion Google Maps API Javascript Problem
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Thomas 'PointedEars' Lahn  
View profile
 More options May 17, 6:38 am
Newsgroups: comp.lang.javascript
From: Thomas 'PointedEars' Lahn <PointedE...@web.de>
Date: Sat, 17 May 2008 12:38:35 +0200
Local: Sat, May 17 2008 6:38 am
Subject: Re: Google Maps API Javascript Problem

SyPhy wrote:
> Please see this link for clarification:

> http://fddc.987mb.com/index1.htm

> Some categories are being read from "location.xml", 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.xml", 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(checkbox)
  {
    var type = checkbox.value;

    if (checkbox.checked)
    {
      if (!loadedXML[type])
      {
        GDownloadUrl(type + ".xml",
          function(data) {
            loadedXML[type] = true;
            createSetMarkers(data);
            showHideMarkers(type, true);
          });
      }
      else
      {
        showHideMarkers(type, true);
      }
    }
    else
    {
      showHideMarkers(type, false);
    }
  }

  <input type="checkbox" name="markers" value="targets"
         onclick="handleClick(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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google