Java Code Examples for com.amap.api.maps.model.Marker#remove()

The following examples show how to use com.amap.api.maps.model.Marker#remove() . 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: AmapFragment.java    From BmapLite with Apache License 2.0 6 votes vote down vote up
public void getFavoriteList() {
    if (null != mFavMarkerList && !mFavMarkerList.isEmpty()) {
        for (Marker o : mFavMarkerList) {
            o.remove();
        }
        mFavMarkerList.clear();
    }
    if (null != mFavoriteInteracter) {
        List<MyPoiModel> favoriteList = mFavoriteInteracter.getFavoriteList();
        if (null != favoriteList && !favoriteList.isEmpty()) {
            for (MyPoiModel poi : favoriteList) {
                BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.ic_grade_point_2);
                Marker marker = mAmap.addMarker(new MarkerOptions().position(new LatLng(poi.getLatitude(), poi.getLongitude())).title(poi.getName()).snippet("").anchor(0.5f, 0.5f).icon(bitmapDescriptor));
                mFavMarkerList.add(marker);
            }
        }
    }
}
 
Example 2
Source File: AmapFragment.java    From BmapLite with Apache License 2.0 6 votes vote down vote up
public void clearRangingPoi() {
    clearMarker();

    for (Marker marker : mRangingMarkerList) {
        marker.remove();
    }
    mRangingMarkerList.clear();

    for (Polyline polyline : mLineList) {
        polyline.remove();
    }
    mLineList.clear();

    mPoiList.clear();
    mTotal = 0;
}
 
Example 3
Source File: RouteOverlay.java    From BmapLite with Apache License 2.0 6 votes vote down vote up
/**
 * 去掉BusRouteOverlay上所有的Marker。
 * @since V2.1.0
 */
public void removeFromMap() {
	if (startMarker != null) {
		startMarker.remove();

	}
	if (endMarker != null) {
		endMarker.remove();
	}
	for (Marker marker : stationMarkers) {
		marker.remove();
	}
	for (Polyline line : allPolyLines) {
		line.remove();
	}
	destroyBit();
}
 
Example 4
Source File: AmapFragment.java    From BmapLite with GNU General Public License v3.0 6 votes vote down vote up
public void getFavoriteList() {
    if (null != mFavMarkerList && !mFavMarkerList.isEmpty()) {
        for (Marker o : mFavMarkerList) {
            o.remove();
        }
        mFavMarkerList.clear();
    }
    if (null != mFavoriteInteracter) {
        List<MyPoiModel> favoriteList = mFavoriteInteracter.getFavoriteList();
        if (null != favoriteList && !favoriteList.isEmpty()) {
            for (MyPoiModel poi : favoriteList) {
                BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.ic_grade_point_2);
                Marker marker = mAmap.addMarker(new MarkerOptions().position(new LatLng(poi.getLatitude(), poi.getLongitude())).title(poi.getName()).snippet("").anchor(0.5f, 0.5f).icon(bitmapDescriptor));
                mFavMarkerList.add(marker);
            }
        }
    }
}
 
Example 5
Source File: RouteOverlay.java    From BmapLite with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 去掉BusRouteOverlay上所有的Marker。
 * @since V2.1.0
 */
public void removeFromMap() {
	if (startMarker != null) {
		startMarker.remove();

	}
	if (endMarker != null) {
		endMarker.remove();
	}
	for (Marker marker : stationMarkers) {
		marker.remove();
	}
	for (Polyline line : allPolyLines) {
		line.remove();
	}
	destroyBit();
}
 
Example 6
Source File: BusLineOverlay.java    From BmapLite with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 去掉BusLineOverlay上所有的Marker。
 *
 * @since V2.1.0
 */
public void removeFromMap() {
    if (mBusLinePolyline != null) {
        mBusLinePolyline.remove();
    }
    try {
        for (Marker mark : mBusStationMarks) {
            mark.remove();
        }
        destroyBit();
    } catch (Throwable e) {
        e.printStackTrace();
    }
}
 
Example 7
Source File: AmapFragment.java    From BmapLite with Apache License 2.0 5 votes vote down vote up
public void clearMarker() {
    for (Marker marker : markerList) {
        marker.remove();
    }
    markerList.clear();
    getFavoriteList();
}
 
Example 8
Source File: MapsModule.java    From Maps with GNU General Public License v2.0 5 votes vote down vote up
public void removeCameras(){
    if (mCameras != null && !mCameras.isEmpty()){
        for (Marker marker : mCameras){
            marker.remove();
            marker.destroy();
        }
    }
}
 
Example 9
Source File: ClusterOverlay.java    From android-cluster-marker with Apache License 2.0 5 votes vote down vote up
@Override
public void onAnimationEnd() {
    for(Marker marker:mRemoveMarkers){
        marker.remove();
    }
    mRemoveMarkers.clear();
}
 
