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


Java GroundOverlayOptions类代码示例

本文整理汇总了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)));
}
 
开发者ID:hypertrack,项目名称:hypertrack-live-android,代码行数:23,代码来源:Home.java

示例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();
    }
}
 
开发者ID:BloopApp,项目名称:Bloop,代码行数:25,代码来源:BootprintMapFragment.java

示例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;
        }
    }

}
 
开发者ID:viniciusDSL,项目名称:Google-I-O-extended,代码行数:23,代码来源:MapFragment.java

示例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);
    }
}
 
开发者ID:IndoorAtlas,项目名称:android-sdk-examples,代码行数:23,代码来源:MapsOverlayActivity.java

示例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);
        }
    }
}
 
开发者ID:josegury,项目名称:AndroidMarkerClusteringMaps,代码行数:23,代码来源:KmlRenderer.java

示例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);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:18,代码来源:GoogleMap.java

示例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);
        }
    }
}
 
开发者ID:googlemaps,项目名称:android-maps-utils,代码行数:23,代码来源:KmlRenderer.java

示例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"));
    }
}
 
开发者ID:matt-williams,项目名称:blook8r,代码行数:22,代码来源:MapActivity.java

示例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);
}
 
开发者ID:aliumujib,项目名称:Nibo,代码行数:11,代码来源:BaseNiboFragment.java

示例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;
        }
    }
}
 
开发者ID:antoniocarlon,项目名称:richmaps,代码行数:33,代码来源:RichLayer.java

示例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;
        }
    }
}
 
开发者ID:viniciusDSL,项目名称:Google-I-O-extended,代码行数:34,代码来源:MapFragment.java

示例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);
}
 
开发者ID:tutsplus,项目名称:Android-GoogleMaps-Part1,代码行数:10,代码来源:MapFragment.java

示例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);
}
 
开发者ID:josegury,项目名称:AndroidMarkerClusteringMaps,代码行数:25,代码来源:KmlGroundOverlay.java

示例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();
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:28,代码来源:IGoogleMapDelegate.java

示例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);
}
 
开发者ID:runningcode,项目名称:CUMtd,代码行数:10,代码来源:GetStopResponseListener.java


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