本文整理汇总了Java中com.google.android.gms.maps.model.GroundOverlayOptions.visible方法的典型用法代码示例。如果您正苦于以下问题:Java GroundOverlayOptions.visible方法的具体用法?Java GroundOverlayOptions.visible怎么用?Java GroundOverlayOptions.visible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.maps.model.GroundOverlayOptions
的用法示例。
在下文中一共展示了GroundOverlayOptions.visible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GroundOverlayOptions
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入方法依赖的package包/类
/**
* Creates a new Ground Overlay
*
* @param imageUrl url of the ground overlay image
* @param latLonBox bounds of the image
* @param drawOrder z index of the image
* @param visibility true if visible, false otherwise
* @param properties properties hashmap
* @param rotation rotation of image
*/
/* package */ KmlGroundOverlay(String imageUrl, LatLngBounds latLonBox, float drawOrder,
int visibility, HashMap<String, String> properties, float rotation) {
mGroundOverlayOptions = new GroundOverlayOptions();
mImageUrl = imageUrl;
mProperties = properties;
if (latLonBox == null) {
throw new IllegalArgumentException("No LatLonBox given");
}
mLatLngBox = latLonBox;
mGroundOverlayOptions.positionFromBounds(latLonBox);
mGroundOverlayOptions.bearing(rotation);
mGroundOverlayOptions.zIndex(drawOrder);
mGroundOverlayOptions.visible(visibility != 0);
}
示例2: _createGroundOverlay
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入方法依赖的package包/类
private void _createGroundOverlay(final JSONObject opts, final CallbackContext callbackContext) throws JSONException {
GroundOverlayOptions options = new GroundOverlayOptions();
if (opts.has("anchor")) {
JSONArray anchor = opts.getJSONArray("anchor");
options.anchor((float)anchor.getDouble(0), (float)anchor.getDouble(1));
}
if (opts.has("bearing")) {
options.bearing((float)opts.getDouble("bearing"));
}
if (opts.has("opacity")) {
options.transparency(1 - (float)opts.getDouble("opacity"));
}
if (opts.has("zIndex")) {
options.zIndex((float)opts.getDouble("zIndex"));
}
if (opts.has("visible")) {
options.visible(opts.getBoolean("visible"));
}
if (opts.has("bounds") == true) {
JSONArray points = opts.getJSONArray("bounds");
LatLngBounds bounds = PluginUtil.JSONArray2LatLngBounds(points);
options.positionFromBounds(bounds);
}
// Load image
String url = opts.getString("url");
_setImage(url, options, new PluginAsyncInterface() {
@Override
public void onPostExecute(Object object) {
GroundOverlay groundOverlay = (GroundOverlay)object;
String id = "groundOverlay_" + groundOverlay.getId();
PluginGroundOverlay.this.objects.put(id, groundOverlay);
JSONObject result = new JSONObject();
try {
result.put("hashCode", groundOverlay.hashCode());
result.put("id", id);
PluginGroundOverlay.this.objects.put("gOverlay_property_" + groundOverlay.getId(), opts);
} catch (Exception e) {}
callbackContext.success(result);
}
@Override
public void onError(String errorMsg) {
callbackContext.error(errorMsg);
}
});
}