Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm having a quite bit of difficulty creating some functions for my fusion tables. I have two tables here:

Points

Parcels

I'm trying to create a number of functions:

1) I want to be able to select the points layer using a drop down menu to select by its ID number.

2) I want to create a function where when I pick my point, I can tell fusion tables to find me the parcels that are within 1km of the point. It would preferable if I can change the distances, so I can do searches for 5km for example.

Here's my code:

<!DOCTYPE html>
<html>
  <head>
  <style>
    #map-canvas { width:500px; height:400px; }
  </style>
  <script type="text/javascript"
    src="http://maps.google.com/maps/api/js?sensor=false">
  </script>
  <script type="text/javascript">
    var map;
    var layerl0;
    var layerl1;
    function initialize() {
      map = new google.maps.Map(document.getElementById('map-canvas'), {
        center: new google.maps.LatLng(43.94255650099583, -79.53326251471042),
        zoom: 13,
        mapTypeId: google.maps.MapTypeId.ROADMAP
      });
      layerl0 = new google.maps.FusionTablesLayer({
        query: {
          select: "'col2'",
          from: '1-6QDLUk0Xw7weaB0GP1nmgwvXUuaXJCxWEYbO8E'
        },
        map: map,
        styleId: -1,
        templateId: -1
      });
      layerl1 = new google.maps.FusionTablesLayer({
        query: {
          select: "'col2'",
          from: '1BdIN39m70Vo6Sq0Y5lm1s_4Crh1CZpSwRbYMfnM'
        },
        map: map,
        styleId: -1,
        templateId: -1
      });
    }
    function changeMapl0() {
      var searchString = document.getElementById('search-string-l0').value.replace(/'/g, "\\'");
      layerl0.setOptions({
        query: {
          select: "'col2'",
          from: '1-6QDLUk0Xw7weaB0GP1nmgwvXUuaXJCxWEYbO8E',
          where: "'description' CONTAINS IGNORING CASE '" + searchString + "'"
        }
      });
    }
    function changeMapl1() {
      var searchString = document.getElementById('search-string-l1').value.replace(/'/g, "\\'");
      layerl1.setOptions({
        query: {
          select: "'col2'",
          from: '1BdIN39m70Vo6Sq0Y5lm1s_4Crh1CZpSwRbYMfnM',
          where: "'description' = '" + searchString + "'"
        }
      });
    }
    google.maps.event.addDomListener(window, 'load', initialize);
  </script>
  </head>
  <body>
    <div id="map-canvas"></div>
    <div style="margin-top: 10px;">
      <label>Zone: </label><input type="text" id="search-string-l0">
      <input type="button" onclick="changeMapl0()" value="Search">
    </div>
    <div style="margin-top: 10px;">
      <label>SPP_ID: </label>
      <select id="search-string-l1" onchange="changeMapl1(this.value);">
        <option value="">--Select--</option>
        <option value="<html xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:msxsl="urn:schemas-microsoft-com:xslt">

<head>

<META http-equiv="Content-Type" content="text/html">

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

</head>

<body style=

Thanks for your help!

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.