Blank page when I use FusionTablesLayer with Google Maps JavaScript API v3

一曲冷凌霜 提交于 2019-11-27 09:48:54

The file "/maps/documentation/javascript/examples/default.css" doesn't exist on your site. Your map doesn't have a valid size.

Working version

code snippet:

function initialize() {

  var istanbul = new google.maps.LatLng(41.01, 28.97);

  map = new google.maps.Map(document.getElementById('map_canvas'), {
    center: istanbul,
    zoom: 11,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  });

  layer = new google.maps.FusionTablesLayer({
    query: {
      select: 'Location',
      from: '1s3DYRvmNAfKgo-swjG39-8UEb9tHMm0UPHvW_tc'
    }
  });
  layer.setMap(map);
}
google.maps.event.addDomListener(window, 'load', initialize);
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}
#map_canvas {
  height: 100%;
}
@media print {
  html,
  body {
    height: auto;
  }
  #map_canvas {
    height: 650px;
  }
}
<script src="https://maps.googleapis.com/maps/api/js"></script>
<B>MAP</B> 
<BR>

<div id="map_canvas"></div>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!