本文整理汇总了Java中com.baidu.mapapi.map.Marker.getPosition方法的典型用法代码示例。如果您正苦于以下问题:Java Marker.getPosition方法的具体用法?Java Marker.getPosition怎么用?Java Marker.getPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.baidu.mapapi.map.Marker
的用法示例。
在下文中一共展示了Marker.getPosition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMarkerClick
import com.baidu.mapapi.map.Marker; //导入方法依赖的package包/类
@Override
public boolean onMarkerClick(Marker marker) {
Log.d("lml", "MapFragment:覆盖物被点击");
baiduMap.hideInfoWindow();
if (marker != null) {
latLngshow = marker.getPosition();
reverseGeoCodeOption.location(latLngshow);
geoCoder.reverseGeoCode(reverseGeoCodeOption);
tvAddOverlayGeoCoder.setText("正在获取详细位置");
bundle = marker.getExtraInfo();
generalIsMale = bundle.getString("general").equals("m");
layoutAddOverlayRadarNearbyItem.setBackgroundColor(getResources().getColor(generalIsMale ? R.color.blue : R.color.pink));
imageViewAddOverlayItem.setImageResource(generalIsMale ? R.mipmap.map_portrait_man : R.mipmap.map_portrait_woman);
tvAddOverlayItemUserID.setText(bundle.getString("userID"));
tvAddOverlayItemDistance.setText("距离" + bundle.getInt("distance") + "米 ");
tvAddOverlayItemLatlng.setText("坐标: " + latLngshow.latitude + " , " + latLngshow.longitude + " ");
Log.d("lml", "MapFragment显示的信息:" + bundle.getString("userID"));
Log.d("lml", bundle.getString("general") + ";" + generalIsMale);
baiduMap.showInfoWindow(new InfoWindow(viewOverlayItem, marker.getPosition(), -70));
MapStatusUpdate update = MapStatusUpdateFactory.newLatLng(marker.getPosition());
baiduMap.animateMapStatus(update);
return true;
} else
return false;
}
示例2: onMarkerClick
import com.baidu.mapapi.map.Marker; //导入方法依赖的package包/类
@Override
public boolean onMarkerClick(final Marker marker) {
final LatLng ll = marker.getPosition();
Point p = mBaiduMap.getProjection().toScreenLocation(ll);
p.y -= 47;
LatLng llInfo = mBaiduMap.getProjection().fromScreenLocation(p);
Button button = new Button(getApplicationContext());
if (marker == mMarker) {
button.setText(marker.getPosition().latitude + " // "
+ marker.getPosition().longitude);
}
InfoWindow mInfoWindow = new InfoWindow(button, llInfo,
mOnInfoWindowClickListener);
mBaiduMap.showInfoWindow(mInfoWindow);
return true;
}
示例3: onMarkerClick
import com.baidu.mapapi.map.Marker; //导入方法依赖的package包/类
@Override
public boolean onMarkerClick(final Marker marker) {
final LatLng ll = marker.getPosition();
Point p = mBaiduMap.getProjection().toScreenLocation(ll);
p.y -= 47;
LatLng llInfo = mBaiduMap.getProjection().fromScreenLocation(p);
Button button = new Button(getApplicationContext());
if (marker == mMarkerA) {
button.setText(marker.getPosition().latitude + " // "
+ marker.getPosition().longitude);
} else if (marker == mMarkerB) {
button.setText(getDistanceMsg(mCenterLatLng, ll));
} else if (marker == mMarkerC) {
button.setText(getDistanceMsg(mCenterLatLng, ll));
}
InfoWindow mInfoWindow = new InfoWindow(button, llInfo,
mOnInfoWindowClickListener);
mBaiduMap.showInfoWindow(mInfoWindow);
return true;
}
示例4: MarkerWithPosition
import com.baidu.mapapi.map.Marker; //导入方法依赖的package包/类
private MarkerWithPosition(Marker marker) {
this.marker = marker;
position = marker.getPosition();
}