com.baidu.mapapi.map.MapPoi Java Examples

The following examples show how to use com.baidu.mapapi.map.MapPoi. 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: BaiduMapFragment.java    From BmapLite with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean onMapPoiClick(MapPoi mapPoi) {
    if (mIsModeRanging) {
        MyPoiModel poi = new MyPoiModel(TypeMap.TYPE_BAIDU);
        poi.setLatitude(mapPoi.getPosition().latitude);
        poi.setLongitude(mapPoi.getPosition().longitude);

        if (null == mPoiList) {
            mPoiList = new ArrayList<>();
        }
        mPoiList.add(poi);

        makeRangingMarker(poi);
        setRangingPolyLine();
    } else {
        if (null == clickMapPoiNow) {
            clickMapPoiNow = new MyPoiModel(TypeMap.TYPE_BAIDU);
        }

        clickMapPoiNow.setTypeMap(TypeMap.TYPE_BAIDU);
        clickMapPoiNow.setName(mapPoi.getName());
        clickMapPoiNow.setUid(mapPoi.getUid());
        clickMapPoiNow.setLatitude(mapPoi.getPosition().latitude);
        clickMapPoiNow.setLongitude(mapPoi.getPosition().longitude);
        makeMarker(clickMapPoiNow, true);
    }
    ((MainActivity) getActivity()).showSearchResultLay(false);

    return true;
}
 
Example #2
Source File: BaiduMapFragment.java    From BmapLite with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onMapPoiClick(MapPoi mapPoi) {
    if (mIsModeRanging) {
        MyPoiModel poi = new MyPoiModel(TypeMap.TYPE_BAIDU);
        poi.setLatitude(mapPoi.getPosition().latitude);
        poi.setLongitude(mapPoi.getPosition().longitude);

        if (null == mPoiList) {
            mPoiList = new ArrayList<>();
        }
        mPoiList.add(poi);

        makeRangingMarker(poi);
        setRangingPolyLine();
    } else {
        if (null == clickMapPoiNow) {
            clickMapPoiNow = new MyPoiModel(TypeMap.TYPE_BAIDU);
        }

        clickMapPoiNow.setTypeMap(TypeMap.TYPE_BAIDU);
        clickMapPoiNow.setName(mapPoi.getName());
        clickMapPoiNow.setUid(mapPoi.getUid());
        clickMapPoiNow.setLatitude(mapPoi.getPosition().latitude);
        clickMapPoiNow.setLongitude(mapPoi.getPosition().longitude);
        makeMarker(clickMapPoiNow, true);
    }
    ((MainActivity) getActivity()).showSearchResultLay(false);

    return true;
}
 
Example #3
Source File: NearbyGroupWithRedPocketMapViewActivity.java    From Social with Apache License 2.0 5 votes vote down vote up
private void initView(){
    infos = new ArrayList<RedPocketGroup>();

    fab_home = (FloatingActionButton)this.findViewById(R.id.id_nearby_group_with_redpocket_mapview_activity_fab_home);
    fab_home.setOnClickListener(this);

    if (is_first_page==1){
        fab_home.setVisibility(View.GONE);
    }else{
        fab_home.setVisibility(View.VISIBLE);
    }

    mapView = (MapView)this.findViewById(R.id.id_nearby_group_with_redpocket_mapview_activity_mapview);
    mBaiduMap  = mapView.getMap();

    rl_mark_info_container = (RelativeLayout)this.findViewById(R.id.id_nearby_group_with_redpocket_mapview_activity_mark_info_windows);
    rl_mark_info_container.setVisibility(View.INVISIBLE);

    mBaiduMap.setOnMapClickListener(new BaiduMap.OnMapClickListener() {
        @Override
        public void onMapClick(LatLng latLng) {
            rl_mark_info_container.setVisibility(View.INVISIBLE);
        }

        @Override
        public boolean onMapPoiClick(MapPoi mapPoi) {
            return false;
        }
    });
}
 
Example #4
Source File: MapListener.java    From react-native-baidu-map with MIT License 5 votes vote down vote up
@Override
public void onMapPoiClick(MapPoi mapPoi) {
    WritableMap writableMap = Arguments.createMap();
    writableMap.putString("name", mapPoi.getName());
    writableMap.putString("uid", mapPoi.getUid());
    writableMap.putDouble("latitude", mapPoi.getPosition().latitude);
    writableMap.putDouble("longitude", mapPoi.getPosition().longitude);
    mapView.getMap().hideInfoWindow();
    sendEvent(mapView, "onMapPoiClick", writableMap);
}
 
Example #5
Source File: RouteBaiduBusActivity.java    From BmapLite with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean onMapPoiClick(MapPoi mapPoi) {
    return false;
}
 
Example #6
Source File: RouteBaiduBusActivity.java    From BmapLite with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onMapPoiClick(MapPoi mapPoi) {
    return false;
}
 
Example #7
Source File: BusActivity.java    From BaiduMap-TrafficAssistant with MIT License 4 votes vote down vote up
@Override
public boolean onMapPoiClick(MapPoi poi) {
	return false;
}
 
Example #8
Source File: MapClickListener.java    From VirtualLocation with Apache License 2.0 2 votes vote down vote up
/**
 * 地图内 Poi 单击事件
 * @param mapPoi  点击的 poi 信息
 * @return
 */
@Override
public boolean onMapPoiClick(MapPoi mapPoi) {
    return false;
}