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

项目:AssistantBySDK    文件:SetFavoriteMapActivity.java   
/**
 * 定位接收到的地址
 **/
private void locationReceiveAddress() {
    if (receiveAddress == null) {
        return;
    }
    LatLng p = new LatLng(receiveAddress.getLatitude(), receiveAddress.getLongitude());
    MarkerOptions markerOptions = new MarkerOptions();
    /* 设置覆盖物图标 */
    markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.icon_openmap_focuse_mark))
            .position(p)
            .visible(true);
    baiduMap.setOnMarkerClickListener(new BaiduMap.OnMarkerClickListener() {
        @Override
        public boolean onMarkerClick(Marker marker) {
            setSinglePoiDetail();
            return true;
        }
    });
    if (NetUtil.getInstance(SetFavoriteMapActivity.this).getCurrentNetType().equals(NetUtil.NetType.NETWORK_TYPE_NONE)) {
        // Snackbar.make(mAmosfPoiList,mAppConfig.getResources().getString(R.string.no_network), Snackbar.LENGTH_SHORT).show();
        return;
    }
    /* 添加覆盖图层 */
    baiduMap.addOverlay(markerOptions);
    baiduMap.setMapStatus(MapStatusUpdateFactory.newLatLngZoom(p, 17F));
}
项目:GitHub    文件:IndoorPoiOverlay.java   
@Override
public final List<OverlayOptions> getOverlayOptions() {
    if (mIndoorPoiResult == null || mIndoorPoiResult.getmArrayPoiInfo() == null) {
        return null;
    }
    List<OverlayOptions> markerList = new ArrayList<OverlayOptions>();
    int markerSize = 0;
    for (int i = 0; i < mIndoorPoiResult.getmArrayPoiInfo().size()
            && markerSize < MAX_POI_SIZE; i++) {
        if (mIndoorPoiResult.getmArrayPoiInfo().get(i).latLng == null) {
            continue;
        }
        markerSize++;
        Bundle bundle = new Bundle();
        bundle.putInt("index", i);
        markerList.add(new MarkerOptions()
                .icon(BitmapDescriptorFactory.fromAssetWithDpi("Icon_mark"
                        + markerSize + ".png")).extraInfo(bundle)
                .position(mIndoorPoiResult.getmArrayPoiInfo().get(i).latLng));

    }
    return markerList;
}
项目:GitHub    文件:PoiOverlay.java   
@Override
public final List<OverlayOptions> getOverlayOptions() {
    if (mPoiResult == null || mPoiResult.getAllPoi() == null) {
        return null;
    }
    List<OverlayOptions> markerList = new ArrayList<OverlayOptions>();
    int markerSize = 0;
    for (int i = 0; i < mPoiResult.getAllPoi().size()
            && markerSize < MAX_POI_SIZE; i++) {
        if (mPoiResult.getAllPoi().get(i).location == null) {
            continue;
        }
        markerSize++;
        Bundle bundle = new Bundle();
        bundle.putInt("index", i);
        markerList.add(new MarkerOptions()
                .icon(BitmapDescriptorFactory.fromAssetWithDpi("Icon_mark"
                        + markerSize + ".png")).extraInfo(bundle)
                .position(mPoiResult.getAllPoi().get(i).location));

    }
    return markerList;
}
项目: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);
}
项目:Mobike    文件:IndoorPoiOverlay.java   
@Override
public final List<OverlayOptions> getOverlayOptions() {
    if (mIndoorPoiResult == null || mIndoorPoiResult.getmArrayPoiInfo() == null) {
        return null;
    }
    List<OverlayOptions> markerList = new ArrayList<OverlayOptions>();
    int markerSize = 0;
    for (int i = 0; i < mIndoorPoiResult.getmArrayPoiInfo().size()
            && markerSize < MAX_POI_SIZE; i++) {
        if (mIndoorPoiResult.getmArrayPoiInfo().get(i).latLng == null) {
            continue;
        }
        markerSize++;
        Bundle bundle = new Bundle();
        bundle.putInt("index", i);
        markerList.add(new MarkerOptions()
                .icon(BitmapDescriptorFactory.fromAssetWithDpi("Icon_mark"
                        + markerSize + ".png")).extraInfo(bundle)
                .position(mIndoorPoiResult.getmArrayPoiInfo().get(i).latLng));

    }
    return markerList;
}
项目:Mobike    文件:PoiOverlay.java   
@Override
public final List<OverlayOptions> getOverlayOptions() {
    if (mPoiResult == null || mPoiResult.getAllPoi() == null) {
        return null;
    }
    List<OverlayOptions> markerList = new ArrayList<OverlayOptions>();
    int markerSize = 0;
    for (int i = 0; i < mPoiResult.getAllPoi().size()
            && markerSize < MAX_POI_SIZE; i++) {
        if (mPoiResult.getAllPoi().get(i).location == null) {
            continue;
        }
        markerSize++;
        Bundle bundle = new Bundle();
        bundle.putInt("index", i);
        markerList.add(new MarkerOptions()
                .icon(BitmapDescriptorFactory.fromAssetWithDpi("Icon_mark"
                        + markerSize + ".png")).extraInfo(bundle)
                .position(mPoiResult.getAllPoi().get(i).location));

    }
    return markerList;
}
项目:Mobike    文件:MainActivity.java   
private void initViews() {
    initKefuPopu();
    mTvPrices = (TextView) findViewById(R.id.tv_prices);
    mTvDistance = (TextView) findViewById(R.id.tv_distance);
    mMinute = (TextView) findViewById(R.id.minute);
    if (isNeedLogin) {
        mLogin.setVisibility(View.VISIBLE);
    } else {
        mLogin.setVisibility(View.GONE);
    }
    mScan_qrcode.setVisibility(View.VISIBLE);
    mBikeInfoBoard.setVisibility(View.GONE);
    mConfirm_cancle.setVisibility(View.GONE);
    mBikeOrderBoard.setVisibility(View.GONE);
    mBtLoginOrorder.setVisibility(View.GONE);
    mBikeInfoBoard.setVisibility(View.GONE);
    dragLocationIcon = BitmapDescriptorFactory.fromResource(R.mipmap.drag_location);
    bikeIcon = BitmapDescriptorFactory.fromResource(R.mipmap.bike_icon);
    setMyClickable(mTvAllmobike);
    baiduMap = mBaiduMap.getMap();
    baiduMap.setOnMapStatusChangeListener(changeListener);
}
项目:AndroidOpen    文件:PoiOverlay.java   
@Override
public final List<OverlayOptions> getOverlayOptions() {
    if (mPoiResult == null || mPoiResult.getAllPoi() == null) {
        return null;
    }
    List<OverlayOptions> markerList = new ArrayList<OverlayOptions>();
    int markerSize = 0;
    for (int i = 0; i < mPoiResult.getAllPoi().size()
            && markerSize < MAX_POI_SIZE; i++) {
        if (mPoiResult.getAllPoi().get(i).location == null) {
            continue;
        }
        markerSize++;
        Bundle bundle = new Bundle();
        bundle.putInt("index", i);
        markerList.add(new MarkerOptions()
                .icon(BitmapDescriptorFactory.fromAssetWithDpi("Icon_mark"
                        + markerSize + ".png")).extraInfo(bundle)
                .position(mPoiResult.getAllPoi().get(i).location));

    }
    return markerList;
}
项目:Coding-Android    文件:LocationMapActivity.java   
private void toggleInfoWindow(Marker marker) {
    if (marker == null || mapView == null || mapView.getMap() == null) return;
    if (isInfoWindowShown) {
        mapView.getMap().hideInfoWindow();
        isInfoWindowShown = false;
    } else {
        // sdk示例代码是用application context来创建infoWindow上的View的
        // 如果该view直接放在activity上,重复执行show/hide/show会出错
        View view = LayoutInflater.from(getApplicationContext())
                .inflate(R.layout.locatino_map_point, null);
        TextView textView = (TextView) view.findViewById(R.id.textView);
        textView.setText(marker.getTitle());
        int yOffset = (int) (0.5f + TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 40, getResources().getDisplayMetrics()));
        mapView.getMap().showInfoWindow(new InfoWindow(
                BitmapDescriptorFactory.fromView(textView),
                new LatLng(latitude, longitude), -yOffset, null));
        isInfoWindowShown = true;
    }
}
项目:ChangTu    文件:TrackActivity.java   
/**
 * 画出实时线路点
 *
 * @param point
 */
