1

Google Fusion から Google サイトにクエリを埋め込む際に問題が発生しています。クエリを作成し、メモ帳に保存された html ファイルとして機能しますが、Google サイトの Web サイトに配置しようとすると機能しません。

クエリ コードは次のとおりです。

    <html>
   <head>
     <style>
 #map-canvas { width:850px; height:650px; }
</style>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
var map;
var layerl0;
function initialize() {
  map = new google.maps.Map(document.getElementById('map-canvas'), {
    center: new google.maps.LatLng(43.89591323557617, -79.77653503417969),
    zoom: 11,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  });
  layerl0 = new google.maps.FusionTablesLayer({
    query: {
      select: "'col2'",
      from: '1eMaZWdi5QhF1252KH2e7xOiNyJoBFOzpStMP-Ks'
    },
    map: map,
    styleId: -1,
    templateId: -1
  });
}
function changeMapl0() {
  var searchString = document.getElementById('search-string-l0').value.replace(/'/g, "\\'");
  layerl0.setOptions({
    query: {
      select: "'col2'",
      from: '1eMaZWdi5QhF1252KH2e7xOiNyJoBFOzpStMP-Ks',
      where: "'description' CONTAINS IGNORING CASE '" + searchString + "'"
    }
  });
}
google.maps.event.addDomListener(window, 'load', initialize);
 </script>
 </head>
 <body>

<div id="map-canvas"></div>
<div style="margin-top: 10px;">
  <label>Land use:</label><input type="text" id="search-string-l0">
  <input type="button" onclick="changeMapl0()" value="Search">
 </div>
</body>

4

1 に答える 1