Home > Web Front-end > HTML Tutorial > 【百度地图】标注点的动画效果_html/css_WEB-ITnose

【百度地图】标注点的动画效果_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:33:19
Original
2387 people have browsed it

【百度地图】标注点的动画效果

(备注:demo中的密钥是我自己 申请的。如果需要使用demo,请自己另外申请一个。)

 

效果如图:

跳动的动画:

 

 

坠落动画:


 

所有的代码:

 

  1. moyu demo
  2. body, html {width:100%;}
  3. #allmap {width:100%;height:400px;overflow: hidden;margin:0;font-family:"微软雅黑";}
  4. input {width:200px;height:30px;color:#000;}
  5. <script></script>
  6. var map =newBMap.Map("allmap");
  7. var point =newBMap.Point(116.404,39.915);
  8. map.centerAndZoom(point,15);
  9. function addOne (){
  10. map.clearOverlays();
  11. var marker =newBMap.Marker(point);// 创建标注
  12. map.addOverlay(marker);// 将标注添加到地图中
  13. marker.setAnimation(BMAP_ANIMATION_BOUNCE);//跳动的动画
  14. }
  15. function addTwo (){
  16. map.clearOverlays();
  17. var marker =newBMap.Marker(point);// 创建标注
  18. map.addOverlay(marker);// 将标注添加到地图中
  19. marker.setAnimation(BMAP_ANIMATION_DROP);//坠落动画
  20. }
  21. function clearlay(){
  22. map.clearOverlays();
  23. }
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template