本文整理匯總了Java中com.baidu.mapapi.map.BitmapDescriptor類的典型用法代碼示例。如果您正苦於以下問題:Java BitmapDescriptor類的具體用法?Java BitmapDescriptor怎麽用?Java BitmapDescriptor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BitmapDescriptor類屬於com.baidu.mapapi.map包,在下文中一共展示了BitmapDescriptor類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initBaiduMap
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
/**
* 初始化百度地圖
*/
private void initBaiduMap() {
// 設置是否顯示縮放控件
mMapView.showZoomControls(false);
mBaiduMap = mMapView.getMap();
// 設定地圖中心點坐標:寧波天翔貨櫃有限公司(雲台山路)
LatLng point = new LatLng(29.882673, 121.894326);
// 以動畫方式更新地圖狀態,動畫耗時默認 300 ms ,地圖支持的最大最小級別分別為[3-21]
mBaiduMap.animateMapStatus(MapStatusUpdateFactory.newLatLngZoom(point, 18));
// 定義Maker坐標點:寧波天翔貨櫃有限公司(雲台山路)
ArrayList<BitmapDescriptor> giflist = new ArrayList<>();
giflist.add(BitmapDescriptorFactory.fromResource(R.mipmap.ic_marker));
giflist.add(BitmapDescriptorFactory.fromResource(R.mipmap.ic_marker_light));
// 通過marker的icons設置一組圖片,再通過period設置多少幀刷新一次圖片資源
MarkerOptions mo = new MarkerOptions().position(point).icons(giflist).zIndex(0).period(20);
// 設置生長動畫/掉下動畫
// mo.animateType(MarkerOptions.MarkerAnimateType.drop);
// 在地圖上添加Marker,並顯示
mBaiduMap.addOverlay(mo);
}
示例2: addMarker
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
private void addMarker() {
if (stLatLng != null) {
BitmapDescriptor bitmap = BitmapDescriptorFactory.fromResource(R.drawable.ct_map_location_32);
OverlayOptions option = new MarkerOptions().position(stLatLng).icon(bitmap);
mBaiduMap.addOverlay(option);
}
if (msUpdate != null) {
mBaiduMap.setMapStatus(msUpdate);
}
if (polyline != null) {
mBaiduMap.addOverlay(polyline);
}
if (overlay != null) {
mBaiduMap.addOverlay(overlay);
}
}
示例3: initMaker
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
private void initMaker() {
for (FootInfo info : mFootList) {
if (info.geo != null) {
Double lat = Double.valueOf(info.geo.latitude);
Double lon = Double.valueOf(info.geo.longitude);
// 定義Maker坐標點
LatLng point = new LatLng(lat,lon);
// 構建Marker圖標
BitmapDescriptor bitmap = BitmapDescriptorFactory
.fromResource(R.drawable.icon_gcoding);
// 構建MarkerOption,用於在地圖上添加Marker
OverlayOptions option = new MarkerOptions().position(point)
.icon(bitmap).zIndex(19);
marker = (Marker)baiduMap.addOverlay(option);
}
}
mMapView.invalidate();
}
示例4: setMarker
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
/**
* 顯示地理標記
*
* @param mapView
* @param array
*/
@ReactProp(name="marker")
public void setMarker(MapView mapView, ReadableArray array) {
Log.d(TAG, "marker:" + array);
if (array != null) {
for (int i = 0; i < array.size(); i++) {
ReadableArray sub = array.getArray(i);
//定義Maker坐標點
LatLng point = new LatLng(sub.getDouble(0), sub.getDouble(1));
//構建Marker圖標
BitmapDescriptor bitmap = BitmapDescriptorFactory.fromResource(R.drawable.icon_gcoding);
//構建MarkerOption,用於在地圖上添加Marker
OverlayOptions option = new MarkerOptions()
.position(point)
.icon(bitmap)
.draggable(true);
//在地圖上添加Marker,並顯示
mapView.getMap().addOverlay(option);
}
}
}
示例5: getIconForStep
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
private BitmapDescriptor getIconForStep(TransitRouteLine.TransitStep step) {
switch (step.getStepType()) {
case BUSLINE:
return BitmapDescriptorFactory.fromAssetWithDpi("Icon_bus_station.png");
case SUBWAY:
return BitmapDescriptorFactory.fromAssetWithDpi("Icon_subway_station.png");
case WAKLING:
return BitmapDescriptorFactory.fromAssetWithDpi("Icon_walk_route.png");
default:
return null;
}
}
示例6: getIconForStep
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
private BitmapDescriptor getIconForStep(MassTransitRouteLine.TransitStep step) {
switch (step.getVehileType()) {
case ESTEP_WALK:
return BitmapDescriptorFactory.fromAssetWithDpi("Icon_walk_route.png");
case ESTEP_TRAIN:
return BitmapDescriptorFactory.fromAssetWithDpi("Icon_subway_station.png");
case ESTEP_DRIVING:
case ESTEP_COACH:
case ESTEP_PLANE:
case ESTEP_BUS:
return BitmapDescriptorFactory.fromAssetWithDpi("Icon_bus_station.png");
default:
return null;
}
}
示例7: getCustomTextureList
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
public List<BitmapDescriptor> getCustomTextureList() {
ArrayList<BitmapDescriptor> list = new ArrayList<BitmapDescriptor>();
list.add(BitmapDescriptorFactory.fromAsset("Icon_road_blue_arrow.png"));
list.add(BitmapDescriptorFactory.fromAsset("Icon_road_green_arrow.png"));
list.add(BitmapDescriptorFactory.fromAsset("Icon_road_yellow_arrow.png"));
list.add(BitmapDescriptorFactory.fromAsset("Icon_road_red_arrow.png"));
list.add(BitmapDescriptorFactory.fromAsset("Icon_road_nofocus.png"));
return list;
}
示例8: getStartMarker
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
@Override
public BitmapDescriptor getStartMarker() {
// if (useDefaultIcon) {
return BitmapDescriptorFactory.fromResource(R.mipmap.transparent_icon);
// }
// return null;
}
示例9: getTerminalMarker
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
@Override
public BitmapDescriptor getTerminalMarker() {
// if (useDefaultIcon) {
return BitmapDescriptorFactory.fromResource(R.mipmap.transparent_icon);
// }
// return null;
}
示例10: getBitmapDescriptor
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
@Override
public BitmapDescriptor getBitmapDescriptor() {
View headerView = LayoutInflater.from(mContext).inflate(R.layout.img_header,null);
mUserAvatar = headerView.findViewById(R.id.avator);
if(!mUserPic.equals("/d/file")){
String url = ApiService.BASEURLPIC + mUserPic;
OvLoad ovLoad = new OvLoad();
ovLoad.loadAvatorPicture(mContext,url,mUserAvatar);
// ovLoad.loadPicture(mActivity,url,mUserAvatar);
}
BitmapDescriptor bitmap = BitmapDescriptorFactory.fromView(headerView);
return bitmap;
}
示例11: onBeforeClusterRendered
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
/**
* Called before the marker for a Cluster is added to the map.在聚合物被放到地圖上之前調用
* The default implementation draws a circle with a rough count of the number of items.
* 默認生成一個帶有數字的圓
*/
protected void onBeforeClusterRendered(Cluster<T> cluster, MarkerOptions markerOptions) {
int bucket = getBucket(cluster);
BitmapDescriptor descriptor = mIcons.get(bucket);
if (descriptor == null) {
mColoredCircleBackground.getPaint().setColor(getColor());
Bitmap bitmap = mIconGenerator.makeIcon(getClusterText());
descriptor = BitmapDescriptorFactory.fromBitmap(bitmap);
mIcons.put(bucket, descriptor);
}
// TODO: consider adding anchor(.5, .5) (Individual markers will overlap more often)
markerOptions.icon(descriptor);
}
示例12: getStartMarker
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
@Override
public BitmapDescriptor getStartMarker() {
// if (useDefaultIcon) {
return BitmapDescriptorFactory.fromResource(R.mipmap.transparent_icon);
// }
// return null;
}
示例13: getTerminalMarker
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
@Override
public BitmapDescriptor getTerminalMarker() {
// if (useDefaultIcon) {
return BitmapDescriptorFactory.fromResource(R.mipmap.transparent_icon);
// }
// return null;
}
示例14: getStartMarker
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
@Override
public BitmapDescriptor getStartMarker() {
if (useDefaultIcon) {
return BitmapDescriptorFactory.fromResource(R.drawable.icon_st);
}
return null;
}
示例15: getTerminalMarker
import com.baidu.mapapi.map.BitmapDescriptor; //導入依賴的package包/類
@Override
public BitmapDescriptor getTerminalMarker() {
if (useDefaultIcon) {
return BitmapDescriptorFactory.fromResource(R.drawable.icon_en);
}
return null;
}