当前位置: 首页>>代码示例>>Java>>正文


Java CancelableCallback类代码示例

本文整理汇总了Java中com.google.android.gms.maps.GoogleMap.CancelableCallback的典型用法代码示例。如果您正苦于以下问题:Java CancelableCallback类的具体用法?Java CancelableCallback怎么用?Java CancelableCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CancelableCallback类属于com.google.android.gms.maps.GoogleMap包,在下文中一共展示了CancelableCallback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onGoToVrController

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
/**
 * Called when the Animate To "Go To Analog Stick" button is clicked.
 */
public void onGoToVrController(View view) {

    if (!checkReady()) {
        return;
    }

    changeCamera(CameraUpdateFactory.newCameraPosition(vrControllerCameraPos), new CancelableCallback() {
        @Override
        public void onFinish() {
            Toast.makeText(getBaseContext(), "Animation to Analog Stick complete", Toast.LENGTH_SHORT)
                    .show();
        }

        @Override
        public void onCancel() {
            Toast.makeText(getBaseContext(), "Animation to Analog Stick canceled", Toast.LENGTH_SHORT)
                    .show();
        }
    });
}
 
开发者ID:AviralGarg1993,项目名称:VR-One,代码行数:24,代码来源:MapActivity.java

示例2: onMyLocationButtonClick

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
@Override
public boolean onMyLocationButtonClick() {
	if (location != null) {
		LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
		float zoom = map.getCameraPosition().zoom < 15 ? 15 : map.getCameraPosition().zoom;
		map.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoom), new CancelableCallback() {

			@Override
			public void onCancel() {
				mapWrapper.setOnMapPanListener(MapFragment.this);
				followMe = true;
			}

			@Override
			public void onFinish() {
				mapWrapper.setOnMapPanListener(MapFragment.this);
				followMe = true;
			}
		});
	}
	return true;
}
 
开发者ID:ngageoint,项目名称:mage-android,代码行数:23,代码来源:MapFragment.java

示例3: setLocation

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
public void setLocation(final double latitude, final double longitude, final int zoom) {
    CameraUpdate update;
    if (-1 == zoom) {
        update = CameraUpdateFactory.newLatLng(new LatLng(latitude, longitude));
    } else {
        update = CameraUpdateFactory.newLatLngZoom(new LatLng(latitude, longitude), zoom);
    }

    mMap.animateCamera(update, 1000, new CancelableCallback() {
        @Override
        public void onFinish() {
            completeSetLocation(latitude, longitude, zoom);
        }

        @Override
        public void onCancel() {
        }
    });
}
 
开发者ID:yolanother,项目名称:geofenceeditor,代码行数:20,代码来源:GeofenceEditorActivity.java

示例4: onGoToSydney

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
/**
 * Called when the Animate To Sydney button is clicked.
 */
public void onGoToSydney(View view) {
    if (!checkReady()) {
        return;
    }

    changeCamera(CameraUpdateFactory.newCameraPosition(SYDNEY), new CancelableCallback() {
        @Override
        public void onFinish() {
            Toast.makeText(getBaseContext(), "Animation to Sydney complete", Toast.LENGTH_SHORT)
                    .show();
        }

        @Override
        public void onCancel() {
            Toast.makeText(getBaseContext(), "Animation to Sydney canceled", Toast.LENGTH_SHORT)
                    .show();
        }
    });
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:23,代码来源:CameraDemoActivity.java

示例5: changeCamera

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
/**
 * Change the camera position by moving or animating the camera depending on the state of the
 * animate toggle button.
 */
private void changeCamera(CameraUpdate update, CancelableCallback callback) {
    boolean animated = ((CompoundButton) findViewById(R.id.animate)).isChecked();
    if (animated) {
        mMap.animateCamera(update, callback);
    } else {
        mMap.moveCamera(update);
    }
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:13,代码来源:CameraDemoActivity.java

示例6: onMapReady

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
@Override
public void onMapReady(GoogleMap googleMap) {
    map = googleMap;

    map.setMapType(GoogleMap.MAP_TYPE_NONE);

    map.setOnInfoWindowClickListener(this);
    map.setOnMapClickListener(this);
    map.setOnMarkerClickListener(this);
    map.setOnMapLongClickListener(this);

    LatLng latLng = new LatLng(0.0, 0.0);
    float zoom = map.getCameraPosition().zoom < 1 ? 1 : map.getCameraPosition().zoom;
    map.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoom), new CancelableCallback() {
        @Override
        public void onCancel() {
            // TODO
        }
        @Override
        public void onFinish() {
            // TODO
        }
    });

    offlineMap = new OfflineMap(map);
    offlineMap.setVisible(true);

    geoPackageMapOverlays = new GeoPackageMapOverlays(getActivity(), mapView, map);

    refreshMapMarkers();
}
 
