本文整理汇总了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;
}
示例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;
}