Class BaseMapView
public abstract class BaseMapView : MonoBehaviour
- Inheritance
-
objectObjectComponentBehaviourMonoBehaviourBaseMapView
- Derived
Fields
AltitudeScale
[Tooltip("Visual multiplier for marker altitudes. 1 = true scale, 0.001 = compress 10 km to 10 m.")]
public double AltitudeScale
Field Value
ElevationSource
Terrain heights this map fetches, instead of the built-in
Terrarium tiles. Set it before Start. Null lets an attached
MapElevationSourceComponent, or the built-in source, decide.
[NonSerialized]
public IElevationSource ElevationSource
Field Value
Remarks
Read only when elevation is on. The map owns the lifecycle around the source: when to fetch, when to re-fetch as the view moves, and disposing what it produced.
InputSource
Mouse, keyboard and touch this map's built-in tools read. Set it
before Start to drive the map from your own input stack, or from a
test with no live device. Null lets an attached
MapInputSourceComponent, or Unity's own devices, answer.
[NonSerialized]
public IMapInputSource InputSource
Field Value
Latitude
[Tooltip("View center latitude in degrees (WGS84).")]
public double Latitude
Field Value
Longitude
[Tooltip("View center longitude in degrees (WGS84).")]
public double Longitude
Field Value
RotationDeg
[Tooltip("Map bearing in degrees, counterclockwise.")]
public double RotationDeg
Field Value
TileDependencies
Tile source, address builder, fetcher, tile store and codecs this map runs on, instead of a provider preset.
[NonSerialized]
public TilePipelineDependencies TileDependencies
Field Value
Remarks
Set it before Start, or call SetTileDependencies(TilePipelineDependencies)
afterwards. Null lets the inspector's provider (or an attached
MapTileDependenciesComponent) decide.
TileFilterMode
[Tooltip("Sampling for map tiles. Automatic uses trilinear with mip chains and bilinear without them. Point is a sharp but aliased diagnostic. Applied when the pipeline builds.")]
public TileFilterMode TileFilterMode
Field Value
TileFloorPinEnabled
[Tooltip("Keep those world tiles in GPU memory once loaded, so zooming out is instant. Can change while running.")]
public bool TileFloorPinEnabled
Field Value
TileFloorPinMaxZoom
[Tooltip("Deepest zoom of that pinned world slice. 4 = 341 tiles. A request, not a guarantee. Set before Play.")]
public int TileFloorPinMaxZoom
Field Value
WebAstcQuality
[Tooltip("Browser ASTC tile encoder search effort. Higher values improve raster detail but reduce worker tile throughput. Applied when the pipeline builds.")]
public WebAstcEncoderQuality WebAstcQuality
Field Value
Zoom
[Tooltip("Fractional map zoom level (Web Mercator).")]
public double Zoom
Field Value
Properties
CurrentView
The transform answering every projection question for this view this frame; cached by the subclass, never allocate per read.
public abstract MapViewTransform CurrentView { get; }
Property Value
DefaultPointerSurface
The real screen, read through this map's input source. What a tool falls back to when its own pointer surface is unset.
public IMapPointerSurface DefaultPointerSurface { get; }
Property Value
EffectiveInputSource
The mouse, keyboard and touch this map actually runs on. Never null.
public IMapInputSource EffectiveInputSource { get; }
Property Value
Remarks
Resolved on the first read and held for the map's lifetime: assign InputSource, or attach your component, before anything drives the map.
ElevationSampler
Ground height source this view's live terrain fetch has resolved, or null for a flat map (elevation off, or no live fetch has landed yet).
public abstract IElevationSampler ElevationSampler { get; }
Property Value
Remarks
Both subclasses build through the one TilePipelineHost
elevation fetch/lifecycle and forward its
ElevationTileSet.Sampler here - one data source for
whichever render mechanism each subclass actually uses (a
displaced tile mesh on a fullscreen map, a world-space mesh
draped over a tabletop's flat texture).
Info
Marker metadata (name, hover text, per-marker style), one store per view, always present.
public MarkerInfoStore Info { get; }
Property Value
Labels
Marker label tier; see Markers for the null contract.
public MarkerLabelLayer Labels { get; protected set; }
Property Value
LayerStack
The ordered layer stack (named layers plus externally-registered overlays) this view draws every frame - see RegisterExternalOverlay(IMapScreenSpaceOverlay).
protected abstract MapLayerStack LayerStack { get; }
Property Value
Remarks
Each subclass owns a different concrete draw path (ScreenMapView through its MapDrawCoordinator, SurfaceMapView through its own render-into-texture loop), so this exposes whichever MapLayerStack instance actually backs it rather than assuming one shared implementation.
Markers
Bulk marker tier; non-null on both shipped map types from the moment the component exists.
public virtual MarkerLayer Markers { get; protected set; }
Property Value
Remarks
ScreenMapView builds it in Awake; SurfaceMapView creates it lazily on first read. Virtual so a subclass may choose either.
PlaceLabels
Vector place-name tier; see Markers for the null contract.
public PlaceLabelLayer PlaceLabels { get; protected set; }
Property Value
Polygons
Polygon tier; see Markers for the lifetime contract.
public virtual PolygonLayer Polygons { get; protected set; }
Property Value
Polylines
Polyline tier; see Markers for the lifetime contract.
public virtual PolylineLayer Polylines { get; protected set; }
Property Value
Methods
ApplyTileDependencies()
protected virtual void ApplyTileDependencies()
FloorPinCapacityFloor()
protected int FloorPinCapacityFloor()
Returns
LatLonToScreen(double, double)
Projects a geographic coordinate to its position in the view's pixels (see ScreenToLatLon(Vector2) for the convention), following the nearest-copy rule under world wrap the same way tiles and markers draw; may legitimately lie outside the viewport.
public Vector2 LatLonToScreen(double lat, double lon)
Parameters
Returns
- Vector2
RefuseProviderChangeWithTileDependencies()
protected void RefuseProviderChangeWithTileDependencies()
RegisterExternalOverlay(IMapScreenSpaceOverlay)
Registers an externally-owned screen-space overlay (e.g. a MarkerClusterController) to draw after this view's own named layers, in the same order on either concrete view type.
public virtual void RegisterExternalOverlay(IMapScreenSpaceOverlay overlay)
Parameters
overlayIMapScreenSpaceOverlayOverlay to draw every frame until unregistered.
ResolveElevationSource()
protected IElevationSource ResolveElevationSource()
Returns
ResolveTileDependencies()
protected TilePipelineDependencies ResolveTileDependencies()
Returns
ResolvedElevationCoverageTiles()
The resolved elevation coverage tiles for this view, from the current view location and zoom; null if elevation is off.
protected abstract IEnumerable<TileCoord> ResolvedElevationCoverageTiles()
Returns
Remarks
Used by drift detection and the pipeline's initial build.
ScreenToLatLon(Vector2)
Unprojects a view position to a geographic coordinate, through the same double-precision re-anchored affine the renderer itself uses.
public LatLon ScreenToLatLon(Vector2 viewPx)
Parameters
viewPxVector2Position in the view's pixels, origin bottom left, Y increasing upward (Unity's Input.mousePosition convention). Screen pixels on a fullscreen map, render-texture pixels on a surface.
Returns
Remarks
This method and LatLonToScreen(double, double) are not exact inverses once the world repeats: this one wraps its result to the home copy, that one follows the nearest-copy rule. A round trip is an identity only within half a world copy of the view center.
SetTileDependencies(TilePipelineDependencies)
Hands the map a new set of tile dependencies: before Start it just records them, afterwards it tears the tile pipeline down and rebuilds on them, the same lifecycle a provider switch has.
public void SetTileDependencies(TilePipelineDependencies dependencies)
Parameters
dependenciesTilePipelineDependenciesThe new bundle, or null to hand the map back to its inspector provider.
UnregisterExternalOverlay(IMapScreenSpaceOverlay)
public virtual void UnregisterExternalOverlay(IMapScreenSpaceOverlay overlay)
Parameters
overlayIMapScreenSpaceOverlayOverlay to stop drawing.