Java Code Examples for com.amap.api.maps.model.BitmapDescriptorFactory#fromResource()

The following examples show how to use com.amap.api.maps.model.BitmapDescriptorFactory#fromResource() . 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 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 2
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 3
Source File: RouteOverlay.java    From BmapLite with Apache License 2.0 4 votes vote down vote up
protected BitmapDescriptor getDriveBitmapDescriptor() {
	return BitmapDescriptorFactory.fromResource(R.drawable.amap_car);
}
 
Example 4
Source File: GaoDeMapCustomMarkerView.java    From FimiX8-RE with MIT License 4 votes vote down vote up
public BitmapDescriptor createCustomMarkerView(Context context, int res) {
    return BitmapDescriptorFactory.fromResource(res);
}
 
Example 5
Source File: BusLineOverlay.java    From BmapLite with GNU General Public License v3.0 4 votes vote down vote up
protected BitmapDescriptor getEndBitmapDescriptor() {
    endBit = BitmapDescriptorFactory.fromResource(R.drawable.amap_end);
    return endBit;
}
 
Example 6
Source File: BusLineOverlay.java    From BmapLite with Apache License 2.0 4 votes vote down vote up
protected BitmapDescriptor getBusBitmapDescriptor() {
    busBit = BitmapDescriptorFactory.fromResource(R.drawable.amap_bus);
    return busBit;
}
 
Example 7
Source File: RouteOverlay.java    From BmapLite with GNU General Public License v3.0 4 votes vote down vote up
protected BitmapDescriptor getDriveBitmapDescriptor() {
	return BitmapDescriptorFactory.fromResource(R.drawable.amap_car);
}
 
Example 8
Source File: BusLineOverlay.java    From TraceByAmap with MIT License 4 votes vote down vote up
protected BitmapDescriptor getBusBitmapDescriptor() {
    busBit = BitmapDescriptorFactory.fromResource(R.drawable.amap_bus);
    return busBit;
}
 
Example 9
Source File: BusLineOverlay.java    From BmapLite with Apache License 2.0 4 votes vote down vote up
protected BitmapDescriptor getStartBitmapDescriptor() {
    startBit = BitmapDescriptorFactory.fromResource(R.drawable.amap_start);
    return startBit;
}
 
Example 10
Source File: BusLineOverlay.java    From BmapLite with Apache License 2.0 4 votes vote down vote up
protected BitmapDescriptor getEndBitmapDescriptor() {
    endBit = BitmapDescriptorFactory.fromResource(R.drawable.amap_end);
    return endBit;
}
 
Example 11
Source File: AMapMarker.java    From react-native-amap with MIT License 4 votes vote down vote up
private BitmapDescriptor getBitmapDescriptorByName(String name) {
    return BitmapDescriptorFactory.fromResource(getDrawableResourceByName(name));
}
 
Example 12
Source File: RouteOverlay.java    From BmapLite with Apache License 2.0 2 votes vote down vote up
/**
 * 给终点Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。
 * @return 更换的Marker图片。
 * @since V2.1.0
 */
protected BitmapDescriptor getEndBitmapDescriptor() {
	return BitmapDescriptorFactory.fromResource(R.drawable.amap_end);
}
 
Example 13
Source File: TruckRouteColorfulOverLay.java    From TraceByAmap with MIT License 2 votes vote down vote up
private BitmapDescriptor getThroughPointBitDes() {
	return BitmapDescriptorFactory.fromResource(R.drawable.amap_through);
   
}
 
Example 14
Source File: RouteOverlay.java    From BmapLite with GNU General Public License v3.0 2 votes vote down vote up
/**
 * 给起点Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。
 * @return 更换的Marker图片。
 * @since V2.1.0
 */
protected BitmapDescriptor getStartBitmapDescriptor() {
	return BitmapDescriptorFactory.fromResource(R.drawable.amap_start);
}
 
Example 15
Source File: RouteOverlay.java    From BmapLite with GNU General Public License v3.0 2 votes vote down vote up
/**
 * 给终点Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。
 * @return 更换的Marker图片。
 * @since V2.1.0
 */
protected BitmapDescriptor getEndBitmapDescriptor() {
	return BitmapDescriptorFactory.fromResource(R.drawable.amap_end);
}
 
Example 16
Source File: RouteOverlay.java    From BmapLite with GNU General Public License v3.0 2 votes vote down vote up
/**
 * 给公交Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。
 * @return 更换的Marker图片。
 * @since V2.1.0
 */
protected BitmapDescriptor getBusBitmapDescriptor() {
	return BitmapDescriptorFactory.fromResource(R.drawable.amap_bus);
}
 
Example 17
Source File: RouteOverlay.java    From BmapLite with GNU General Public License v3.0 2 votes vote down vote up
/**
 * 给步行Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。
 * @return 更换的Marker图片。
 * @since V2.1.0
 */
protected BitmapDescriptor getWalkBitmapDescriptor() {
	return BitmapDescriptorFactory.fromResource(R.drawable.amap_man);
}
 
Example 18
Source File: RouteOverlay.java    From TraceByAmap with MIT License 2 votes vote down vote up
/**
 * 给公交Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。
 * @return 更换的Marker图片。
 * @since V2.1.0
 */
protected BitmapDescriptor getBusBitmapDescriptor() {
	return BitmapDescriptorFactory.fromResource(R.drawable.amap_bus);
}
 
Example 19
Source File: RouteOverlay.java    From TraceByAmap with MIT License 2 votes vote down vote up
/**
 * 给终点Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。
 * @return 更换的Marker图片。
 * @since V2.1.0
 */
protected BitmapDescriptor getEndBitmapDescriptor() {
	return BitmapDescriptorFactory.fromResource(R.drawable.amap_end);
}
 
Example 20
Source File: RouteOverlay.java    From BmapLite with Apache License 2.0 2 votes vote down vote up
/**
 * 给公交Marker设置图标,并返回更换图标的图片。如不用默认图片,需要重写此方法。
 * @return 更换的Marker图片。
 * @since V2.1.0
 */
protected BitmapDescriptor getBusBitmapDescriptor() {
	return BitmapDescriptorFactory.fromResource(R.drawable.amap_bus);
}