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


Java KmlMultiGeometry類代碼示例

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


KmlMultiGeometry類屬於org.osmdroid.bonuspack.kml包,在下文中一共展示了KmlMultiGeometry類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: buildMultiGeometry

import org.osmdroid.bonuspack.kml.KmlMultiGeometry; //導入依賴的package包/類
protected KmlMultiGeometry buildMultiGeometry(JsonArray jMembers){
	KmlMultiGeometry geometry = new KmlMultiGeometry();
	for (JsonElement j:jMembers){
		JsonObject jMember = j.getAsJsonObject();
		KmlGeometry item = buildGeometry(jMember);
		geometry.addItem(item);
	}
	return geometry;
}
 
開發者ID:jeffallen,項目名稱:MarshrutMe,代碼行數:10,代碼來源:OverpassAPIProvider.java

示例2: getView

import org.osmdroid.bonuspack.kml.KmlMultiGeometry; //導入依賴的package包/類
@Override public View getView(int position, View convertView, ViewGroup viewGroup) {
  	KmlFeature item = (KmlFeature)getItem(position);
      if (convertView == null) {
          LayoutInflater inflater = (LayoutInflater) viewGroup.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = inflater.inflate(R.layout.kml_list_item, null);
      }
      TextView itemText = (TextView) convertView.findViewById(R.id.listItemTxt);
      itemText.setText(item.mName);
      
      //Handle checkbox:
      /*
      CheckBox checkBoxIsVisible = (CheckBox)convertView.findViewById(R.id.listItemCheckbox);
      checkBoxIsVisible.setChecked(mRoot.mItems.get(position).mVisibility);
      if (checkBoxIsVisible != null) {
       checkBoxIsVisible.setOnClickListener(new OnClickListener(){
		@Override public void onClick(View view) {
			int position = (Integer)view.getTag();
			KmlFeature item = mRoot.mItems.get(position);
			item.mVisibility = ((CheckBox)view).isChecked();
		}
       });
       checkBoxIsVisible.setTag(position);
      }
      */
      
ImageView img = (ImageView)convertView.findViewById(R.id.listItemImg);
if (item instanceof KmlFolder) {
	img.setImageResource(R.drawable.moreinfo_arrow);
} else if (item instanceof KmlPlacemark){
	KmlGeometry geometry = ((KmlPlacemark)item).mGeometry;
	if (geometry instanceof KmlPoint)
		img.setImageResource(R.drawable.marker_kml_point);
	else if (geometry instanceof KmlLineString)
		img.setImageResource(R.drawable.kml_icon_linestring);
	else if (geometry instanceof KmlPolygon)
		img.setImageResource(R.drawable.kml_icon_polygon);
	else if (geometry instanceof KmlMultiGeometry)
		img.setImageResource(R.drawable.kml_icon_multigeometry);
	else if (geometry instanceof KmlTrack)
		img.setImageResource(R.drawable.kml_icon_gxtrack);
	else
		img.setImageDrawable(null);
} else if (item instanceof KmlGroundOverlay){
	img.setImageResource(R.drawable.kml_icon_groundoverlay);
} else
	img.setImageDrawable(null);

      return convertView;
  }
 
開發者ID:MKergall,項目名稱:osmbonuspack,代碼行數:50,代碼來源:KmlListAdapter.java


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