Example 10
Source File: GeoFence_Nearby_Activity.java    From Android_Location_Demo with Apache License 2.0 5 votes vote down vote up
private void removeMarkers() {
	if(null != centerMarker){
		centerMarker.remove();
		centerMarker = null;
	}
	if (null != markerList && markerList.size() > 0) {
		for (Marker marker : markerList) {
			marker.remove();
		}
		markerList.clear();
	}
}
 
Example 11
Source File: GaoDeMapAiLineManager.java    From FimiX8-RE with MIT License 5 votes vote down vote up
private void clearPointMark() {
    for (Marker marker : this.mMarkerList) {
        marker.remove();
    }
    for (Marker marker2 : this.interestMarkerList) {
        marker2.remove();
    }
    clearMarker();
}
 
Example 12
Source File: GeoFence_Round_Activity.java    From Android_Location_Demo with Apache License 2.0 5 votes vote down vote up
private void removeMarkers() {
	if(null != centerMarker){
		centerMarker.remove();
		centerMarker = null;
	}
	if (null != markerList && markerList.size() > 0) {
		for (Marker marker : markerList) {
			marker.remove();
		}
		markerList.clear();
	}
}
 
Example 13
Source File: GeoFence_Polygon_Activity.java    From Android_Location_Demo with Apache License 2.0 5 votes vote down vote up
private void removeMarkers() {
	if (null != markerList && markerList.size() > 0) {
		for (Marker marker : markerList) {
			marker.remove();
		}
		markerList.clear();
	}
}
 
Example 14
Source File: ClusterOverlay.java    From android-cluster-marker with Apache License 2.0 5 votes vote down vote up
public void onDestroy() {
    mIsCanceled = true;
    mSignClusterHandler.removeCallbacksAndMessages(null);
    mMarkerhandler.removeCallbacksAndMessages(null);
    mSignClusterThread.quit();
    mMarkerHandlerThread.quit();
    for (Marker marker : mAddMarkers) {
        marker.remove();

    }
    mAddMarkers.clear();
    mLruCache.evictAll();
}
 
Example 15
Source File: GeoFence_Nearby_Activity.java    From Android_Location_Demo with Apache License 2.0 5 votes vote down vote up
private void removeMarkers() {
	if(null != centerMarker){
		centerMarker.remove();
		centerMarker = null;
	}
	if (null != markerList && markerList.size() > 0) {
		for (Marker marker : markerList) {
			marker.remove();
		}
		markerList.clear();
	}
}
 
Example 16
Source File: GaoDeMapAiLineManager.java    From FimiX8-RE with MIT License 5 votes vote down vote up
public void removeInterestUnBebind() {
    MapPointLatLng p;
    Marker tmp = null;
    for (Marker m : this.interestMarkerList) {
        MapPointLatLng mpl = (MapPointLatLng) m.getObject();
        boolean isFind = false;
        for (MapPointLatLng p2 : this.mMapPointList) {
            if (p2.mInrertestPoint == mpl) {
                isFind = true;
                continue;
                break;
            }
        }
        if (!isFind) {
            tmp = m;
            break;
        }
    }
    if (tmp != null) {
        this.interestMarkerList.remove(tmp);
        tmp.remove();
        int i = 0;
        for (Marker marker : this.interestMarkerList) {
            i++;
            p2 = (MapPointLatLng) marker.getObject();
            p2.nPos = i;
            if (p2.isMapPoint) {
                marker.setIcon(new GaoDeMapCustomMarkerView().createCustomMarkerView(this.context, R.drawable.x8_img_ai_line_inreterst_max1, p2.altitude, p2.nPos));
                setRotateAngle(marker, p2.angle);
            }
        }
    }
    if (this.lineMarkerSelectListener != null) {
        IX8MarkerListener iX8MarkerListener = this.lineMarkerSelectListener;
        boolean z = this.interestMarkerList.size() != this.mMarkerList.size() && hasPointUnBind();
        iX8MarkerListener.onInterestSizeEnable(z);
    }
}
 
Example 17
Source File: PoiOverlay.java    From BmapLite with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 去掉PoiOverlay上所有的Marker。
 * @since V2.1.0
 */
public void removeFromMap() {
	for (Marker mark : mPoiMarks) {
		mark.remove();
	}
}
 
Example 18
Source File: PoiOverlay.java    From BmapLite with Apache License 2.0 4 votes vote down vote up
/**
 * 去掉PoiOverlay上所有的Marker。
 * @since V2.1.0
 */
public void removeFromMap() {
	for (Marker mark : mPoiMarks) {
		mark.remove();
	}
}
 
Example 19
Source File: CloudOverlay.java    From TraceByAmap with MIT License 4 votes vote down vote up
public void removeFromMap() {
	for (Marker mark : mPoiMarks) {
		mark.remove();
	}
}
 
Example 20
Source File: PoiAroundSearchActivity.java    From TraceByAmap with MIT License 4 votes vote down vote up
/**
 * 去掉PoiOverlay上所有的Marker。
 *
 * @since V2.1.0
 */
public void removeFromMap() {
    for (Marker mark : mPoiMarks) {
        mark.remove();
    }
}