It's the 15th anniversary of Google Maps Platform - Check out the latest news and announcements

Google.Maps.Loading.MapLoader

Script that attaches to a GameObject with a Camera component, and loads a region of the map visible to that camera.

Summary

Inheritance

Inherits from: MonoBehaviour

Public types

RegionShapeEnum{
  Circle,
  Viewport
}
enum
Enum representing the possible shapes of map regions to load.

Public attributes

Horizon = 10000
float
Maximum distance from the camera at which to load the map.
MapsService
The MapsService to be used to load the map.
RegionShape = RegionShapeEnum.Circle
Shape of region to load.
UnloadUnusedSeconds = 10
float
Only unload parts of the map that have been inactive for at least this long.
Zoom = 17
int
Zoom level at which to load the map.

Public functions

Init(GameObjectOptions loadingOptions)
void
Initializes the script with options to use when loading the map. This must be called before Load is called for the first time.
Load()
void
Loads the region of the map based on the camera's current position.
UnloadUnused()
void
Unloads parts of the map that have not been loaded or displayed in the last UnloadUnusedSeconds seconds.

Public types

RegionShapeEnum

 RegionShapeEnum

Enum representing the possible shapes of map regions to load.

Properties
Circle

Loads a circular region of the map centered on the camera.

Viewport

Loads the region of the map visible to the camera.

Public attributes

Horizon

float Horizon = 10000

Maximum distance from the camera at which to load the map.

MapsService

MapsService MapsService

The MapsService to be used to load the map.

RegionShape

RegionShapeEnum RegionShape = RegionShapeEnum.Circle

Shape of region to load.

UnloadUnusedSeconds

float UnloadUnusedSeconds = 10

Only unload parts of the map that have been inactive for at least this long.

Zoom

int Zoom = 17

Zoom level at which to load the map.

Public functions

Init

void Init(
  GameObjectOptions loadingOptions
)

Initializes the script with options to use when loading the map. This must be called before Load is called for the first time.

Details
Parameters
loadingOptions
Options used to load the map.

Load

void Load()

Loads the region of the map based on the camera's current position.

UnloadUnused

void UnloadUnused()

Unloads parts of the map that have not been loaded or displayed in the last UnloadUnusedSeconds seconds.