private void drawRealtimePoint(LatLng point) {
    Log.i("TGA", "绘制成功");
    mBaiduMap.clear();
    MapStatus mapStatus = new MapStatus.Builder().target(point).zoom(18).build();
    msUpdate = MapStatusUpdateFactory.newMapStatus(mapStatus);
    realtimeBitmap = BitmapDescriptorFactory.fromResource(R.drawable.ct_map_location);
    overlay = new MarkerOptions().position(point)
            .icon(realtimeBitmap).zIndex(9).draggable(true);


    if (pointList.size() >= 2 && pointList.size() <= 6000) {
        polyline = new PolylineOptions().width(10).color(Color.GREEN).points(pointList);
    }

    addMarker();
}
项目: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);
    }


}
项目:MyCar    文件:PoiOverlay.java   
@Override
public final List<OverlayOptions> getOverlayOptions() {
    if (mPoiResult == null || mPoiResult.getAllPoi() == null) {
        return null;
    }
    List<OverlayOptions> markerList = new ArrayList<OverlayOptions>();
    int markerSize = 0;
    for (int i = 0; i < mPoiResult.getAllPoi().size()
            && markerSize < MAX_POI_SIZE; i++) {
        if (mPoiResult.getAllPoi().get(i).location == null) {
            continue;
        }
        markerSize++;
        Bundle bundle = new Bundle();
        bundle.putInt("index", i);
        markerList.add(new MarkerOptions()
                .icon(BitmapDescriptorFactory.fromAssetWithDpi("Icon_mark"
                        + markerSize + ".png")).extraInfo(bundle)
                .position(mPoiResult.getAllPoi().get(i).location));

    }
    return markerList;
}
项目:Tower-develop    文件:BaiduMapFragment.java   
private MarkerOptions fromMarkerInfo(MarkerInfo markerInfo, boolean isDraggable) {
    final LatLong coord = markerInfo.getPosition();
    if (coord == null) {
        return null;
    }

    final MarkerOptions markerOptions = new MarkerOptions()
        .position(MapUtils.coordToBaiduLatLng(coord))
        .draggable(isDraggable)
        .alpha(markerInfo.getAlpha())
        .anchor(markerInfo.getAnchorU(), markerInfo.getAnchorV())
        .rotate(markerInfo.getRotation())
        .title(markerInfo.getTitle())
        .flat(markerInfo.isFlat())
        .visible(markerInfo.isVisible());

    final Bitmap markerIcon = markerInfo.getIcon(getResources());
    if (markerIcon != null) {
        markerOptions.icon(BitmapDescriptorFactory.fromBitmap(markerIcon));
    }

    return markerOptions;
}
项目:MyStudyHelper    文件:MapActivity.java   
/**
 * 初始化地图
 */
