Fusion Table Layer Wizard中的html - 无法在博主上完全显示

时间:2015-06-29 04:21:29

标签: javascript html google-maps blogger google-fusion-tables

这个小'虫'让我发疯了。任何能够解决问题的人都有1000点祝福。

当我将html从简单的融合表向导粘贴到博客站点[​​1]时,基本地图会暂时显示然后消失。仅保留“白色”基本地图和地图框,缩放栏和标记图标。一张无用的地图。

这是我的HTML

<!DOCTYPE html>
<html>
<head>
<style>
#map-canvas { width:500px; height:400px; }
.layer-wizard-search-label { font-family: sans-serif };
</style>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
var map;
var layer_0;
function initialize() {
  map = new google.maps.Map(document.getElementById('map-canvas'), {
    center: new google.maps.LatLng(21.15533458599919, 106.11318745800781),
    zoom: 10,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  });
  layer_0 = new google.maps.FusionTablesLayer({
    query: {
      select: "col1",
      from: "1ah3uh2UaH-z4PCVJ4gJr3nww3qBg3oBFd_ZeB0VD"
    },
    map: map,
    styleId: 2,
    templateId: 2
  });
  }
  function changeMap_0() {
  var whereClause;
  var searchString = document.getElementById('search-string_0').value.replace(/'/g, "\\'");
  if (searchString != '--Select--') {
    whereClause = "'Treatment' = '" + searchString + "'";
  }
  layer_0.setOptions({
    query: {
      select: "col1",
      from: "1ah3uh2UaH-z4PCVJ4gJr3nww3qBg3oBFd_ZeB0VD",
      where: whereClause
    }
  });
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
<div style="margin-top: 10px;">
  <label class="layer-wizard-search-label">
    Edit map view >
    <select id="search-string_0" onchange="changeMap_0(this.value);">
      <option value="--Select--">--Select--</option>
      <option value="Active">Active</option>
      <option value="Building">Building</option>
      <option value="None">None</option>
    </select>
  </label> 
  </div>
 </body>
</html>

0 个答案:

没有答案