<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>百度地图-标注</title>
    <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,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
    </style>
    <!--百度地图javascript插件-->
    <script type="text/javascript" src="https://api.map.baidu.com/api?v=3.0&ak=D0wEGuhdSeOnhY7h6tGZLmCBucHKdouF"></script>
</head>
<body>
<div id="allmap"></div>
</body>
</html>
<script type="text/javascript">
    // 百度地图API功能
    var map = new BMap.Map("allmap");
    var point = new BMap.Point("${lng}", "${lat}");
    var sContent ="${address}";
    if (isNaN(point.lat)||isNaN(point.lng)){
        alert("坐标无法识别");
    }
    console.log(point)
    map.centerAndZoom(point, 15);
    var marker = new BMap.Marker(point);        // 创建标注
    map.addOverlay(marker);
    map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
    var infoWindow = new BMap.InfoWindow(sContent);
    map.openInfoWindow(infoWindow,point); //开启信息窗口
</script>