本文整理汇总了Java中org.osmdroid.views.overlay.Marker.showInfoWindow方法的典型用法代码示例。如果您正苦于以下问题:Java Marker.showInfoWindow方法的具体用法?Java Marker.showInfoWindow怎么用?Java Marker.showInfoWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osmdroid.views.overlay.Marker
的用法示例。
在下文中一共展示了Marker.showInfoWindow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActivityResult
import org.osmdroid.views.overlay.Marker; //导入方法依赖的package包/类
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
switch (requestCode) {
case START_SHARING_REQUEST:
if (resultCode == Activity.RESULT_OK) {
String login = intent.getStringExtra("NICKNAME");
String group = intent.getStringExtra("GROUP");
String message = intent.getStringExtra("MESSAGE");
new StartSharingTask().execute(login, group, message);
}
break;
case FRIENDS_REQUEST:
if (resultCode == Activity.RESULT_OK) {
int id = intent.getIntExtra("ID", 0);
Friend selected = mFriends.get(id);
if (selected.mHasLocation) {
mMap.getController().setCenter(selected.mPosition);
Marker friendMarker = (Marker) mFriendsMarkers.getItems().get(id);
friendMarker.showInfoWindow();
}
}
break;
}
}
示例2: onActivityResult
import org.osmdroid.views.overlay.Marker; //导入方法依赖的package包/类
@Override protected void onActivityResult (int requestCode, int resultCode, Intent intent) {
switch (requestCode) {
case FriendsManager.START_SHARING_REQUEST:
case FriendsManager.FRIENDS_REQUEST:
mFriendsManager.onActivityResult(requestCode, resultCode, intent);
break;
case ROUTE_REQUEST:
if (resultCode == RESULT_OK) {
int nodeId = intent.getIntExtra("NODE_ID", 0);
map.getController().setCenter(mRoads[mSelectedRoad].mNodes.get(nodeId).mLocation);
Marker roadMarker = (Marker) mRoadNodeMarkers.getItems().get(nodeId);
roadMarker.showInfoWindow();
}
break;
case POIS_REQUEST:
if (resultCode == RESULT_OK) {
int id = intent.getIntExtra("ID", 0);
map.getController().setCenter(mPOIs.get(id).mLocation);
Marker poiMarker = mPoiMarkers.getItem(id);
poiMarker.showInfoWindow();
}
break;
case KmlTreeActivity.KML_TREE_REQUEST:
mKmlStack.pop();
updateUIWithKml();
if (intent == null)
break;
KmlFeature selectedFeature = intent.getParcelableExtra("KML_FEATURE");
if (selectedFeature == null)
break;
BoundingBox bb = selectedFeature.getBoundingBox();
setViewOn(bb);
break;
case KmlStylesActivity.KML_STYLES_REQUEST:
updateUIWithKml();
break;
default:
break;
}
}
示例3: 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();
}
}