Java Code Examples for com.amap.api.maps.model.Marker#setAnimation()
The following examples show how to use
com.amap.api.maps.model.Marker#setAnimation() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClusterOverlay.java From android-cluster-marker with Apache License 2.0 | 6 votes |
/** * 将聚合元素添加至地图上 */ private void addClusterToMap(List<Cluster> clusters) { ArrayList<Marker> removeMarkers = new ArrayList<>(); removeMarkers.addAll(mAddMarkers); AlphaAnimation alphaAnimation=new AlphaAnimation(1, 0); MyAnimationListener myAnimationListener=new MyAnimationListener(removeMarkers); for (Marker marker : removeMarkers) { marker.setAnimation(alphaAnimation); marker.setAnimationListener(myAnimationListener); marker.startAnimation(); } for (Cluster cluster : clusters) { addSingleClusterToMap(cluster); } }
Example 2
Source File: CustomMarkerActivity.java From TraceByAmap with MIT License | 5 votes |
/** * 从地上生长效果, * @param marker */ private void growInto(final Marker marker) { Animation animation = new ScaleAnimation(0,1,0,1); animation.setInterpolator(new LinearInterpolator()); //整个移动所需要的时间 animation.setDuration(1000); //设置动画 marker.setAnimation(animation); //开始动画 marker.startAnimation(); }
Example 3
Source File: ClusterOverlay.java From android-cluster-marker with Apache License 2.0 | 5 votes |
/** * 将单个聚合元素添加至地图显示 * * @param cluster */ private void addSingleClusterToMap(Cluster cluster) { LatLng latlng = cluster.getCenterLatLng(); MarkerOptions markerOptions = new MarkerOptions(); markerOptions.anchor(0.5f, 0.5f) .icon(getBitmapDes(cluster.getClusterCount())).position(latlng); Marker marker = mAMap.addMarker(markerOptions); marker.setAnimation(mADDAnimation); marker.setObject(cluster); marker.startAnimation(); cluster.setMarker(marker); mAddMarkers.add(marker); }