1

My maps are not working. It shows the search box but not the map:

// ]]></script>
<script type="text/javascript">// <![CDATA[
var map;
var layer_0;
function initialize() {
  map = new google.maps.Map(document.getElementById('map-canvas'), {
    center: new google.maps.LatLng(52.070862762816084, 1.6080674687500496),
    zoom: 6,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  });
  layer_0 = new google.maps.FusionTablesLayer({
    query: {
      select: "col8",
      from: "1bpXQW_7X82BwZkfPMBKypzBL5_BC4EnI5584GWA"
    },
    map: map,
    styleId: 4,
    templateId: 26
  });
}
function changeMap_0() {
  var whereClause;
  var searchString = document.getElementById('search-string_0').value.replace
  (/'/g, "\\'");
  if (searchString != '--Select--') {
    whereClause = "'Postcode' CONTAINS IGNORING CASE '" + searchString + "'";
  }
  layer_0.setOptions({
    query: {
      select: "col8",
      from: "1bpXQW_7X82BwZkfPMBKypzBL5_BC4EnI5584GWA",
      where: whereClause
    }
  });
  }
  google.maps.event.addDomListener(window, 'load', initialize);
  // ]]></script>
  <div id="map-canvas">&nbsp;</div>
  <div style="margin-top: 10px;"><label class="layer-wizard-search-label"> Postcode 
  (with space e.g. HP11 2QW) <input id="search-string_0" type="text"> <input
   onclick="changeMap_0()" type="button" value="Search"> </label></div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.