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

谷歌地图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日

悬赏问题

  • ¥30 基于信创PC发布的QT应用如何跨用户启动后输入中文
  • ¥20 非root手机,如何精准控制手机流量消耗的大小,如20M
  • ¥15 远程安装一下vasp
  • ¥15 自己做的代码上传图片时,报错
  • ¥15 Lingo线性规划模型怎么搭建
  • ¥15 关于#python#的问题,请各位专家解答!区间型正向化
  • ¥15 unity从3D升级到urp管线,打包ab包后,材质全部变紫色
  • ¥50 comsol温度场仿真无法模拟微米级激光光斑
  • ¥15 上传图片时提交的存储类型
  • ¥15 VB.NET如何绘制倾斜的椭圆