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

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

WBOY
WBOYOriginal
2016-06-24 11:33:192277browse

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

(备注: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. var map =newBMap.Map("allmap");
  6. var point =newBMap.Point(116.404,39.915);
  7. map.centerAndZoom(point,15);
  8. function addOne (){
  9. map.clearOverlays();
  10. var marker =newBMap.Marker(point);// 创建标注
  11. map.addOverlay(marker);// 将标注添加到地图中
  12. marker.setAnimation(BMAP_ANIMATION_BOUNCE);//跳动的动画
  13. }
  14. function addTwo (){
  15. map.clearOverlays();
  16. var marker =newBMap.Marker(point);// 创建标注
  17. map.addOverlay(marker);// 将标注添加到地图中
  18. marker.setAnimation(BMAP_ANIMATION_DROP);//坠落动画
  19. }
  20. function clearlay(){
  21. map.clearOverlays();
  22. }
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