qq_34571911 2020-03-10 23:02 采纳率: 80%
浏览 586
已采纳

谷歌地图API秘钥的使用

我申请的谷歌地图秘钥是AIzaSyDEGQFwJGmV8MTX2SHes6N4dZNm2mpU_68 我是把谷歌地图放在网页上的,也引入了秘钥,但是还是有水印,是引入 秘钥的放方法错误还是什么原因?

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Google 地图 JavaScript API 示例: 简单的地图</title>
    <style type="text/css">
html{height:100%}
body{height:100%;margin:0px;padding:0px}
#map{height:100%}
</style>
<script type="text/javascript" src="http://www.google.com/jsapi?key=AIzaSyDEGQFwJGmV8MTX2SHes6N4dZNm2mpU_68"></script>



    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=zh-CN"></script>

   <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>


    <script type="text/javascript">
var map = null;
function initialize() {
    map = new google.maps.Map(document.getElementById('map'), {
            zoom: 12,
            center: new google.maps.LatLng(25.036772,121.520269), // 設定地圖中心點
            mapTypeId: google.maps.MapTypeId.ROADMAP // HYBRID,ROADMAP,SATELLITE,TERRAIN   
        });     

    addSite(map,'中山',25.062361,121.526194,'台北市中山區林森北路511號');
    addSite(map,'萬華',25.030000,121.490556,'台北市萬華區莒光路315號');
    addSite(map,'莒光',25.050000,121.420556,'台北市萬華區莒光路315號');
    addSite(map,'古亭',25.020833,121.528611,'台北市中正區羅斯福路三段153號');        
}


  var contentString = '<div id="content">'+
      '<div id="siteNotice">'+
      '</div>'+
      '<h1 id="firstHeading" class="firstHeading">Uluru</h1>'+
      '<div id="bodyContent">'+
      '<p><b>Uluru</b>, also referred to as <b>Ayers Rock</b>, is a large ' +
      'sandstone rock formation in the southern part of the '+
      'Northern Territory, central Australia. It lies 335 km (208 mi) '+
      'south west of the nearest large town, Alice Springs; 450 km '+
      '(280 mi) by road. Kata Tjuta and Uluru are the two major '+
      'features of the Uluru - Kata Tjuta National Park. Uluru is '+
      'sacred to the Pitjantjatjara and Yankunytjatjara, the '+
      'Aboriginal people of the area. It has many springs, waterholes, '+
      'rock caves and ancient paintings. Uluru is listed as a World '+
      'Heritage Site.</p>'+
      '<p>Attribution: Uluru, <a href="http://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
      'http://en.wikipedia.org/w/index.php?title=Uluru</a> '+
      '(last visited June 22, 2009).</p>'+
      '</div>'+
      '</div>';


var prev_infowindow = null;
function addSite(map, siteDesc, lat, lng, address) {
    var pt = new google.maps.LatLng(lat,lng);
    var marker = new google.maps.Marker({
                map: map,
                position : pt, 
                title: siteDesc
                });
    var infowindow = new google.maps.InfoWindow({
        content: contentString
    });

    google.maps.event.addListener(marker, 'click', function() {
        if (prev_infowindow != null) prev_infowindow.close();
        prev_infowindow = infowindow;
        infowindow.open(map, marker);
    });     


var LatLngList = new Array (new google.maps.LatLng (25.062361,121.526194), new google.maps.LatLng (25.030000,121.490556), new google.maps.LatLng (25.050000,121.420556),new google.maps.LatLng (25.020833,121.528611));
//  Create a new viewpoint bound
var bounds = new google.maps.LatLngBounds ();
//  Go through each...
for (var i = 0, LtLgLen = LatLngList.length; i < LtLgLen; i++) {
  //  And increase the bounds to take this point
  bounds.extend (LatLngList[i]);
}
//  Fit these bounds to the map
map.fitBounds (bounds);

}

$(document).ready(function() { initialize(); });


    </script>


  </head>
  <body οnlοad="initialize()"  >
    <div id="map" ></div>
  </body>
</html>

  • 写回答

3条回答 默认 最新

  • youji8 2020-03-12 15:08
    关注

    暗黑水印需要你为账户绑定结算方式(绑定付费信用卡)在结算里绑定,按着提示来就行了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 已采纳回答 8月27日

悬赏问题

  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况
  • ¥15 画两个图 python或R
  • ¥15 在线请求openmv与pixhawk 实现实时目标跟踪的具体通讯方法
  • ¥15 八路抢答器设计出现故障
  • ¥15 opencv 无法读取视频
  • ¥15 按键修改电子时钟,C51单片机
  • ¥60 Java中实现如何实现张量类,并用于图像处理(不运用其他科学计算库和图像处理库))