本文整理汇总了Java中com.google.android.gms.maps.model.GroundOverlay类的典型用法代码示例。如果您正苦于以下问题:Java GroundOverlay类的具体用法?Java GroundOverlay怎么用?Java GroundOverlay使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GroundOverlay类属于com.google.android.gms.maps.model包,在下文中一共展示了GroundOverlay类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: placeBootprint
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
private void placeBootprint(LatLng latLng, float direction) {
if (mMap != null) {
final BitmapDescriptor bootprint;
// pick left/right print
if (mTotalSteps++ % 2 == 0) {
bootprint = mLeftBootprint;
} else {
bootprint = mRightBootprint;
}
final GroundOverlay overlay = mMap.addGroundOverlay(
new GroundOverlayOptions().position(
latLng,
BOOTPRINT_SIZE_METERS
).bearing(
(float) (direction / Math.PI * 180d)
).image(bootprint)
);
mBootprintLocations.add(overlay);
removeAndUpdateBootprints();
}
}
示例2: removeAndUpdateBootprints
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
private void removeAndUpdateBootprints() {
if (mBootprintLocations.size() >= MAX_BOOTPRINTS) {
final GroundOverlay removedOverlay = mBootprintLocations.remove(0);
removedOverlay.remove();
}
for (int i = 0; i < mBootprintLocations.size(); i++) {
GroundOverlay bootprint = mBootprintLocations.get(i);
int footprintsLeft = MAX_BOOTPRINTS - mBootprintLocations.size();
float transparency = 1f - ((i + footprintsLeft) / (float) MAX_BOOTPRINTS);
bootprint.setTransparency((2f * transparency / 3f) + .33f);
}
}
示例3: call
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
@Override public void call(final Subscriber<? super GroundOverlay> subscriber) {
GoogleMap.OnGroundOverlayClickListener listener = new GoogleMap.OnGroundOverlayClickListener() {
@Override public void onGroundOverlayClick(GroundOverlay groundOverlay) {
if (!subscriber.isUnsubscribed()) {
subscriber.onNext(groundOverlay);
}
}
};
map.setOnGroundOverlayClickListener(listener);
subscriber.add(Subscriptions.create(new Action0() {
@Override public void call() {
map.setOnGroundOverlayClickListener(null);
}
}));
}
示例4: addGroundOverlayToMap
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
/**
* Adds ground overlays from a given URL onto the map
*
* @param groundOverlayUrl url of ground overlay
* @param groundOverlays hashmap of ground overlays to add to the map
*/
private void addGroundOverlayToMap(String groundOverlayUrl,
HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays, boolean containerVisibility) {
BitmapDescriptor groundOverlayBitmap = BitmapDescriptorFactory
.fromBitmap(mImagesCache.get(groundOverlayUrl));
for (KmlGroundOverlay kmlGroundOverlay : groundOverlays.keySet()) {
if (kmlGroundOverlay.getImageUrl().equals(groundOverlayUrl)) {
GroundOverlayOptions groundOverlayOptions = kmlGroundOverlay.getGroundOverlayOptions()
.image(groundOverlayBitmap);
GroundOverlay mapGroundOverlay = mMap.addGroundOverlay(groundOverlayOptions);
if (containerVisibility == false) {
mapGroundOverlay.setVisible(false);
}
groundOverlays.put(kmlGroundOverlay, mapGroundOverlay);
}
}
}
示例5: addGroundOverlay
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
public final GroundOverlay addGroundOverlay(GroundOverlayOptions paramGroundOverlayOptions)
{
try
{
com.google.android.gms.maps.model.internal.c localc = this.Br.addGroundOverlay(paramGroundOverlayOptions);
if (localc != null)
{
GroundOverlay localGroundOverlay = new GroundOverlay(localc);
return localGroundOverlay;
}
return null;
}
catch (RemoteException localRemoteException)
{
throw new RuntimeRemoteException(localRemoteException);
}
}
示例6: addGroundOverlayToMap
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
/**
* Adds ground overlays from a given URL onto the map
*
* @param groundOverlayUrl url of ground overlay
* @param groundOverlays hashmap of ground overlays to add to the map
*/
private void addGroundOverlayToMap(String groundOverlayUrl,
HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays, boolean containerVisibility) {
BitmapDescriptor groundOverlayBitmap = BitmapDescriptorFactory
.fromBitmap(getImagesCache().get(groundOverlayUrl));
for (KmlGroundOverlay kmlGroundOverlay : groundOverlays.keySet()) {
if (kmlGroundOverlay.getImageUrl().equals(groundOverlayUrl)) {
GroundOverlayOptions groundOverlayOptions = kmlGroundOverlay.getGroundOverlayOptions()
.image(groundOverlayBitmap);
GroundOverlay mapGroundOverlay = attachGroundOverlay(groundOverlayOptions);
if (!containerVisibility) {
mapGroundOverlay.setVisible(false);
}
groundOverlays.put(kmlGroundOverlay, mapGroundOverlay);
}
}
}
示例7: addOverlay
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
public void addOverlay(LatLng place) {
GroundOverlay groundOverlay = mMap.addGroundOverlay(new
GroundOverlayOptions()
.position(place, 100)
.transparency(0.5f)
.zIndex(3)
.image(BitmapDescriptorFactory.fromBitmap(drawableToBitmap(getActivity().getResources().getDrawable(R.drawable.map_overlay)))));
startOverlayAnimation(groundOverlay);
}
示例8: remove
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
/**
* Remove this tile layer
* @param args
* @param callbackContext
* @throws JSONException
*/
protected void remove(JSONArray args, CallbackContext callbackContext) throws JSONException {
String id = args.getString(1);
GroundOverlay groundOverlay = (GroundOverlay)this.objects.get(id);
if (groundOverlay == null) {
this.sendNoResult(callbackContext);
return;
}
String propertyId = "gOverlay_property_" + id;
this.objects.remove(propertyId);
groundOverlay.remove();
this.sendNoResult(callbackContext);
}
示例9: setVisible
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
/**
* Set visibility for the object
* @param args
* @param callbackContext
* @throws JSONException
*/
protected void setVisible(JSONArray args, CallbackContext callbackContext) throws JSONException {
boolean visible = args.getBoolean(2);
String id = args.getString(1);
GroundOverlay groundOverlay = (GroundOverlay)this.objects.get(id);
if (groundOverlay == null) {
this.sendNoResult(callbackContext);
return;
}
groundOverlay.setVisible(visible);
this.sendNoResult(callbackContext);
}
示例10: setImage
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
/**
* Set image of the ground-overlay
* @param args
* @param callbackContext
* @throws JSONException
*/
@SuppressWarnings("unused")
private void setImage(final JSONArray args, final CallbackContext callbackContext) throws JSONException {
String id = args.getString(1);
GroundOverlay groundOverlay = (GroundOverlay)this.objects.get(id);
String url = args.getString(2);
String propertyId = "gOverlay_property_" + id;
JSONObject opts = (JSONObject) this.objects.get(propertyId);
opts.put("url", url);
_createGroundOverlay(opts, callbackContext);
}
示例11: setBounds
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
/**
* Set bounds
* @param args
* @param callbackContext
* @throws JSONException
*/
@SuppressWarnings("unused")
private void setBounds(final JSONArray args, final CallbackContext callbackContext) throws JSONException {
String id = args.getString(1);
GroundOverlay groundOverlay = (GroundOverlay)this.objects.get(id);
JSONArray points = args.getJSONArray(2);
LatLngBounds bounds = PluginUtil.JSONArray2LatLngBounds(points);
groundOverlay.setPositionFromBounds(bounds);
this.sendNoResult(callbackContext);
}
示例12: shouldEmmitGroundOverlay
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
@Test
public void shouldEmmitGroundOverlay() throws Exception {
TestSubscriber<GroundOverlay> testSubscriber = new TestSubscriber<>();
new GroundOverlayClickFunc().call(googleMap)
.subscribe(testSubscriber);
verify(googleMap).setOnGroundOverlayClickListener(argumentCaptor.capture());
argumentCaptor.getValue().onGroundOverlayClick(null);
testSubscriber.assertNoErrors();
testSubscriber.assertValueCount(1);
testSubscriber.assertValue(null);
}
示例13: KmlContainer
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
KmlContainer(HashMap<String, String> properties, HashMap<String, KmlStyle> styles,
HashMap<KmlPlacemark, Object> placemarks, HashMap<String, String> styleMaps,
ArrayList<KmlContainer> containers, HashMap<KmlGroundOverlay, GroundOverlay>
groundOverlay, String Id) {
mProperties = properties;
mPlacemarks = placemarks;
mStyles = styles;
mStyleMap = styleMaps;
mContainers = containers;
mGroundOverlays = groundOverlay;
mContainerId = Id;
}
示例14:
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
/**
* Stores all given data and adds it onto the map
*
* @param styles hashmap of styles
* @param styleMaps hashmap of style maps
* @param placemarks hashmap of placemarks
* @param folders array of containers
* @param groundOverlays hashmap of ground overlays
*/
/* package */ void storeKmlData(HashMap<String, KmlStyle> styles,
HashMap<String, String> styleMaps,
HashMap<KmlPlacemark, Object> placemarks, ArrayList<KmlContainer> folders,
HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays) {
mStyles = styles;
mStyleMaps = styleMaps;
mPlacemarks = placemarks;
mContainers = folders;
mGroundOverlays = groundOverlays;
}
示例15: addGroundOverlays
import com.google.android.gms.maps.model.GroundOverlay; //导入依赖的package包/类
/**
* Adds a ground overlay adds all the ground overlays onto the map and recursively adds all
* ground overlays stored in the given containers
*
* @param groundOverlays ground overlays to add to the map
* @param kmlContainers containers to check for ground overlays
*/
private void addGroundOverlays(HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays,
Iterable<KmlContainer> kmlContainers) {
addGroundOverlays(groundOverlays);
for (KmlContainer container : kmlContainers) {
addGroundOverlays(container.getGroundOverlayHashMap(),
container.getContainers());
}
}