Home  >  Article  >  Web Front-end  >  How does Baidu Map JavaScript API display multiple maps on the same page?

How does Baidu Map JavaScript API display multiple maps on the same page?

高洛峰
高洛峰Original
2016-11-28 10:15:471356browse

经常有人问,百度地图JavaScript API能在同一页面显示多个地图吗?当然可以啊,为什么不可以呢?地图之于页面无非就是个div,我们可以在页面显示多个div,自然也可以显示多个地图。


以下是在页面加入两个地图的效果:

How does Baidu Map JavaScript API display multiple maps on the same page?

页面核心代码如下:


[html]
 

 
   
 
  
 
   
 
 
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn