高德地图 JS API示例-事件系统-地图事件-室内加载完成

高德地图 JS API示例-事件系统-地图事件-室内加载完成

<!doctype html>
<html lang="en" >
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
    <style type="text/css">
      h3{
        font-size: 1.17em;
        line-height: 1.4;
        font-weight: bold;
        margin: 2px;
      }
      hr{
        margin: 1px;
      }
      html,body{
        width: 100%;
        height: 100%;
        margin: 0px;
      }
      .map{
        height: 100%;
        width: 100%;
        float: left;
      }
        #container .amap-indoormap-floorbar-control{bottom:10%}
    </style>
    <title>室内地图</title>
</head>
<body>
    <div id="container" class="map"></div>
    <script type="text/javascript" src='https://webapi.amap.com/maps?v=1.4.15&key=您申请的key值'></script>
    <script src="https://a.amap.com/jsapi_demos/static/demo-center/js/demoutils.js"></script>
    <script type="text/javascript">
        AMap.plugin(['AMap.IndoorMap'], function() {
            // 设定在没有矢量底图的时候也显示,默认情况下室内图仅在有矢量底图的时候显示
            var indoorMap = new AMap.IndoorMap({alwaysShow:true});
            // 初始化地图
            var map = new AMap.Map('container', {
                showIndoorMap:false, // 隐藏地图自带的室内地图图层
                layers:[indoorMap,new AMap.TileLayer()] // 地图图层数组
            });
            // 显示指定室内地图信息
            indoorMap.showIndoorMap('B000A856LJ');
            // 绑定室内图层加载完成事件
            indoorMap.on('complete', function() {
                log.success("室内图层加载完成!");  
            });
            
        });
    </script>

</body>
  
</html>
0 0 投票数
文章评分
订阅评论
提醒
0 评论
内联反馈
查看所有评论
0
希望看到您的想法,请您发表评论x