zoukankan      html  css  js  c++  java
  • 根据经纬度 获取中心点

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
    body, html { 100%;height: 100%;margin:0;font-family:"微软雅黑";}
    #allmap{100%;height:500px;}
    p{margin-left:5px; font-size:14px;}
    </style>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=您的密钥"></script>
    <title>纯文本的信息窗口</title>
    </head>
    <body>
    <div id="allmap"></div>
    <p>点击标注点,可查看由纯文本构成的简单型信息窗口</p>
    </body>
    </html>
    <script type="text/javascript">
    // 百度地图API功能
    var map = new BMap.Map("allmap");
    var point = new BMap.Point(116.417854,39.921988);
    var marker = new BMap.Marker(point); // 创建标注
    map.addOverlay(marker); // 将标注添加到地图中
    map.centerAndZoom(point, 15);
    var opts = {
    width : 200, // 信息窗口宽度
    height: 100, // 信息窗口高度
    title : "海底捞王府井店" , // 信息窗口标题
    enableMessage:true,//设置允许信息窗发送短息
    message:"亲耐滴,晚上一起吃个饭吧?戳下面的链接看下地址喔~"
    }
    var infoWindow = new BMap.InfoWindow("地址:北京市东城区王府井大街88号乐天银泰百货八层", opts); // 创建信息窗口对象
    marker.addEventListener("click", function(){
    map.openInfoWindow(infoWindow,point); //开启信息窗口
    });
    </script>

    来源:http://lbsyun.baidu.com/jsdemo.htm#d0_1

    不忘初心,方得始终,初心易得,始终难守。
  • 相关阅读:
    ZZ
    Qt5获取网卡/IP等信息
    platforms
    [转]如何使用VS 2013發布一個可以在Windows XP中獨立運行的可執行文件
    spring cloud 服务提供者
    spring cloud: eureka搭建
    通过maven 上传jar 到nexus3,cong nexus3下载jar
    搭建turbine时 hystrix MaxConcurrentConnections reached 异常
    Zuul超时问题,微服务响应超时,zuul进行熔断
    微信公众号开发网址
  • 原文地址:https://www.cnblogs.com/chuxinsyn/p/9111482.html
Copyright © 2011-2022 走看看