本文整理汇总了Java中com.google.android.gms.maps.model.GroundOverlayOptions类的典型用法代码示例。如果您正苦于以下问题:Java GroundOverlayOptions类的具体用法?Java GroundOverlayOptions怎么用?Java GroundOverlayOptions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GroundOverlayOptions类属于com.google.android.gms.maps.model包,在下文中一共展示了GroundOverlayOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addPulseRing
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入依赖的package包/类
private void addPulseRing(LatLng latLng) {
GradientDrawable d = new GradientDrawable();
d.setShape(GradientDrawable.OVAL);
d.setSize(500, 500);
d.setColor(ContextCompat.getColor(this, R.color.pulse_color));
Bitmap bitmap = Bitmap.createBitmap(d.getIntrinsicWidth()
, d.getIntrinsicHeight()
, Bitmap.Config.ARGB_8888);
// Convert the drawable to bitmap
Canvas canvas = new Canvas(bitmap);
d.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
d.draw(canvas);
// Radius of the circle
final int radius = 100;
// Add the circle to the map
circle = mMap.addGroundOverlay(new GroundOverlayOptions()
.position(latLng, 2 * radius).image(BitmapDescriptorFactory.fromBitmap(bitmap)));
}
示例2: placeBootprint
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入依赖的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();
}
}
示例3: showFloorOne
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入依赖的package包/类
private void showFloorOne(){
googlemap.clear();
if(overlay!=null) {
overlay.remove();
}
LatLng NEWARK = new LatLng(-16.500461, -68.134270);
GroundOverlayOptions newarkMap = new GroundOverlayOptions()
.image(BitmapDescriptorFactory.fromResource(R.drawable.cncp1))
.position(NEWARK, 30f, 30f);
overlay = googlemap.addGroundOverlay(newarkMap);
Marker marker = googlemap.addMarker(new MarkerOptions()
.position(new LatLng(-16.500495, -68.134284))
.title("Auditorio Principal")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_map)));
if(type!=0){
if(type==1){
marker.showInfoWindow();
type =0;
}
}
}
示例4: setupGroundOverlay
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入依赖的package包/类
/**
* Sets bitmap of floor plan as ground overlay on Google Maps
*/
private void setupGroundOverlay(IAFloorPlan floorPlan, Bitmap bitmap) {
if (mGroundOverlay != null) {
mGroundOverlay.remove();
}
if (mMap != null) {
BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(bitmap);
IALatLng iaLatLng = floorPlan.getCenter();
LatLng center = new LatLng(iaLatLng.latitude, iaLatLng.longitude);
GroundOverlayOptions fpOverlay = new GroundOverlayOptions()
.image(bitmapDescriptor)
.zIndex(0.0f)
.position(center, floorPlan.getWidthMeters(), floorPlan.getHeightMeters())
.bearing(floorPlan.getBearing());
mGroundOverlay = mMap.addGroundOverlay(fpOverlay);
}
}
示例5: addGroundOverlayToMap
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入依赖的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);
}
}
}
示例6: addGroundOverlay
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入依赖的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);
}
}
示例7: addGroundOverlayToMap
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入依赖的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);
}
}
}
示例8: setUpMap
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入依赖的package包/类
private void setUpMap() {
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(PLACE, 18));
mGroundOverlay = mMap.addGroundOverlay(new GroundOverlayOptions()
.image(BitmapDescriptorFactory.fromResource(R.drawable.floorplan39)).anchor(0.5f, 0.5f)
.position(PLACE, 60f, 60f)
.bearing(10f));
mMap.setOnMapLongClickListener(this);
mTransparencyBar.setOnSeekBarChangeListener(this);
if (mLatitude != null)
{
LatLng point = new LatLng(mLatitude, mLongitude);
mMap.addMarker(new MarkerOptions()
.position(point)
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_ORANGE))
.title(mDescription != null ? mDescription : "Target"));
}
}
示例9: addOverlay
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入依赖的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);
}
示例10: refresh
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入依赖的package包/类
public void refresh() {
CameraPosition cameraPosition = map.getCameraPosition();
if (cameraPosition.zoom >= MINIMUM_ZOOM_LEVEL) {
Projection projection = map.getProjection();
prepareBitmap();
draw(bitmap, projection);
float mapWidth = (float) SphericalUtil.computeDistanceBetween(
projection.getVisibleRegion().nearLeft,
projection.getVisibleRegion().nearRight);
if (overlay == null) {
GroundOverlayOptions background = new GroundOverlayOptions()
.image(BitmapDescriptorFactory.fromBitmap(bitmap))
.position(cameraPosition.target, mapWidth)
.bearing(cameraPosition.bearing)
.zIndex(zIndex);
overlay = map.addGroundOverlay(background);
} else {
overlay.setImage(BitmapDescriptorFactory.fromBitmap(bitmap));
overlay.setPosition(cameraPosition.target);
overlay.setDimensions(mapWidth);
overlay.setBearing(cameraPosition.bearing);
}
} else {
if (overlay != null) {
overlay.remove();
overlay = null;
}
}
}
示例11: showFloorTwo
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入依赖的package包/类
private void showFloorTwo(){
googlemap.clear();
if(overlay!=null) {
overlay.remove();
}
LatLng NEWARK = new LatLng(-16.500461, -68.134270);
GroundOverlayOptions newarkMap = new GroundOverlayOptions()
.image(BitmapDescriptorFactory.fromResource(R.drawable.cncp2))
.position(NEWARK, 30f, 30f);
overlay = googlemap.addGroundOverlay(newarkMap);
Marker marker = googlemap.addMarker(new MarkerOptions()
.position(new LatLng(-16.500425, -68.134262))
.title("Auditorio 2")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_map)));
if(type!=0){
if(type==2){
marker.showInfoWindow();
type =0;
}
}
marker = googlemap.addMarker(new MarkerOptions()
.position(new LatLng(-16.500501, -68.134340))
.title("Ambiente 1")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_map)));
if(type!=0){
if(type==3){
marker.showInfoWindow();
type =0;
}
}
}
示例12: drawOverlay
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入依赖的package包/类
private void drawOverlay( LatLng location, int width, int height ) {
GroundOverlayOptions options = new GroundOverlayOptions();
options.position(location, width, height);
options.image( BitmapDescriptorFactory
.fromBitmap( BitmapFactory
.decodeResource( getResources(), R.mipmap.ic_launcher ) ) );
getMap().addGroundOverlay(options);
}
示例13: 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);
}
示例14: addGroundOverlay
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入依赖的package包/类
public c addGroundOverlay(GroundOverlayOptions paramGroundOverlayOptions)
{
Parcel localParcel1 = Parcel.obtain();
Parcel localParcel2 = Parcel.obtain();
try
{
localParcel1.writeInterfaceToken("com.google.android.gms.maps.internal.IGoogleMapDelegate");
if (paramGroundOverlayOptions != null)
{
localParcel1.writeInt(1);
paramGroundOverlayOptions.writeToParcel(localParcel1, 0);
}
else
{
localParcel1.writeInt(0);
}
this.dU.transact(12, localParcel1, localParcel2, 0);
localParcel2.readException();
c localc = c.a.al(localParcel2.readStrongBinder());
return localc;
}
finally
{
localParcel2.recycle();
localParcel1.recycle();
}
}
示例15: addIcon
import com.google.android.gms.maps.model.GroundOverlayOptions; //导入依赖的package包/类
@UiThread
protected void addIcon(String text, LatLng position) {
GroundOverlayOptions groundOverlay = new GroundOverlayOptions()
.image(BitmapDescriptorFactory.fromBitmap(mIconGenerator.makeIcon(text)))
.position(position, 80);
final GroundOverlay marker = mMap.addGroundOverlay(groundOverlay);
mBusMarkers.add(marker);
}