当Map的视图模式为3D时,室内地图也将展示为3D效果。
<!doctype html>
<html lang="en" >
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<script type="text/javascript">
</script>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<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;
}
#mapDiv .amap-indoormap-floorbar-control{bottom:10%}
</style>
<title>室内地图</title>
</head>
<body>
<div id="mapDiv" class="map" tabindex="0"></div>
<script type="text/javascript" src='https://webapi.amap.com/maps?v=1.4.15&key=您申请的key值&plugin=AMap.ToolBar'></script>
<script type="text/javascript">
var map = new AMap.Map('mapDiv', {
resizeEnable: true,
center:[116.518542, 39.924677],
zoom:18,
pitch:50,
viewMode:'3D'
});
map.on('indoor_create',function(){
map.indoorMap.showIndoorMap('B000A856LJ',5);
})
</script>
<script type="text/javascript" src="https://webapi.amap.com/demos/js/liteToolbar.js"></script>
</body>
</html>