开发者ID:ngageoint,项目名称:disconnected-content-explorer-android,代码行数:32,代码来源:ReportMapFragment.java

示例7: changeCamera

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
/**
 * Change the camera position by moving or animating the camera depending on the state of the
 * animate toggle button.
 */
private void changeCamera(CameraUpdate update, CancelableCallback callback) {
    if (mAnimateToggle.isChecked()) {
        if (mCustomDurationToggle.isChecked()) {
            int duration = mCustomDurationBar.getProgress();
            // The duration must be strictly positive so we make it at least 1.
            mMap.animateCamera(update, Math.max(duration, 1), callback);
        } else {
            mMap.animateCamera(update, callback);
        }
     } else {
        mMap.moveCamera(update);
    }
}
 
开发者ID:benbek,项目名称:HereAStory-Android,代码行数:18,代码来源:CameraDemoActivity.java

示例8: changeCamera

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
/**
 * Change the camera position by moving or animating the camera depending on the state of the
 * animate toggle button.
 */
private void changeCamera(CameraUpdate update, CancelableCallback callback) {
    if (mAnimateToggle.isChecked()) {
        if (mCustomDurationToggle.isChecked()) {
            int duration = mCustomDurationBar.getProgress();
            // The duration must be strictly positive so we make it at least 1.
            mMap.animateCamera(update, Math.max(duration, 1), callback);
        } else {
            mMap.animateCamera(update, callback);
        }
    } else {
        mMap.moveCamera(update);
    }
}
 
开发者ID:nicolasjafelle,项目名称:GoogleMapsV2Demo,代码行数:18,代码来源:CameraDemoActivity.java

示例9: changeCamera

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
/**
 * Change the camera position by moving or animating the camera depending on
 * input parameter.
 */
private void changeCamera(CameraUpdate update, CancelableCallback callback,
		boolean instant) {

	if (instant) {
		mMap.animateCamera(update, 1, callback);
	} else {
		mMap.animateCamera(update, 4000, callback);
	}
}
 
开发者ID:KAPLANDROID,项目名称:Shortest-Path-Direction-on-Google-Maps-v2-for-Android,代码行数:14,代码来源:MapActivity.java

示例10: showMarkerInfoWindow

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
public boolean showMarkerInfoWindow(ContactsItem contact, boolean animate) {
	if (mMap == null || contact == null) {
		return false;
	}
	final Marker marker = mContactMarkerHashMap.get(contact.hashCode());
	if (marker == null) {
		return false;
	}
	if (animate) {
		mMap.animateCamera(
			CameraUpdateFactory.newCameraPosition(
				new CameraPosition.Builder()
					.target(marker.getPosition())
					.zoom(15.5f)
					.build()
			),
			new CancelableCallback() {
				@Override
				public void onCancel() {
				}

				@Override
				public void onFinish() {
					marker.showInfoWindow();
				}
			}
		);
	} else {
		marker.showInfoWindow();
	}
	return true;
}
 
开发者ID:yuukis,项目名称:businessmap,代码行数:33,代码来源:ContactsMapFragment.java

