本文整理汇总了Java中org.osmdroid.bonuspack.overlays.ExtendedOverlayItem.setImage方法的典型用法代码示例。如果您正苦于以下问题:Java ExtendedOverlayItem.setImage方法的具体用法?Java ExtendedOverlayItem.setImage怎么用?Java ExtendedOverlayItem.setImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osmdroid.bonuspack.overlays.ExtendedOverlayItem
的用法示例。
在下文中一共展示了ExtendedOverlayItem.setImage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: putMarkerItem
import org.osmdroid.bonuspack.overlays.ExtendedOverlayItem; //导入方法依赖的package包/类
/**
* add (or replace) an item in markerOverlays. p position.
*/
public ExtendedOverlayItem putMarkerItem(ExtendedOverlayItem item,
GeoPoint p, int index, int titleResId, int markerResId,
int iconResId) {
if (item != null) {
itineraryMarkers.removeItem(item);
}
Drawable marker = getResources().getDrawable(markerResId);
String title = getResources().getString(titleResId);
ExtendedOverlayItem overlayItem = new ExtendedOverlayItem(title, "", p,
this);
overlayItem.setMarkerHotspot(OverlayItem.HotspotPlace.BOTTOM_CENTER);
overlayItem.setMarker(marker);
if (iconResId != -1)
overlayItem.setImage(getResources().getDrawable(iconResId));
overlayItem.setRelatedObject(index);
itineraryMarkers.addItem(overlayItem);
mv.invalidate();
// Start geocoding task to update the description of the marker with its
// address:
new GeocodingTask().execute(overlayItem);
return overlayItem;
}
示例2: putRoadNodes
import org.osmdroid.bonuspack.overlays.ExtendedOverlayItem; //导入方法依赖的package包/类
private void putRoadNodes(Road road) {
roadNodeMarkers.removeAllItems();
Drawable marker = getResources().getDrawable(R.drawable.marker_node);
int n = road.mNodes.size();
TypedArray iconIds = getResources().obtainTypedArray(
R.array.direction_icons);
for (int i = 0; i < n; i++) {
RoadNode node = road.mNodes.get(i);
String instructions = (node.mInstructions == null ? ""
: node.mInstructions);
ExtendedOverlayItem nodeMarker = new ExtendedOverlayItem("Step "
+ (i + 1), instructions, node.mLocation, this);
nodeMarker.setSubDescription(road.getLengthDurationText(
node.mLength, node.mDuration));
nodeMarker.setMarkerHotspot(OverlayItem.HotspotPlace.CENTER);
nodeMarker.setMarker(marker);
int iconId = iconIds.getResourceId(node.mManeuverType,
R.drawable.ic_empty);
if (iconId != R.drawable.ic_empty) {
Drawable icon = getResources().getDrawable(iconId);
nodeMarker.setImage(icon);
}
roadNodeMarkers.addItem(nodeMarker);
}
}
示例3: onPostExecute
import org.osmdroid.bonuspack.overlays.ExtendedOverlayItem; //导入方法依赖的package包/类
@Override
protected void onPostExecute(List<POI> pois) {
mWaitSpinner.cancel();
if (mTag.equals("")) {
//no search, no message
} else if (pois == null) {
Toast
.makeText(mContext.getApplicationContext(),
"Technical issue when getting " + mTag + " POI.", Toast.LENGTH_LONG)
.show();
} else {
Toast.makeText(mContext.getApplicationContext(),
"" + pois.size() + " " + mTag + " entries found",
Toast.LENGTH_LONG).show();
// if (mTag.equals("flickr") || mTag.startsWith("picasa") || mTag.equals("wikipedia"))
// startAsyncThumbnailsLoading(mPOIs);
}
//super.onPostExecute(pois);
for (POI poi:pois){
Log.d("Alain ", "item locationE6 lat=" + poi.mLocation.getLatitudeE6() + " long=" + poi.mLocation.getLongitudeE6());
ExtendedOverlayItem poiItem = new ExtendedOverlayItem(
poi.mType, poi.mDescription,
poi.mLocation, mMapView.getContext());
Drawable poiMarker = mContext.getResources().getDrawable(R.drawable.pin_default);
poiItem.setMarker(poiMarker);
poiItem.setMarkerHotspot(OverlayItem.HotspotPlace.CENTER);
if (poi.mThumbnail != null){
poiItem.setImage(new BitmapDrawable(poi.mThumbnail));
}
final ArrayList<ExtendedOverlayItem> poiItems = new ArrayList<ExtendedOverlayItem>();
ItemizedOverlayWithBubble<ExtendedOverlayItem> poiMarkers = new ItemizedOverlayWithBubble<ExtendedOverlayItem>(
mContext, poiItems, mMapView, new CustomMapInfoWindow(mMapView));
mMapView.getOverlays().add(poiMarkers);
poiMarkers.addItem(poiItem);
}
}