private void initMapView() {
    //设定中心点坐标

    myLatLng = new LatLng(Const.LATITUDE_OF_MY_LOCATION,Const.LONGITUDE_OF_MY_LOCATION);
    //定义地图状态
    MapStatus mMapStatus = new MapStatus.Builder()
            .target(myLatLng)
            .zoom(18)
            .build();
    //定义MapStatusUpdate对象,以便描述地图状态将要发生的变化
    bd = BitmapDescriptorFactory
            .fromResource(R.drawable.icon_gcoding);
    MarkerOptions markerOptions = new MarkerOptions().position(myLatLng).icon(bd);
    mBaiduMap.addOverlay(markerOptions);
    MapStatusUpdate mMapStatusUpdate = MapStatusUpdateFactory.newMapStatus(mMapStatus);
    //改变地图状态
    mBaiduMap.setMapStatus(mMapStatusUpdate);
}
项目:droidplanner-master    文件:BaiduMapFragment.java   
private void generateMarker(MarkerInfo markerInfo, LatLng position, boolean isDraggable) {

        Log.v("123","SSSSSSSSSSSSSSSSSSSSSSSSSSSSS");
        final MarkerOptions markerOptions = new MarkerOptions()
                .position(position)
                .draggable(isDraggable)
                .anchor(markerInfo.getAnchorU(), markerInfo.getAnchorV())
                .title(markerInfo.getSnippet()).title(markerInfo.getTitle());

        final Bitmap markerIcon = markerInfo.getIcon(getResources());
        if (markerIcon != null) {
            markerOptions.icon(BitmapDescriptorFactory.fromBitmap(markerIcon));
        }
        else
        {
            markerOptions.icon(BitmapDescriptorFactory
                    .fromResource(R.drawable.ic_marker_white));
        }

        Marker marker = (Marker)getBaiduMap().addOverlay(markerOptions);
        mBiMarkersMap.put(markerInfo, marker);
    }
