當前位置: 首頁>>代碼示例>>Java>>正文


Java ExtendedOverlayItem類代碼示例

本文整理匯總了Java中org.osmdroid.bonuspack.overlays.ExtendedOverlayItem的典型用法代碼示例。如果您正苦於以下問題:Java ExtendedOverlayItem類的具體用法?Java ExtendedOverlayItem怎麽用?Java ExtendedOverlayItem使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExtendedOverlayItem類屬於org.osmdroid.bonuspack.overlays包,在下文中一共展示了ExtendedOverlayItem類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
 
開發者ID:nirabpudasaini,項目名稱:Mero-Bhada-Meter,代碼行數:26,代碼來源:MapActivity.java

示例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);
	}
}
 
開發者ID:nirabpudasaini,項目名稱:Mero-Bhada-Meter,代碼行數:26,代碼來源:MapActivity.java

示例3: WikiArticlesOverlay

import org.osmdroid.bonuspack.overlays.ExtendedOverlayItem; //導入依賴的package包/類
public WikiArticlesOverlay(
		final Drawable pDefaultMarker,
		final Context pContext,
		final long _trackId
		)
{
	super(pDefaultMarker, new DefaultResourceProxyImpl(pContext));
	this.trackId = _trackId;
	this.pContentResolver = pContext.getContentResolver();
       waypoints = new ArrayList<GeoPoint>();
       listItems = new ArrayList<ExtendedOverlayItem>();
	
}
 
開發者ID:WanderWiki,項目名稱:WanderWiki-client,代碼行數:14,代碼來源:WikiArticlesOverlay.java

示例4: 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);
	}
}
 
開發者ID:alain75007,項目名稱:androidschool,代碼行數:38,代碼來源:POITask.java

示例5: onOpen

import org.osmdroid.bonuspack.overlays.ExtendedOverlayItem; //導入依賴的package包/類
@Override public void onOpen(Object item){
       super.onOpen(item);
       ExtendedOverlayItem eItem = (ExtendedOverlayItem)item;
       urlWikipedia = (String)eItem.getRelatedObject();
}
 
開發者ID:WanderWiki,項目名稱:WanderWiki-client,代碼行數:6,代碼來源:WikiArticlesInfoWindow.java

示例6: onOpen

import org.osmdroid.bonuspack.overlays.ExtendedOverlayItem; //導入依賴的package包/類
@Override public void onOpen(Object item) {
	ExtendedOverlayItem eItem = (ExtendedOverlayItem)item;
	mSelectedPoint = (Integer)eItem.getRelatedObject();
	super.onOpen(item);
}
 
開發者ID:nirabpudasaini,項目名稱:Mero-Bhada-Meter,代碼行數:6,代碼來源:ViaPointInfoWindow.java

示例7: doInBackground

import org.osmdroid.bonuspack.overlays.ExtendedOverlayItem; //導入依賴的package包/類
protected String doInBackground(Object... params) {
	marker = (ExtendedOverlayItem) params[0];
	return getAddress(marker.getPoint());
}
 
開發者ID:nirabpudasaini,項目名稱:Mero-Bhada-Meter,代碼行數:5,代碼來源:MapActivity.java


注:本文中的org.osmdroid.bonuspack.overlays.ExtendedOverlayItem類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。