本文整理汇总了Java中com.baidu.mapapi.map.BaiduMap.OnMarkerClickListener类的典型用法代码示例。如果您正苦于以下问题:Java OnMarkerClickListener类的具体用法?Java OnMarkerClickListener怎么用?Java OnMarkerClickListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OnMarkerClickListener类属于com.baidu.mapapi.map.BaiduMap包,在下文中一共展示了OnMarkerClickListener类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initMarkerClickEvent
import com.baidu.mapapi.map.BaiduMap.OnMarkerClickListener; //导入依赖的package包/类
private void initMarkerClickEvent() {
mBaiduMap.setOnMarkerClickListener(new OnMarkerClickListener()
{
@Override
public boolean onMarkerClick(final Marker marker)
{
LatLng markerLat = marker.getPosition();
Point p = mBaiduMap.getProjection().toScreenLocation(markerLat);
//mMarkerInfoLy.setVisibility(View.VISIBLE);
View location = getPopCameraView();
p.y = -83;
mInfoWindow = new InfoWindow(location, markerLat,p.y);
mBaiduMap.showInfoWindow(mInfoWindow);
// Log.d("wang","setOnMarkerClickListener location.latitude is " + markerLat.latitude + " location.longitude is " + markerLat.longitude);
judgeClickCamera(markerLat);
flag = true;
return true;
}
});
}
开发者ID:liningwang,项目名称:camera,代码行数:23,代码来源:MainActivity.java
示例2: initMarkerClickEvent
import com.baidu.mapapi.map.BaiduMap.OnMarkerClickListener; //导入依赖的package包/类
private void initMarkerClickEvent() {
// 对Marker的点击
mBaiduMap.setOnMarkerClickListener(new OnMarkerClickListener() {
@Override
public boolean onMarkerClick(final Marker marker) {
// 将marker所在的经纬度的信息转化成屏幕上的坐标
System.out.println("点击marker:" + marker.getPosition() + marker.toString());
final LatLng ll = marker.getPosition();
int index = marker.getZIndex();
if (index == 2) {
float tempZoom = 18;
if (curZoom != 17)
tempZoom = curZoom + 1.0f;
showCurrtenStroeOnMap(ll, tempZoom);
} else {
// 获得marker中的数据
StoreData info = (StoreData) marker.getExtraInfo().get("info");
Bundle pBundle = new Bundle();
pBundle.putSerializable("data", info);
openActivity(StoreInformationActivity.class, pBundle);
}
return true;
}
});
}
开发者ID:poomoo,项目名称:eDao,代码行数:27,代码来源:MapActivity.java
示例3: onCreate
import com.baidu.mapapi.map.BaiduMap.OnMarkerClickListener; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_near);
allInc = (List<Incident>) getIntent().getBundleExtra("bundle")
.getSerializable("allInc");
troubleMaker = new ArrayList<Marker>();
crowdMaker = new ArrayList<Marker>();
clearMaker = new ArrayList<Marker>();
controlMaker = new ArrayList<Marker>();
initCheckBoxes();
locationMode = LocationMode.FOLLOWING;
bitmapDescriptor = null;
mapView = (MapView) findViewById(R.id.map_near);
baiduMap = mapView.getMap();
baiduMap.setMyLocationConfigeration(new MyLocationConfiguration(
locationMode, true, bitmapDescriptor));
baiduMap.setMyLocationEnabled(true);
baiduMap.setOnMarkerClickListener(new OnMarkerClickListener() {
@Override
public boolean onMarkerClick(Marker arg0) {
String type = arg0.getTitle();
String addr = arg0.getExtraInfo().getString("addr");
Button bubble = new Button(getApplicationContext());
bubble.setBackgroundResource(R.drawable.popup);
bubble.setText("类型:" + type + "\n" + "地点:" + addr);
InfoWindow window = new InfoWindow(bubble, arg0.getPosition(),
-70);
baiduMap.showInfoWindow(window);
return true;
}
});
locationClient = new LocationClient(this);
locationClient.registerLocationListener(new BDLocationListener() {
@Override
public void onReceiveLocation(BDLocation location) {
// TODO Auto-generated method stub
if (location == null || mapView == null)
return;
MyLocationData locationData = new MyLocationData.Builder()
.accuracy(location.getRadius()).direction(100)
.latitude(location.getLatitude())
.longitude(location.getLongitude()).build();
baiduMap.setMyLocationData(locationData);
if (isFirstLoc) {
isFirstLoc = false;
LatLng ll = new LatLng(location.getLatitude(), location
.getLongitude());
MapStatusUpdate update = MapStatusUpdateFactory
.newLatLng(ll);
baiduMap.animateMapStatus(update);
}
}
});
LocationClientOption clientOption = new LocationClientOption();
clientOption.setOpenGps(true);
clientOption.setCoorType("bd09ll");
clientOption.setScanSpan(1000);
locationClient.setLocOption(clientOption);
locationClient.start();
addSignals();
}
开发者ID:ShaunRain,项目名称:Traffic-Boy,代码行数:80,代码来源:NearActivity.java
注:本文中的com.baidu.mapapi.map.BaiduMap.OnMarkerClickListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论