项目:FindYou    文件:IndoorPoiOverlay.java   
@Override
public final List<OverlayOptions> getOverlayOptions() {
    if (mIndoorPoiResult == null || mIndoorPoiResult.getmArrayPoiInfo() == null) {
        return null;
    }
    List<OverlayOptions> markerList = new ArrayList<OverlayOptions>();
    int markerSize = 0;
    for (int i = 0; i < mIndoorPoiResult.getmArrayPoiInfo().size()
            && markerSize < MAX_POI_SIZE; i++) {
        if (mIndoorPoiResult.getmArrayPoiInfo().get(i).latLng == null) {
            continue;
        }
        markerSize++;
        Bundle bundle = new Bundle();
        bundle.putInt("index", i);
        markerList.add(new MarkerOptions()
                .icon(BitmapDescriptorFactory.fromAssetWithDpi("Icon_mark"
                        + markerSize + ".png")).extraInfo(bundle)
                .position(mIndoorPoiResult.getmArrayPoiInfo().get(i).latLng));

    }
    return markerList;
}
项目:FindYou    文件:PoiOverlay.java   
@Override
public final List<OverlayOptions> getOverlayOptions() {
    if (mPoiResult == null || mPoiResult.getAllPoi() == null) {
        return null;
    }
    List<OverlayOptions> markerList = new ArrayList<OverlayOptions>();
    int markerSize = 0;
    for (int i = 0; i < mPoiResult.getAllPoi().size()
            && markerSize < MAX_POI_SIZE; i++) {
        if (mPoiResult.getAllPoi().get(i).location == null) {
            continue;
        }
        markerSize++;
        Bundle bundle = new Bundle();
        bundle.putInt("index", i);
        markerList.add(new MarkerOptions()
                .icon(BitmapDescriptorFactory.fromAssetWithDpi("Icon_mark"
                        + markerSize + ".png")).extraInfo(bundle)
                .position(mPoiResult.getAllPoi().get(i).location));

    }
    return markerList;
}
项目:nongfei-missionplane    文件:BaiduMapFragment.java   
private void generateMarker(MarkerInfo markerInfo, LatLng position, boolean isDraggable) {

        Log.v("123","SSSSSSSSSSSSSSSSSSSSSSSSSSSSS");
        final MarkerOptions markerOptions = new MarkerOptions()
                .position(position)
                .draggable(isDraggable)
                .anchor(markerInfo.getAnchorU(), markerInfo.getAnchorV())
                .title(markerInfo.getSnippet()).title(markerInfo.getTitle());

        final Bitmap markerIcon = markerInfo.getIcon(getResources());
        if (markerIcon != null) {
            markerOptions.icon(BitmapDescriptorFactory.fromBitmap(markerIcon));
        }
        else
        {
            markerOptions.icon(BitmapDescriptorFactory
                    .fromResource(R.drawable.ic_marker_white));
        }

        Marker marker = (Marker)getBaiduMap().addOverlay(markerOptions);
        mBiMarkersMap.put(markerInfo, marker);
    }
