Java 类com.baidu.mapapi.map.BitmapDescriptor 实例源码

项目:TYT    文件:CB_BaiduMapActivity.java   
/**
 * 初始化百度地图
 */
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);
}
项目:ChangTu    文件:TrackActivity.java   
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);
    }


}
项目:travelinfo    文件:FootMapActivity.java   
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();

    }
项目:BaiduMapKit    文件:BaiduMapViewManager.java   
/**
 * 显示地理标记
 *
 * @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);
        }
    }
}
项目:GitHub    文件:TransitRouteOverlay.java   
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;
    }
}
项目:GitHub    文件:MassTransitRouteOverlay.java   
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;
    }
}
项目:GitHub    文件:DrivingRouteOverlay.java   
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;
}
项目:GitHub    文件:MainActivity.java   
@Override
        public BitmapDescriptor getStartMarker() {
//            if (useDefaultIcon) {
            return BitmapDescriptorFactory.fromResource(R.mipmap.transparent_icon);
//            }
//            return null;
        }
项目:GitHub    文件:MainActivity.java   
@Override
        public BitmapDescriptor getTerminalMarker() {
//            if (useDefaultIcon) {
            return BitmapDescriptorFactory.fromResource(R.mipmap.transparent_icon);
//            }
//            return null;
        }
项目:Tribe    文件:MyItem.java   
@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;
    }
项目:Tribe    文件:DefaultClusterRenderer.java   
/**
 * 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);
}
项目:GCSApp    文件:TransitRouteOverlay.java   
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;
    }
}
项目:GCSApp    文件:MassTransitRouteOverlay.java   
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;
    }
}
项目:GCSApp    文件:DrivingRouteOverlay.java   
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;
}
项目:Mobike    文件:TransitRouteOverlay.java   
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;
    }
}
项目:Mobike    文件:MassTransitRouteOverlay.java   
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;
    }
}
项目:Mobike    文件:DrivingRouteOverlay.java   
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;
}
项目:Mobike    文件:MainActivity.java   
@Override
public BitmapDescriptor getStartMarker() {
    //            if (useDefaultIcon) {
    return BitmapDescriptorFactory.fromResource(R.mipmap.transparent_icon);
    //            }
    //            return null;
}
项目:Mobike    文件:MainActivity.java   
@Override
public BitmapDescriptor getTerminalMarker() {
    //            if (useDefaultIcon) {
    return BitmapDescriptorFactory.fromResource(R.mipmap.transparent_icon);
    //            }
    //            return null;
}
项目:AndroidOpen    文件:GeoCodeActivity.java   
@Override
public BitmapDescriptor getStartMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_st);
    }
    return null;
}
项目:AndroidOpen    文件:GeoCodeActivity.java   
@Override
public BitmapDescriptor getTerminalMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_en);
    }
    return null;
}
项目:AndroidOpen    文件:GeoCodeActivity.java   
@Override
public BitmapDescriptor getStartMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_st);
    }
    return null;
}
项目:AndroidOpen    文件:GeoCodeActivity.java   
@Override
public BitmapDescriptor getTerminalMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_en);
    }
    return null;
}
项目:AndroidOpen    文件:GeoCodeActivity.java   
@Override
public BitmapDescriptor getStartMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_st);
    }
    return null;
}
项目:AndroidOpen    文件:GeoCodeActivity.java   
@Override
public BitmapDescriptor getTerminalMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_en);
    }
    return null;
}
项目:AndroidOpen    文件:TransitRouteOverlay.java   
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;
    }
}
项目:AndroidOpen    文件:DrivingRouteOverlay.java   
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;
}
项目:AndroidOpen    文件:RoutePlanDemo.java   
@Override
public BitmapDescriptor getStartMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_st);
    }
    return null;
}
项目:AndroidOpen    文件:RoutePlanDemo.java   
@Override
public BitmapDescriptor getTerminalMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_en);
    }
    return null;
}
项目:AndroidOpen    文件:RoutePlanDemo.java   
@Override
public BitmapDescriptor getStartMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_st);
    }
    return null;
}
项目:AndroidOpen    文件:RoutePlanDemo.java   
@Override
public BitmapDescriptor getTerminalMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_en);
    }
    return null;
}
项目:AndroidOpen    文件:RoutePlanDemo.java   
@Override
public BitmapDescriptor getStartMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_st);
    }
    return null;
}
项目:AndroidOpen    文件:RoutePlanDemo.java   
@Override
public BitmapDescriptor getTerminalMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_en);
    }
    return null;
}
项目:AndroidOpen    文件:RoutePlanDemo.java   
@Override
public BitmapDescriptor getStartMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_st);
    }
    return null;
}
项目:AndroidOpen    文件:RoutePlanDemo.java   
@Override
public BitmapDescriptor getTerminalMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_en);
    }
    return null;
}
项目:Swap    文件:DrivingRouteOverlay.java   
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;
}
项目:SmartTransXA    文件:TransferOnlineActivity.java   
@Override
public BitmapDescriptor getStartMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_st);
    }
    return null;
}
项目:SmartTransXA    文件:TransferOnlineActivity.java   
@Override
public BitmapDescriptor getTerminalMarker() {
    if (useDefaultIcon) {
        return BitmapDescriptorFactory.fromResource(R.drawable.icon_en);
    }
    return null;
}
项目:SmartTransXA    文件:TransitRouteOverlay.java   
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;
    }
}
项目:MyCar    文件:AroundSearchActivity.java   
private void showMap(double latitude, double longtitude) {
    LatLng point = new LatLng(latitude, longtitude);
    BitmapDescriptor bitmap = null;
    bitmap = BitmapDescriptorFactory.fromResource(R.mipmap.lock);
    OverlayOptions option = new MarkerOptions().position(point).icon(bitmap);
    // 在地图上添加Marker,并显示
    mBaiduMap.addOverlay(option);
    mBaiduMap.setMapStatus(MapStatusUpdateFactory.newLatLng(point));
    //设置缩放级别为500米
    mBaiduMap.setMapStatus(MapStatusUpdateFactory.newMapStatus(new MapStatus.Builder().zoom(15).build()));
}