Some things still need to tidy up, hand on exercises and recorded - more than a very good backup
No need to set the container, is provided directly css piece of code:
body,html,#dituContent {
// #dituContent 是地图当前div的id
width: 100%;
min-height: 100%;
overflow: hidden;
margin: 0;
position: absolute;
// 绝对定位在这里最重要
}
复制代码
Maps will follow the changes in mobile devices and adaptive change.
Attachment:
1. Baidu map api - create a map - Baidu map generator call api place
Soft paper reference:
2. automatic positioning Baidu Maps API and search capabilities (mobile terminal)
Hand knock Code Great God [equipment]
Reproduced in: https: //juejin.im/post/5cf5ec88e51d45105d63a4c0