项目: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();

    }
项目:Gprs_droidplanner    文件:BaiduMapFragment.java   
private void generateMarker(MarkerInfo markerInfo, LatLng position, boolean isDraggable) {

        Log.v("123","SSSSSSSSSSSSSSSSSSSSSSSSSSSSS");
        final MarkerOptions markerOptions = new MarkerOptions()
                .position(position)
                .draggable(isDraggable)
                .anchor(markerInfo.getAnchorU(), markerInfo.getAnchorV())
                .title(markerInfo.getSnippet()).title(markerInfo.getTitle());

        final Bitmap markerIcon = markerInfo.getIcon(getResources());
        if (markerIcon != null) {
            markerOptions.icon(BitmapDescriptorFactory.fromBitmap(markerIcon));
        }
        else
        {
            markerOptions.icon(BitmapDescriptorFactory
                    .fromResource(R.drawable.ic_marker_white));
        }

        Marker marker = (Marker)getBaiduMap().addOverlay(markerOptions);
        mBiMarkersMap.put(markerInfo, marker);
    }
项目: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);
        }
    }
}
项目:HaHaMap    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    SDKInitializer.initialize(getApplicationContext());
    setContentView(R.layout.activity_main);

    mMapView = (MapView) findViewById(R.id.bmapView);
    mBaiduMap = mMapView.getMap();

    mBaiduMap.setMyLocationEnabled(true);

    mBaiduMap.setOnMarkerClickListener(mOnMarkerClickListener);

    LatLng centLl = MyUtils.getLlByIntent(getIntent());
    MyUtils.initMapCenter(centLl, mBaiduMap);
    mBdA = BitmapDescriptorFactory.fromResource(R.drawable.icon_marka);
    mMarker = MyUtils.addOverLayToMap(mBdA, centLl, mBaiduMap);
}
项目:HaHaMap    文件:GeoCoderActivity.java   
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_geocoder);
    CharSequence titleLable = "地理编码功能";
    setTitle(titleLable);

    // 地图初始化
    mMapView = (MapView) findViewById(R.id.bmapView);
    mBaiduMap = mMapView.getMap();

    mBaiduMap.setOnMarkerClickListener(mOnMarkerClickListener);

    // 初始化搜索模块,注册事件监听
    mSearch = GeoCoder.newInstance();
    mSearch.setOnGetGeoCodeResultListener(this);

    mCenterLatLng = MyUtils.getLlByIntent(getIntent());
    MyUtils.initMapCenter(mCenterLatLng, mBaiduMap);
    mMarkerA = MyUtils.addOverLayToMap(
            BitmapDescriptorFactory.fromResource(R.drawable.icon_marka),
            mCenterLatLng, mBaiduMap);

}
项目:HaHaMap    文件:GeoCoderActivity.java   
@Override
public void onGetGeoCodeResult(GeoCodeResult result) {
    if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
        Toast.makeText(GeoCoderActivity.this, "抱歉,未能找到结果",
                Toast.LENGTH_LONG).show();
        return;
    }
    if (mMarkerB != null) {
        mMarkerB.remove();
    }
    mMarkerB = MyUtils.addOverLayToMap(
            BitmapDescriptorFactory.fromResource(R.drawable.icon_markb),
            result.getLocation(), mBaiduMap);

    mBaiduMap.setMapStatus(MapStatusUpdateFactory.newLatLng(result
            .getLocation()));

    String strInfo = String.format("纬度:%.1f 经度:%.1f",
            result.getLocation().latitude, result.getLocation().longitude);
    Toast.makeText(GeoCoderActivity.this, strInfo, Toast.LENGTH_LONG)
            .show();

    getDistance(mCenterLatLng, result.getLocation());

}
项目:HaHaMap    文件:GeoCoderActivity.java   
@Override
public void onGetReverseGeoCodeResult(ReverseGeoCodeResult result) {
    if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
        Toast.makeText(GeoCoderActivity.this, "抱歉,未能找到结果",
                Toast.LENGTH_LONG).show();
        return;
    }
    if (mMarkerC != null) {
        mMarkerC.remove();
    }
    mMarkerC = MyUtils.addOverLayToMap(
            BitmapDescriptorFactory.fromResource(R.drawable.icon_markc),
            result.getLocation(), mBaiduMap);

    mBaiduMap.setMapStatus(MapStatusUpdateFactory.newLatLng(result
            .getLocation()));

    Toast.makeText(GeoCoderActivity.this, result.getAddress(),
            Toast.LENGTH_LONG).show();

    getDistance(mCenterLatLng, result.getLocation());

}
项目:GitHub    文件:BusLineOverlay.java   
@Override
public final List<OverlayOptions> getOverlayOptions() {

    if (mBusLineResult == null || mBusLineResult.getStations() == null) {
        return null;
    }
    List<OverlayOptions> overlayOptionses = new ArrayList<OverlayOptions>();
    for (BusLineResult.BusStation station : mBusLineResult.getStations()) {
        overlayOptionses.add(new MarkerOptions()
                .position(station.getLocation())
                        .zIndex(10)
                                .anchor(0.5f, 0.5f)
                                        .icon(BitmapDescriptorFactory
                                                .fromAssetWithDpi("Icon_bus_station.png")));
    }

    List<LatLng> points = new ArrayList<LatLng>();
    for (BusLineResult.BusStep step : mBusLineResult.getSteps()) {
        if (step.getWayPoints() != null) {
            points.addAll(step.getWayPoints());
        }
    }
    if (points.size() > 0) {
        overlayOptionses
                .add(new PolylineOptions().width(10)
                        .color(Color.argb(178, 0, 78, 255)).zIndex(0)
                                .points(points));
    }
    return overlayOptionses;
}
项目: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   
private void initNearestBike(final BikeInfo bikeInfo, LatLng ll) {
    ImageView nearestIcon = new ImageView(getApplicationContext());
    nearestIcon.setImageResource(R.mipmap.nearest_icon);
    InfoWindow.OnInfoWindowClickListener listener = null;
    listener = new InfoWindow.OnInfoWindowClickListener() {
        public void onInfoWindowClick() {
            updateBikeInfo(bikeInfo);
            mBaiduMap.hideInfoWindow();
        }
    };
    InfoWindow mInfoWindow = new InfoWindow(BitmapDescriptorFactory.fromView(nearestIcon), ll, -108, listener);
    mBaiduMap.showInfoWindow(mInfoWindow);
}
项目: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;
        }
