当前位置: 首页>>代码示例>>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;未经允许,请勿转载。