本文整理汇总了Java中org.osmdroid.bonuspack.overlays.FolderOverlay类的典型用法代码示例。如果您正苦于以下问题:Java FolderOverlay类的具体用法?Java FolderOverlay怎么用?Java FolderOverlay使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FolderOverlay类属于org.osmdroid.bonuspack.overlays包,在下文中一共展示了FolderOverlay类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addOverlay
import org.osmdroid.bonuspack.overlays.FolderOverlay; //导入依赖的package包/类
/**
* Converts the overlay to a KmlFeature and add it inside this.
* Conversion from Overlay subclasses to KML Features is as follow: <br>
* FolderOverlay, MarkerClusterer => Folder<br>
* Marker => Point<br>
* Polygon => Polygon<br>
* Polyline => LineString<br>
* GroundOverlay => GroundOverlay<br>
* Else, add nothing.
* @param overlay to convert and add
* @param kmlDoc for style handling.
* @return true if OK, false if the overlay has not been added.
*/
public boolean addOverlay(Overlay overlay, KmlDocument kmlDoc){
if (overlay == null)
return false;
KmlFeature kmlItem;
if (overlay instanceof GroundOverlay){
kmlItem = new KmlGroundOverlay((GroundOverlay)overlay);
} else if (overlay instanceof FolderOverlay){
kmlItem = new KmlFolder((FolderOverlay)overlay, kmlDoc);
} else if (overlay instanceof MarkerClusterer){
kmlItem = new KmlFolder((MarkerClusterer)overlay, kmlDoc);
} else if (overlay instanceof Marker){
Marker marker = (Marker)overlay;
kmlItem = new KmlPlacemark(marker);
} else if (overlay instanceof Polygon){
Polygon polygon = (Polygon)overlay;
kmlItem = new KmlPlacemark(polygon, kmlDoc);
} else if (overlay instanceof Polyline){
Polyline polyline = (Polyline)overlay;
kmlItem = new KmlPlacemark(polyline, kmlDoc);
} else {
return false;
}
mItems.add(kmlItem);
return true;
}
示例2: KmlFolder
import org.osmdroid.bonuspack.overlays.FolderOverlay; //导入依赖的package包/类
public KmlFolder(FolderOverlay overlay, KmlDocument kmlDoc){
this();
addOverlays(overlay.getItems(), kmlDoc);
mName = overlay.getName();
mDescription = overlay.getDescription();
mVisibility = overlay.isEnabled();
}
示例3: buildOverlay
import org.osmdroid.bonuspack.overlays.FolderOverlay; //导入依赖的package包/类
/**
* Build a FolderOverlay, containing (recursively) overlays from all items of this Folder.
* @param map
* @param defaultStyle to apply when an item has no Style defined.
* @param styler to apply
* @param kmlDocument for Styles
* @return the FolderOverlay built
*/
@Override public Overlay buildOverlay(MapView map, Style defaultStyle, Styler styler, KmlDocument kmlDocument){
Context context = map.getContext();
FolderOverlay folderOverlay = new FolderOverlay(context);
for (KmlFeature k:mItems){
Overlay overlay = k.buildOverlay(map, defaultStyle, styler, kmlDocument);
folderOverlay.add(overlay);
}
if (styler == null)
folderOverlay.setEnabled(mVisibility);
else
styler.onFeature(folderOverlay, this);
return folderOverlay;
}
示例4: buildOverlay
import org.osmdroid.bonuspack.overlays.FolderOverlay; //导入依赖的package包/类
/** Build a FolderOverlay containing all overlays from this MultiGeometry items */
@Override public Overlay buildOverlay(MapView map, Style defaultStyle, Styler styler, KmlPlacemark kmlPlacemark,
KmlDocument kmlDocument){
Context context = map.getContext();
FolderOverlay folderOverlay = new FolderOverlay(context);
for (KmlGeometry k:mItems){
Overlay overlay = k.buildOverlay(map, defaultStyle, styler, kmlPlacemark, kmlDocument);
folderOverlay.add(overlay);
}
return folderOverlay;
}