项目:AssistantBySDK    文件:SetFavoriteMapActivity.java   
public void setOverlayOptions(List<BaiduAddress> list) {
    if (list == null || list.size() == 0)
        return;
    overlayOptionses = new ArrayList<>();
    int l = Math.min(list.size(), 10);
    for (int i = 0; i < l; ++i) {
        Bundle bundle = new Bundle();
        bundle.putInt("index", i);
        overlayOptionses.add((new MarkerOptions()).icon(
                BitmapDescriptorFactory.fromAssetWithDpi("Icon_mark" + (i + 1) + ".png")).
                extraInfo(bundle).
                position(new LatLng(list.get(i).getLatitude(), list.get(i).getLongitude())));
    }
}
项目:AssistantBySDK    文件:NaviConfirmPointActivity.java   
/**
 * 设置图层参数
 **/
public void setOverlayOptions(List<BaiduAddress> list) {
    if (list == null || list.size() == 0)
        return;
    overlayOptionses = new ArrayList<>();
    int l = Math.min(list.size(), 10);
    for (int i = 0; i < l; ++i) {
        Bundle bundle = new Bundle();
        bundle.putInt("index", i);
        overlayOptionses.add((new MarkerOptions()).icon(
                BitmapDescriptorFactory.fromAssetWithDpi("Icon_mark" + (i + 1) + ".png")).
                extraInfo(bundle).
                position(new LatLng(list.get(i).getLatitude(), list.get(i).getLongitude())));
    }
}
项目:AssistantBySDK    文件:TrafficShowPresenter.java   
public void setOverlayOptions(List<BaiduAddress> list) {
    if (list == null || list.size() == 0)
        return;
    overlayOptionses = new ArrayList<>();
    int l = Math.min(list.size(), 10);
    for (int i = 0; i < l; ++i) {
        Bundle bundle = new Bundle();
        bundle.putInt("index", i);
        overlayOptionses.add((new MarkerOptions()).icon(
                BitmapDescriptorFactory.fromAssetWithDpi("Icon_mark" + (i + 1) + ".png")).
                extraInfo(bundle).
                position(new LatLng(list.get(i).getLatitude(), list.get(i).getLongitude())));
    }
}
项目:KTalk    文件:EaseBaiduMapActivity.java   
private void showMap(double latitude, double longtitude, String address) {
    sendButton.setVisibility(View.GONE);
    LatLng llA = new LatLng(latitude, longtitude);
    CoordinateConverter converter= new CoordinateConverter();
    converter.coord(llA);
    converter.from(CoordinateConverter.CoordType.COMMON);
    LatLng convertLatLng = converter.convert();
    OverlayOptions ooA = new MarkerOptions().position(convertLatLng).icon(BitmapDescriptorFactory
            .fromResource(R.drawable.ease_icon_marka))
            .zIndex(4).draggable(true);
    mBaiduMap.addOverlay(ooA);
    MapStatusUpdate u = MapStatusUpdateFactory.newLatLngZoom(convertLatLng, 17.0f);
    mBaiduMap.animateMapStatus(u);
}
项目:KTalk    文件:EaseBaiduMapActivity.java   
@Override
public void onReceiveLocation(BDLocation location) {
    if (location == null) {
        return;
    }
    Log.d("map", "On location change received:" + location);
    Log.d("map", "addr:" + location.getAddrStr());
    sendButton.setEnabled(true);
    if (progressDialog != null) {
        progressDialog.dismiss();
    }

    if (lastLocation != null) {
        if (lastLocation.getLatitude() == location.getLatitude() && lastLocation.getLongitude() == location.getLongitude()) {
            Log.d("map", "same location, skip refresh");
            // mMapView.refresh(); //need this refresh?
            return;
        }
    }
    lastLocation = location;
    mBaiduMap.clear();
    LatLng llA = new LatLng(lastLocation.getLatitude(), lastLocation.getLongitude());
    CoordinateConverter converter= new CoordinateConverter();
    converter.coord(llA);
    converter.from(CoordinateConverter.CoordType.COMMON);
    LatLng convertLatLng = converter.convert();
    OverlayOptions ooA = new MarkerOptions().position(convertLatLng).icon(BitmapDescriptorFactory
            .fromResource(R.drawable.ease_icon_marka))
            .zIndex(4).draggable(true);
    mBaiduMap.addOverlay(ooA);
    MapStatusUpdate u = MapStatusUpdateFactory.newLatLngZoom(convertLatLng, 17.0f);
    mBaiduMap.animateMapStatus(u);
}
项目: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);
}
项目:FanChat    文件:EaseBaiduMapActivity.java   
private void showMap(double latitude, double longtitude, String address) {
    sendButton.setVisibility(View.GONE);
    LatLng llA = new LatLng(latitude, longtitude);
    CoordinateConverter converter= new CoordinateConverter();
    converter.coord(llA);
    converter.from(CoordinateConverter.CoordType.COMMON);
    LatLng convertLatLng = converter.convert();
    OverlayOptions ooA = new MarkerOptions().position(convertLatLng).icon(BitmapDescriptorFactory
            .fromResource(R.drawable.ease_icon_marka))
            .zIndex(4).draggable(true);
    mBaiduMap.addOverlay(ooA);
    MapStatusUpdate u = MapStatusUpdateFactory.newLatLngZoom(convertLatLng, 17.0f);
    mBaiduMap.animateMapStatus(u);
}