Google. Maps. MapLoadRegion
Encapsulates a region of the map to load.
Summary
The method MapsService.MakeMapLoadRegion creates an instance of the MapLoadRegion
class to load tiles for the MapsService.
The following code example loads the region of the map that is visible in the main camera's viewport.
MapsService.MakeMapLoadRegion().AddViewport(Camera.main).Load(options);
Public functions |
|
---|---|
AddBounds(Bounds bounds)
|
Adds rectangular bounds to the map region.
|
AddCircle(Vector3 center, float radius)
|
Adds a circular area to the map region.
|
AddViewport(Camera camera, float maxDistance)
|
|
AddViewport(Camera camera, Transform transform, float maxDistance)
|
|
Clear()
|
void
Clears the contents of this region.
|
Expand(float distance)
|
Grows the region in every direction by at least the given distance.
|
Load(GameObjectOptions options)
|
Loads the portion of the map defined by this region at the zoom level specified by the MapsService.
|
SetGroundHeight(float height)
|
Sets the height of the ground plane.
|
SetLoadingPoint(Vector3? point)
|
Sets the point in world space where tiles should load first.
|
UnloadOutside()
|
Unloads the map outside this region.
|
UnloadOutside(int zoom)
|
Unloads the map outside this region, at the specified zoom level.
|
Public functions
AddBounds
MapLoadRegion AddBounds( Bounds bounds )
Adds rectangular bounds to the map region.
Details | |||
---|---|---|---|
Parameters |
|
AddCircle
MapLoadRegion AddCircle( Vector3 center, float radius )
Adds a circular area to the map region.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
AddViewport
MapLoadRegion AddViewport( Camera camera, float maxDistance )
Adds an area to the map region based on the camera's view frustum.
Overrides SetLoadingPoint.
The loaded area of the map is limited by the camera's far clip plane. If this loads too much, especially at shallow camera angles, then it can be limited further by maxDistance
. It also loads the Camera to access the camera data in the scene. camera
is used to sort the tiles based on their distance from the camera before loading so that tiles that are closest to the camera load first. Note: Calling this method multiple times with different cameras simply sorts the tiles by distance from the last camera
.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
AddViewport
MapLoadRegion AddViewport( Camera camera, Transform transform, float maxDistance )
Adds an area to the map region based on the camera's view frustum and given transform.
Overrides SetLoadingPoint.
The loaded area of the map is limited by the camera's far clip plane. If this loads too much, especially at shallow camera angles, then it can be limited further by maxDistance
. It also loads the Camera to access the camera data in the scene. camera
is used to sort the tiles based on their distance from the camera before loading so that tiles that are closest to the camera load first. Note: Calling this method multiple times with different cameras simply sorts the tiles by distance from the last camera
.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
Clear
void Clear()
Clears the contents of this region.
Expand
MapLoadRegion Expand( float distance )
Grows the region in every direction by at least the given distance.
Details | |||
---|---|---|---|
Parameters |
|
Load
MapLoadRegion Load( GameObjectOptions options )
Loads the portion of the map defined by this region at the zoom level specified by the MapsService.
Details | |||
---|---|---|---|
Parameters |
|
SetGroundHeight
MapLoadRegion SetGroundHeight( float height )
Sets the height of the ground plane.
This changes how the region is projected onto the area of the map to load - for example, it changes the plane that the camera frustum is projected onto for AddViewport(Camera, float). It does not change the position of loaded map features.
Details | |||
---|---|---|---|
Parameters |
|
SetLoadingPoint
MapLoadRegion SetLoadingPoint( Vector3? point )
Sets the point in world space where tiles should load first.
The SDK loads tiles in an order that corresponds to their distance from this point.
The tiles that are closest to this point are loaded first, and then more distant tiles are loaded.
Details | |||
---|---|---|---|
Parameters |
|
UnloadOutside
MapLoadRegion UnloadOutside( int zoom )
Unloads the map outside this region, at the specified zoom level.
Details | |||
---|---|---|---|
Parameters |
|