本文整理汇总了Java中org.osmdroid.views.overlay.Marker.getRelatedObject方法的典型用法代码示例。如果您正苦于以下问题:Java Marker.getRelatedObject方法的具体用法?Java Marker.getRelatedObject怎么用?Java Marker.getRelatedObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osmdroid.views.overlay.Marker
的用法示例。
在下文中一共展示了Marker.getRelatedObject方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onOpen
import org.osmdroid.views.overlay.Marker; //导入方法依赖的package包/类
@Override
public void onOpen(Object item) {
super.onOpen(item);
Marker marker = (Marker) item;
mSelectedPoi = (GeoPointDto) marker.getRelatedObject();
if (mSelectedPoi != null) {
setText(R.id.bubble_title, mSelectedPoi.getName());
setText(R.id.bubble_description, mSelectedPoi.getDescription());
if (mSelectedPoi.getLink() != null) {
Button btn = (Button) (mView.findViewById(R.id.bubble_moreinfo));
btn.setVisibility(View.VISIBLE);
btn.setOnClickListener(this);
}
// R.id.bubble_image not implemented yet
// R.id.bubble_subdescription not implemented
/* !!!
//8. put thumbnail image in bubble, fetching the thumbnail in background:
if (mSelectedPoi.mThumbnailPath != null){
ImageView imageView = (ImageView)mView.findViewById(R.id.bubble_image);
mSelectedPoi.fetchThumbnailOnThread(imageView);
}
*/
}
}
示例2: onOpen
import org.osmdroid.views.overlay.Marker; //导入方法依赖的package包/类
@Override public void onOpen(Object item){
Marker marker = (Marker)item;
mSelectedPOI = (POI)marker.getRelatedObject();
super.onOpen(item);
//Fetch the thumbnail in background
if (mSelectedPOI.mThumbnailPath != null){
ImageView imageView = (ImageView)mView.findViewById(org.osmdroid.bonuspack.R.id.bubble_image);
mSelectedPOI.fetchThumbnailOnThread(imageView);
}
//Show or hide "more info" button:
if (mSelectedPOI.mUrl != null)
mView.findViewById(org.osmdroid.bonuspack.R.id.bubble_moreinfo).setVisibility(View.VISIBLE);
else
mView.findViewById(org.osmdroid.bonuspack.R.id.bubble_moreinfo).setVisibility(View.GONE);
}
示例3: onMarkerDragEnd
import org.osmdroid.views.overlay.Marker; //导入方法依赖的package包/类
@Override public void onMarkerDragEnd(Marker marker) {
int index = (Integer)marker.getRelatedObject();
if (index == START_INDEX)
startPoint = marker.getPosition();
else if (index == DEST_INDEX)
destinationPoint = marker.getPosition();
else
viaPoints.set(index, marker.getPosition());
//update location:
new ReverseGeocodingTask().execute(marker);
//update route:
getRoadAsync();
}
示例4: onMarkerDragEnd
import org.osmdroid.views.overlay.Marker; //导入方法依赖的package包/类
@Override public void onMarkerDragEnd(Marker marker) {
Object object = marker.getRelatedObject();
if (object != null && object instanceof KmlPoint){
KmlPoint point = (KmlPoint)object;
point.setPosition(marker.getPosition());
}
}
示例5: onOpen
import org.osmdroid.views.overlay.Marker; //导入方法依赖的package包/类
@Override
public void onOpen(Object item) {
super.onOpen(item);
mView.findViewById(org.osmdroid.bonuspack.R.id.bubble_moreinfo).setVisibility(View.VISIBLE);
Marker marker = (Marker) item;
mSelectedPoi = (POI) marker.getRelatedObject();
//8. put thumbnail image in bubble, fetching the thumbnail in background:
if (mSelectedPoi.mThumbnailPath != null) {
ImageView imageView = (ImageView) mView.findViewById(org.osmdroid.bonuspack.R.id.bubble_image);
mSelectedPoi.fetchThumbnailOnThread(imageView);
}
}
示例6: onOpen
import org.osmdroid.views.overlay.Marker; //导入方法依赖的package包/类
@Override public void onOpen(Object item) {
Marker eItem = (Marker)item;
mSelectedPoint = (Integer)eItem.getRelatedObject();
super.onOpen(item);
}
示例7: updateUIWithFriendsMarkers
import org.osmdroid.views.overlay.Marker; //导入方法依赖的package包/类
void updateUIWithFriendsMarkers() {
//retrieve the id of the "opened" friend (friend with opened bubble):
int opened = getOpenedInfoWindow(mFriendsMarkers);
String openedFriendId = null;
if (opened != -1) {
Marker m = (Marker)mFriendsMarkers.getItems().get(opened);
Friend openedFriend = (Friend)m.getRelatedObject();
openedFriendId = openedFriend.mId;
}
mFriendsMarkers.closeAllInfoWindows();
mFriendsMarkers.getItems().clear();
if (mFriends == null) {
mMap.invalidate();
return;
}
Drawable iconOnline = mActivity.getResources().getDrawable(R.drawable.marker_car_on);
Drawable iconOffline = mActivity.getResources().getDrawable(R.drawable.marker_friend_off);
for (Friend friend : mFriends) {
//MarkerLabeled marker = new MarkerLabeled(map);
Marker marker = new Marker(mMap);
marker.setPosition(friend.mPosition);
marker.setTitle(friend.mNickName);
marker.setSnippet(friend.mMessage);
if (friend.mOnline) {
marker.setIcon(iconOnline); //((BitmapDrawable) iconOnline).getBitmap());
marker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_CENTER);
marker.setRotation(friend.mBearing);
} else {
marker.setIcon(iconOffline); //((BitmapDrawable)iconOffline).getBitmap());
}
if (!friend.mHasLocation)
marker.setEnabled(false);
marker.setRelatedObject(friend);
mFriendsMarkers.add(marker);
}
mMap.invalidate();
//reopen the bubble on the "same" (but new) Friend marker:
opened = getFriendWithId(openedFriendId);
if (opened != -1) {
Marker markerToOpen = (Marker) mFriendsMarkers.getItems().get(opened);
markerToOpen.showInfoWindow();
}
}