本文整理汇总了Java中com.baidu.mapapi.map.ItemizedOverlay类的典型用法代码示例。如果您正苦于以下问题:Java ItemizedOverlay类的具体用法?Java ItemizedOverlay怎么用?Java ItemizedOverlay使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemizedOverlay类属于com.baidu.mapapi.map包,在下文中一共展示了ItemizedOverlay类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: showMap
import com.baidu.mapapi.map.ItemizedOverlay; //导入依赖的package包/类
private void showMap(double latitude, double longtitude, String address) {
sendButton.setVisibility(View.GONE);
GeoPoint point1 = new GeoPoint((int) (latitude * 1e6), (int) (longtitude * 1e6));
point1 = CoordinateConvert.fromGcjToBaidu(point1);
mMapController.setCenter(point1);
Drawable marker = this.getResources().getDrawable(R.drawable.icon_marka);
// 为maker定义位置和边界
marker.setBounds(0, 0, marker.getIntrinsicWidth(), marker.getIntrinsicHeight());
mAddrOverlay = new ItemizedOverlay<OverlayItem>(marker, mMapView);
GeoPoint point = new GeoPoint((int) (latitude * 1e6), (int) (longtitude * 1e6));
point = CoordinateConvert.fromGcjToBaidu(point);
OverlayItem addrItem = new OverlayItem(point, "", address);
mAddrOverlay.addItem(addrItem);
mMapView.getOverlays().add(mAddrOverlay);
mMapView.refresh();
}
开发者ID:macyuan,项目名称:TAG,代码行数:18,代码来源:BaiduMapActivity.java
示例2: addVenueLocations
import com.baidu.mapapi.map.ItemizedOverlay; //导入依赖的package包/类
public void addVenueLocations(List<BDLocation> locationList) {
ItemizedOverlay<OverlayItem> locationOverlay = new ItemizedOverlay<OverlayItem>(
getResources().getDrawable(R.drawable.ic_checkbox_selected),
mMapView);
mMapView.getOverlays().add(locationOverlay);
GeoPoint geoPoint = null;
for (BDLocation location : locationList) {
geoPoint = Utils.BDToGeoPoint(location);
locationOverlay.addItem(new OverlayItem(geoPoint, "A", "A"));
}
}
开发者ID:cuipengpeng,项目名称:p1-android,代码行数:13,代码来源:VenueActivity.java
示例3: showMapWithLocationClient
import com.baidu.mapapi.map.ItemizedOverlay; //导入依赖的package包/类
private void showMapWithLocationClient() {
progressDialog = new ProgressDialog(this);
progressDialog.setCanceledOnTouchOutside(false);
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setMessage("正在确定你的位置...");
progressDialog.setOnCancelListener(new OnCancelListener() {
public void onCancel(DialogInterface arg0) {
if (progressDialog.isShowing()) {
progressDialog.dismiss();
}
Log.d("map cancel retrieve location");
finish();
}
});
progressDialog.show();
mLocClient = new LocationClient(this);
mLocClient.registerLocationListener(myListener);
LocationClientOption option = new LocationClientOption();
option.setOpenGps(true);// 打开gps
// option.setCoorType("bd09ll"); //设置坐标类型
// Johnson change to use gcj02 coordination. chinese national standard
// so need to conver to bd09 everytime when draw on baidu map
option.setCoorType("gcj02");
option.setScanSpan(30000);
option.setAddrType("all");
mLocClient.setLocOption(option);
Drawable marker = this.getResources().getDrawable(R.drawable.icon_marka);
// 为maker定义位置和边界
marker.setBounds(0, 0, marker.getIntrinsicWidth(), marker.getIntrinsicHeight());
mAddrOverlay = new ItemizedOverlay<OverlayItem>(marker, mMapView);
mMapView.getOverlays().add(mAddrOverlay);
mMapListener = new MKMapViewListener() {
@Override
public void onMapMoveFinish() {
// TODO Auto-generated method stub
}
@Override
public void onClickMapPoi(MapPoi mapPoiInfo) {
// TODO Auto-generated method stub
String title = "";
if (mapPoiInfo != null) {
title = mapPoiInfo.strText;
Toast.makeText(BaiduMapActivity.this, title, Toast.LENGTH_SHORT).show();
}
}
@Override
public void onGetCurrentMap(Bitmap b) {
// TODO Auto-generated method stub
}
@Override
public void onMapAnimationFinish() {
}
};
mMapView.regMapViewListener(mBMapManager, mMapListener);
if (lastLocation != null) {
GeoPoint point1 = new GeoPoint((int) (lastLocation.getLatitude() * 1e6), (int) (lastLocation.getLongitude() * 1e6));
point1 = CoordinateConvert.fromGcjToBaidu(point1);
mMapController.setCenter(point1);
}
mMapView.refresh();
mMapView.invalidate();
}
开发者ID:macyuan,项目名称:TAG,代码行数:76,代码来源:BaiduMapActivity.java
示例4: addDriverOverlay
import com.baidu.mapapi.map.ItemizedOverlay; //导入依赖的package包/类
public void addDriverOverlay() {
Drawable mark = getResources().getDrawable(R.drawable.icon_marka);
itemOverlay = new ItemizedOverlay(mark, mMapView);
mMapView.getOverlays().add(itemOverlay);
}
开发者ID:townboy,项目名称:calltaxi,代码行数:6,代码来源:MapActivity.java
注:本文中的com.baidu.mapapi.map.ItemizedOverlay类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论