示例11: showInfoWindow

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
/**
 * Show the InfoWindow for the passed Marker and ClusterPoint
 * 
 * @param marker
 * @param clusterPoint
 */
public void showInfoWindow(Marker marker, ClusterPoint clusterPoint) {
	GoogleMap map = mapRef.get();
	if (map != null && marker != null && clusterPoint != null) {
		long dirtyUntil = System.currentTimeMillis() + options.getShowInfoWindowAnimationDuration();
		innerCallbackListener.clusteringOnCameraChangeListener.setDirty(dirtyUntil);
		CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLng(marker.getPosition());
		map.animateCamera(cameraUpdate, options.getShowInfoWindowAnimationDuration(), new CancelableCallback() {

			@Override
			public void onFinish() {
				innerCallbackListener.handler.post(new Runnable() {

					@Override
					public void run() {
						innerCallbackListener.clusteringOnCameraChangeListener.setDirty(0);

					}
				});
			}

			@Override
			public void onCancel() {
				innerCallbackListener.clusteringOnCameraChangeListener.setDirty(0);
			}
		});
		marker.showInfoWindow();
	}
}
 
开发者ID:twotoasters,项目名称:clusterkraf,代码行数:35,代码来源:Clusterkraf.java

示例12: animateCamera

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
@Override
public final void animateCamera(CameraUpdate update, CancelableCallback callback) {
    map.animateCamera(update, callback);
}
 
开发者ID:mosquitolabs,项目名称:referendum_1o_android,代码行数:5,代码来源:GoogleMapWrapper.java

示例13: animateCamera

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
public void animateCamera(CameraUpdate update, CancelableCallback callback){
	this.map.animateCamera(update, callback);
}
 
开发者ID:OpenATK,项目名称:Field-Work,代码行数:4,代码来源:ATKMap.java

示例14: animateCamera

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
@Override
public final void animateCamera(CameraUpdate update, CancelableCallback callback) {
	map.animateCamera(update, callback);
}
 
开发者ID:mtransitapps,项目名称:mtransit-for-android,代码行数:5,代码来源:GoogleMapWrapper.java

示例15: OnDirectionListReceived

import com.google.android.gms.maps.GoogleMap.CancelableCallback; //导入依赖的package包/类
@Override
public void OnDirectionListReceived(List<LatLng> mPointList) {
	if (mPointList != null) {
		PolylineOptions rectLine = new PolylineOptions().width(10).color(
				Color.RED);
		for (int i = 0; i < mPointList.size(); i++) {
			rectLine.add(mPointList.get(i));
		}
		mMap.addPolyline(rectLine);

		CameraPosition mCPFrom = new CameraPosition.Builder()
				.target(startPosition).zoom(15.5f).bearing(0).tilt(25)
				.build();
		final CameraPosition mCPTo = new CameraPosition.Builder()
				.target(destinationPosition).zoom(15.5f).bearing(0)
				.tilt(50).build();

		changeCamera(CameraUpdateFactory.newCameraPosition(mCPFrom),
				new CancelableCallback() {
					@Override
					public void onFinish() {
						changeCamera(CameraUpdateFactory
								.newCameraPosition(mCPTo),
								new CancelableCallback() {

									@Override
									public void onFinish() {

										LatLngBounds bounds = new LatLngBounds.Builder()
												.include(startPosition)
												.include(
														destinationPosition)
												.build();
										changeCamera(
												CameraUpdateFactory
														.newLatLngBounds(
																bounds, 50),
												null, false);
									}

									@Override
									public void onCancel() {
									}
								}, false);
					}

					@Override
					public void onCancel() {
					}
				}, true);
	}
}
 
开发者ID:KAPLANDROID,项目名称:Shortest-Path-Direction-on-Google-Maps-v2-for-Android,代码行数:53,代码来源:MapActivity.java


注:本文中的com.google.android.gms.maps.GoogleMap.CancelableCallback类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。