javascript - 谷歌地图灰色 map

标签 javascript html css google-maps google-chrome

所以,我这里有一些类似于灰色 map 的东西,只是在这里我看到了所有的按钮。除了 map 图 block 外,一切看起来都 100% 正常。它们都是灰色的!所以会发生什么,这很奇怪,它以 8 倍率加载 nicley,然后放大到最大,然后 Gray Tiles me。现在是代码:

 <style>

     html, body, #map-canvas {
       height: 100%;
       margin: 0px;
       padding: 0px;
       width: 100%;
     }


   </style>
   <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBN5n7Q_LBTusrg4ae_vFtDWq22SZg5orU&sensor=false"></script>
   <script>
var map;
function initialize() {
 var mapOptions = {
   zoom: 8,
   center: new google.maps.LatLng(-34.397, 150.644),
   mapTypeId: google.maps.MapTypeId.ROADMAP
 };
 map = new google.maps.Map(document.getElementById('map-canvas'),
     mapOptions);
 var kmlLayer = new google.maps.KmlLayer({
    url: 'http://pasteht.ml/pr7Xm',
    suppressInfoWindows: false,
    map: map
  });
}

google.maps.event.addDomListener(window, 'load', initialize);

   </script>

最佳答案

<coordinates/>地标无效。

在 KML 中,顺序必须是 longitude, latitude (使用相反的顺序,纬度将设置为 -122.419416 ,这是纬度的无效值...有效范围约为 -85 to 85 )

关于javascript - 谷歌地图灰色 map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21210533/

相关文章:

javascript - 查找并替换图像网址源?

html - 如何使 2 张图像(相同高度不同宽度)按比例缩小

javascript - Fancybox box 在我将它上传到 webhost 但在 localhost 上工作后不工作

javascript - 使用 Javascript 从字符串中提取 CSS 属性

javascript - 在新的 dashcode 模板的加载函数中添加 document.write 会导致其余 JS 无法生成

javascript - AngularJS 中对 http api 的调用次数为 `n` 次。我应该期待它们 `n` 次吗?

javascript - d3.js 双击不释放节点

javascript - 使用单选按钮显示文本区域和复选框

jquery - 如何更改移动应用程序中文本输入元素的大小?

html - Qt 创建左箭头样式的按钮