本文整理匯總了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;
}