本文整理匯總了Java中org.osmdroid.views.MapView.getParent方法的典型用法代碼示例。如果您正苦於以下問題:Java MapView.getParent方法的具體用法?Java MapView.getParent怎麽用?Java MapView.getParent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.osmdroid.views.MapView
的用法示例。
在下文中一共展示了MapView.getParent方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: InfoWindow
import org.osmdroid.views.MapView; //導入方法依賴的package包/類
/**
* @param layoutResId the id of the view resource.
* @param mapView the mapview on which is hooked the view
*/
public InfoWindow(int layoutResId, MapView mapView) {
mMapView = mapView;
mIsVisible = false;
ViewGroup parent=(ViewGroup)mapView.getParent();
Context context = mapView.getContext();
LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mView = inflater.inflate(layoutResId, parent, false);
mView.setTag(this);
}
示例2: OsmMarkerInfoWindow
import org.osmdroid.views.MapView; //導入方法依賴的package包/類
public OsmMarkerInfoWindow(MapView mapView, OsmMarker parentMarker) {
this.mMapView = mapView;
this.mIsVisible = false;
ViewGroup parent = (ViewGroup) mapView.getParent();
LayoutInflater inflater = LayoutInflater.from(mapView.getContext());
this.mView = inflater.inflate(R.layout.marker_fancy_place, parent, false);
this.mView.setTag(this);
titleView = (TextView) mView.findViewById(R.id.info_window_title);
titleView.setOnClickListener(parentMarker);
}