GoogleMap3D

public final class GoogleMap3D


Controller class of the map3d functionality powering the Map3DView.

Summary

Public methods

final Marker

Adds a marker to the map.

final @NonNull Model

Adds a 3d model object to the map.

final @NonNull Polygon

Adds a polygon to the map.

final @NonNull Polyline

Adds a polyline to the map.

final void

Moves the camera around a given the specified FlyAroundOptions object.

final void

Moves the camera parabolically based on the specified FlyToOptions object.

final Camera

Gets the current position of the camera.

final CameraRestriction

Gets the current camera restriction.

final int

Gets the map mode.

final void

Updates the 3d map camera position using the specified Camera object properties.

final void
setCameraAnimationEndListener(
    OnCameraAnimationEndListener cameraAnimationEndListener
)

Sets the camera animation end listener on the map3d view.

final void
setCameraChangedListener(
    OnCameraChangedListener cameraChangedListener
)

Sets the camera changed listener on the map3d view.

final void

Sets the camera restriction on the map3d view.

final void

Sets the click listener on the map3d view.

final void
setMapMode(@Map3DMode int mode)

Sets the map mode.

final void

Sets the scene rendered and ready listener on the map3d view.

final void

Sets the scene steady listener on the map3d view.

final void

Stops the current ongoing camera animation.

Public methods

addMarker

public final Marker addMarker(@NonNull MarkerOptions options)

Adds a marker to the map.

Parameters
@NonNull MarkerOptions options

The options for the marker.

Returns
Marker

The created or updated marker.

addModel

public final @NonNull Model addModel(@NonNull ModelOptions options)

Adds a 3d model object to the map.

Parameters
@NonNull ModelOptions options

The options for the model.

Returns
@NonNull Model

The created or updated model.

addPolygon

public final @NonNull Polygon addPolygon(@NonNull PolygonOptions polygonOptions)

Adds a polygon to the map.

Parameters
@NonNull PolygonOptions polygonOptions

The options for the polygon.

Returns
@NonNull Polygon

The created or updated polygon.

addPolyline

public final @NonNull Polyline addPolyline(@NonNull PolylineOptions polylineOptions)

Adds a polyline to the map.

Parameters
@NonNull PolylineOptions polylineOptions

The options for the polyline.

Returns
@NonNull Polyline

The created or updated polyline.

flyCameraAround

public final void flyCameraAround(@NonNull FlyAroundOptions options)

Moves the camera around a given the specified FlyAroundOptions object.

Parameters
@NonNull FlyAroundOptions options

The options for the fly around.

flyCameraTo

public final void flyCameraTo(@NonNull FlyToOptions options)

Moves the camera parabolically based on the specified FlyToOptions object.

Parameters
@NonNull FlyToOptions options

The options for the fly to.

getCamera

public final Camera getCamera()

Gets the current position of the camera.

Returns
Camera

The snapshot of the current camera position. Once returned, the caller should call this method again to get the latest camera position if the camera position may have changed.

getCameraRestriction

public final CameraRestriction getCameraRestriction()

Gets the current camera restriction.

Returns
CameraRestriction

The snapshot of the current camera restriction. Once returned, the caller should call this method again to get the latest camera restriction if the camera restriction may have changed.

getMapMode

@Map3DMode
public final int getMapMode()

Gets the map mode.

Returns
int

The map mode (which is one of the values in Map3DMode).

setCamera

public final void setCamera(@NonNull Camera camera)

Updates the 3d map camera position using the specified Camera object properties.

Parameters
@NonNull Camera camera

The camera object to be used to update the current 3d map camera position.

setCameraAnimationEndListener

public final void setCameraAnimationEndListener(
    OnCameraAnimationEndListener cameraAnimationEndListener
)

Sets the camera animation end listener on the map3d view.

Parameters
OnCameraAnimationEndListener cameraAnimationEndListener

The listener to be called when the camera animation ends.

setCameraChangedListener

public final void setCameraChangedListener(
    OnCameraChangedListener cameraChangedListener
)

Sets the camera changed listener on the map3d view.

Parameters
OnCameraChangedListener cameraChangedListener

The listener to be called when the camera is moved.

setCameraRestriction

public final void setCameraRestriction(CameraRestriction cameraRestriction)

Sets the camera restriction on the map3d view. To remove or reset the camera restriction, pass a null value or a new CameraRestriction object with all the properties set to null.

Parameters
CameraRestriction cameraRestriction

The camera restriction to be set on the map3d view.

setMap3DClickListener

public final void setMap3DClickListener(OnMap3DClickListener map3DClickListener)

Sets the click listener on the map3d view.

Parameters
OnMap3DClickListener map3DClickListener

The listener to be called when a click event occurs on the map3d view.

setMapMode

public final void setMapMode(@Map3DMode int mode)

Sets the map mode.

Parameters
@Map3DMode int mode

The map mode to set.

setOnMapReadyListener

public final void setOnMapReadyListener(OnMapReadyListener mapReadyListener)

Sets the scene rendered and ready listener on the map3d view.

Parameters
OnMapReadyListener mapReadyListener

The listener to be called when the scene is rendered and ready.

setOnMapSteadyListener

public final void setOnMapSteadyListener(OnMapSteadyListener mapSteadyListener)

Sets the scene steady listener on the map3d view.

Parameters
OnMapSteadyListener mapSteadyListener

The listener to be called when the scene is steady.

stopCameraAnimation

public final void stopCameraAnimation()

Stops the current ongoing camera animation.