Table of Contents

Class ScreenMapView

Namespace
LansMap.Map.Views

Fullscreen camera-drawn slippy map: the component you add to a scene to show a 2D raster map.

[DefaultExecutionOrder(100)]
public class ScreenMapView : BaseMapView, IMapFlyTarget, ITilePipelineTarget
Inheritance
object
Object
Component
Behaviour
MonoBehaviour
ScreenMapView
Implements
Inherited Members

Fields

ApiKey

[Tooltip("API key for providers that require one (MapTiler, Stadia, Thunderforest).")]
public string ApiKey

Field Value

string

ArcMode

[Tooltip("When FlyTo takes the zoom-out-then-in arc: Auto only for far off-screen jumps, Never, or Always.")]
public FlyToArcMode ArcMode

Field Value

FlyToArcMode

BaseMapLabels

[Tooltip("Off picks the provider's label-free style (Carto only). Pair with Place Labels Enabled for native upright labels over a clean base.")]
public bool BaseMapLabels

Field Value

bool

BuiltInAttribution

[Tooltip("Show the credit in the corner. Off only if you draw the same credit yourself (AttributionText / AttributionUrl).")]
public bool BuiltInAttribution

Field Value

bool

CacheDirectoryName

[Tooltip("Base-map cache directory under Application.persistentDataPath.")]
public string CacheDirectoryName

Field Value

string

CacheSizeMode

[Tooltip("Platform Default: up to 10 GB desktop, 2 GB phone, trimmed to free disk. Manual: the megabyte fields below. Disk cost is the cap plus a waste allowance of 3x the cap capped at 1 GB, so a 10 GB desktop cache can occupy 11 GB until it next tidies itself up.")]
public DiskCacheSizeMode CacheSizeMode

Field Value

DiskCacheSizeMode

CapacityMode

[Tooltip("Automatic (default) sizes the tile array from the screen, max tilt, and GPU memory. Manual uses LayerCount.")]
public TileCapacityMode CapacityMode

Field Value

TileCapacityMode

CoarsePrefetchDelta

[Tooltip("Also fetch this many coarser zoom levels. 0 = off. Extra requests; check your provider's terms.")]
public int CoarsePrefetchDelta

Field Value

int

CustomAttribution

[Tooltip("Credit text rendered in the overlay. Required by most tile services; leave empty only if your provider's terms say otherwise.")]
public string CustomAttribution

Field Value

string

CustomSubdomains

[Tooltip("Comma-separated subdomains for {s}, e.g. a,b,c.")]
public string CustomSubdomains

Field Value

string

CustomTextureFormat

[Tooltip("GPU format for custom tiles. RGB565 uses half the memory, no alpha, can band. Falls back to RGBA32 if unsupported.")]
public TileTextureFormat CustomTextureFormat

Field Value

TileTextureFormat

CustomTileSizePx

[Tooltip("Tile size the server delivers: 256 or 512.")]
public int CustomTileSizePx

Field Value

int

CustomUrlTemplate

[Header("Custom provider")]
[Tooltip("{z} {x} {y} URL. Put the key in as {key}, not in the address. {s} = subdomains.")]
public string CustomUrlTemplate

Field Value

string

DefaultCacheDirectoryName

public const string DefaultCacheDirectoryName = "lansmap-tiles"

Field Value

string

DefaultOverlayCacheDirectoryName

public const string DefaultOverlayCacheDirectoryName = "lansmap-tiles-overlay"

Field Value

string

DiskCacheMB

[Tooltip("Base-map disk cache cap, megabytes. Always used in Manual; in Platform Default only if you changed it from 256. Caps the index, not the file - evicted tiles stay until a rewrite. Disk cost is the cap plus a waste allowance of 3x the cap capped at 1 GB - about 1 GB of disk at 256 MB, 11 GB at 10240.")]
[Range(16, 32768)]
public int DiskCacheMB

Field Value

int

ExtraTileCodecs

[NonSerialized]
public IReadOnlyList<IRuntimeTileBlockCodec> ExtraTileCodecs

Field Value

IReadOnlyList<IRuntimeTileBlockCodec>

FadeAllLoads

[Tooltip("On (default): every tile load fades. Off: only zoom-level swaps fade. No effect if Tile Fade Seconds is 0.")]
public bool FadeAllLoads

Field Value

bool

HorizonFadeEnabled

Fades the far edge of the map into HorizonFogColor instead of ending it at a hard line; off by default.

[Tooltip("Fade distant tiles into the fog color instead of ending the map at a hard line. Off by default. Only visible past tilt 60.")]
public bool HorizonFadeEnabled

Field Value

bool

Remarks

Only visible on a map tilted steeply enough for the far edge to be on screen, which under the shipped camera model means past tilt 60. Costs one blend per drawn pixel and no extra draw call.

HorizonFogColor

Color distant tiles fade toward; match it to the camera's background so the map meets the sky without a seam.

[Tooltip("Color distant tiles fade into. Match your camera's background so the map meets the sky without a seam.")]
public Color HorizonFogColor

Field Value

Color

HorizonFogStartFraction

Where the fade starts, as a fraction of the maximum view distance; 0.55 by default, higher starts the fade later and makes it sharper.

[Tooltip("Where the fade starts, as a fraction of the maximum view distance. Higher starts it later and makes it sharper.")]
[Range(0, 0.99)]
public double HorizonFogStartFraction

Field Value

double

Remarks

The fade always completes exactly at the far edge, so this only moves its near end. At 0.55 the band covers about 14 percent of screen height at tilt 75 and 4.6 percent at tilt 85.

IdleFrameInterval

[Tooltip("Render every Nth frame while idle (higher = more battery, choppier resume).")]
[Range(2, 20)]
public int IdleFrameInterval

Field Value

int

IdleThrottleEnabled

[Tooltip("Skip extra frames when the map is still. On by default.")]
public bool IdleThrottleEnabled

Field Value

bool

LabelFadeSeconds

Seconds a label fades in on winning declutter and out on losing it; 0 pops instantly.

[Tooltip("Seconds a label takes to fade in or out when decluttering changes which labels win. 0.3 default. 0 = instant. Can change while running.")]
public double LabelFadeSeconds

Field Value

double

LabelFont

[Tooltip("Optional font for marker labels; empty = built-in LegacyRuntime.ttf.")]
public Font LabelFont

Field Value

Font

LabelRebuildThrottleSeconds

public const double LabelRebuildThrottleSeconds = 0.1

Field Value

double

LabelSizePx

[Tooltip("Marker label font size in pixels.")]
public int LabelSizePx

Field Value

int

LayerCount

[Tooltip("Tile images kept in graphics memory. About 1 MB each at 512 px uncompressed. Ignored unless Capacity Mode is Manual.")]
public int LayerCount

Field Value

int

MaxFlySeconds

[Tooltip("Ceiling for van Wijk long-jump flight time in seconds.")]
public double MaxFlySeconds

Field Value

double

MaxViewDistanceFactor

Advanced: how far the map draws ground, in multiples of the camera distance; 2.37 by default, exactly the reach of a tilt-60 view.

[Tooltip("Advanced. How far the map draws, in multiples of the camera distance. 2.37 matches a tilt-60 view. Raising this fetches more distant tiles; cost grows with the square.")]
[Range(1, 4)]
public double MaxViewDistanceFactor

Field Value

double

Remarks

This cap is always in effect, whatever HorizonFadeEnabled says: it is what keeps the tile count finite when the map is tilted steeply. Raising it fetches more distant tiles and the cost grows with the square. Clamped to MaxViewDistanceFactorCeiling.

MemoryPolicy

[NonSerialized]
public TileMemoryPolicy MemoryPolicy

Field Value

TileMemoryPolicy

OverlayApiKey

public string OverlayApiKey

Field Value

string

OverlayCacheDirectoryName

[Tooltip("Overlay cache directory under Application.persistentDataPath. It must resolve to a different path from the base-map cache.")]
public string OverlayCacheDirectoryName

Field Value

string

OverlayCacheMB

[Tooltip("Overlay disk cache cap, megabytes. Same rule as the base map, default 128. Disk cost is the cap plus a waste allowance of 3x the cap capped at 1 GB - about 512 MB of disk at 128 MB.")]
[Range(16, 32768)]
public int OverlayCacheMB

Field Value

int

OverlayEnabled

[Header("Overlay layer")]
[Tooltip("Second tile source composited over the base with alpha (traffic, hillshade, transit).")]
public bool OverlayEnabled

Field Value

bool

OverlayOpacity

[Range(0, 1)]
[Tooltip("Overlay opacity over the base map.")]
public float OverlayOpacity

Field Value

float

OverlayProvider

public TileProvider OverlayProvider

Field Value

TileProvider

OverlayRetina512

[Tooltip("512 px @2x overlay tiles where the provider serves them.")]
public bool OverlayRetina512

Field Value

bool

OverlayStyle

public string OverlayStyle

Field Value

string

PitchDeg

[Tooltip("Camera tilt in degrees, 0 = top-down, max 85. Past 70 the sub-pixel positioning budget no longer covers markers raised above the ground.")]
public double PitchDeg

Field Value

double

PitchDistanceLodEnabled

[Tooltip("On: far rows of a tilted map use coarser tiles. Off (default): one zoom for the whole view. No effect at tilt 0.")]
public bool PitchDistanceLodEnabled

Field Value

bool

PlaceLabelsEnabled

[Tooltip("Upright place-name labels from OpenFreeMap vector tiles (keyless). Hybrid look: vector labels drawn over any raster base.")]
public bool PlaceLabelsEnabled

Field Value

bool

Provider

[Tooltip("Tile source. Default OpenStreetMap is for trying the asset; pick your own before you ship.")]
public TileProvider Provider

Field Value

TileProvider

ProviderStyle

[Tooltip("Provider style name, empty = provider default (e.g. MapTiler: streets-v4).")]
public string ProviderStyle

Field Value

string

RasterQualityComparisonPanelEnabled

[Tooltip("On-screen raster quality comparison controls. Debug/demo only.")]
public bool RasterQualityComparisonPanelEnabled

Field Value

bool

RegisteredProviderId

[Tooltip("Id of your own provider registered with TileProviderRegistry. Read only when Provider is Registered.")]
public string RegisteredProviderId

Field Value

string

Retina512Tiles

[Tooltip("512 px @2x tiles where the provider serves them (MapTiler, Stadia, Carto): sharper on high-DPI, ~4x fewer requests. Ignored elsewhere.")]
public bool Retina512Tiles

Field Value

bool

SharedStore

[NonSerialized]
public MarkerStore SharedStore

Field Value

MarkerStore

TerrainDebugView

Replaces the terrain's sampled basemap color with a diagnostic overlay (distance-from-camera heatmap, or a tint by which fetched elevation tile supplied each fragment's height); off by default and no effect on the flat tile path.

[Tooltip("Diagnostic only. Replaces terrain color with a distance heatmap or a coverage-source tint (which fetched DEM tile supplied each fragment's height). Off by default.")]
public TerrainDebugViewMode TerrainDebugView

Field Value

TerrainDebugViewMode

TileBytesPerPixel

public const int TileBytesPerPixel = 4

Field Value

int

TileCompressionPreference

[Tooltip("Codec preference for tiles in graphics memory. First one this device supports wins. Built-in: astc4x4, etc2, bc1. Empty = uncompressed. Set before Play, or switch providers.")]
public List<string> TileCompressionPreference

Field Value

List<string>

TileCounterDebugPanelEnabled

[Tooltip("On-screen tile counts (download, disk, memory). Off by default; debug only.")]
public bool TileCounterDebugPanelEnabled

Field Value

bool

TileFadeSeconds

[Tooltip("Crossfade length in seconds. 0.2 default. 0 = instant. Can change while running.")]
public double TileFadeSeconds

Field Value

double

TileFloorMaxZoom

[Tooltip("Pre-download z0 through this level to disk only (not GPU), when idle. z0-z4 is 341 tiles, about 5-10 MB. Set before Play. Overlay gets its own copy if enabled.")]
public int TileFloorMaxZoom

Field Value

int

TileFloorPrefetchEnabled

[Tooltip("Turns the disk pre-download on. Can change while running. Some low-rate providers skip it anyway.")]
public bool TileFloorPrefetchEnabled

Field Value

bool

TileMemoryBudgetMB

[Tooltip("GPU memory for resident tiles, megabytes. 0 = from the device. LayerCount is clamped down to fit, never raised.")]
public int TileMemoryBudgetMB

Field Value

int

TileMipsEnabled

[Tooltip("Mip chains and trilinear on the tile arrays. Smooths far tiles when tilted. About +33% tile memory. Set before Play, or switch providers to apply.")]
public bool TileMipsEnabled

Field Value

bool

TileUserAgent

[NonSerialized]
public string TileUserAgent

Field Value

string

Verbose

[Tooltip("Log tile-pipeline counters every 5 s. Off by default.")]
public bool Verbose

Field Value

bool

WebGpuDirectUploadEnabled

[Tooltip("Browser only, experimental: skip a memory copy by uploading decoded tiles straight to the GPU. Off by default. Requires Web Worker Decode. Set before Play, or switch providers to apply.")]
public bool WebGpuDirectUploadEnabled

Field Value

bool

WebWorkerDecodeEnabled

[Tooltip("Browser only: decode tiles in a background worker so zooming stays smooth. Off by default. Set before Play, or switch providers to apply.")]
public bool WebWorkerDecodeEnabled

Field Value

bool

ZoomHysteresisSeconds

[Tooltip("Seconds the previous zoom's tiles stay in memory after you zoom. 0 = off. A round-trip window, not a stay-alive timer.")]
public double ZoomHysteresisSeconds

Field Value

double

Properties

AnchorOffsetTiles

public double AnchorOffsetTiles { get; }

Property Value

double

AttributionText

public string AttributionText { get; }

Property Value

string

AttributionUrl

public string AttributionUrl { get; }

Property Value

string

Batch

public TileBatchRenderer Batch { get; }

Property Value

TileBatchRenderer

Camera

public Camera Camera { get; }

Property Value

Camera

CurrentOverlayView

public MapViewTransform CurrentOverlayView { get; }

Property Value

MapViewTransform

CurrentView

The transform answering every projection question for this view this frame; cached by the subclass, never allocate per read.

public override MapViewTransform CurrentView { get; }

Property Value

MapViewTransform

DiskCacheMaxBytes

Bytes the base-map disk cache may currently hold, 0 if no pipeline.

public long DiskCacheMaxBytes { get; }

Property Value

long

EffectiveMemoryPolicy

public TileMemoryPolicy EffectiveMemoryPolicy { get; }

Property Value

TileMemoryPolicy

ElevationEnabled

public bool ElevationEnabled { get; set; }

Property Value

bool

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 override IElevationSampler ElevationSampler { get; }

Property Value

IElevationSampler

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).

IsFlying

public bool IsFlying { get; }

Property Value

bool

LayerStack

The ordered layer stack (named layers plus externally-registered overlays) this view draws every frame - see RegisterExternalOverlay(IMapScreenSpaceOverlay).

protected override MapLayerStack LayerStack { get; }

Property Value

MapLayerStack

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.

OverlayBatch

public TileBatchRenderer OverlayBatch { get; }

Property Value

TileBatchRenderer

OverlayStreamer

public TileStreamer OverlayStreamer { get; }

Property Value

TileStreamer

ResolvedUserAgent

public string ResolvedUserAgent { get; }

Property Value

string

SelectionPinBudget

The distinct-tile budget the live streamer's own capacity-drop loop compares selection against, or the sizing recommendation when no streamer is live yet.

public int SelectionPinBudget { get; }

Property Value

int

Streamer

public TileStreamer Streamer { get; }

Property Value

TileStreamer

Methods

ApplyHorizonFadeTo(TileBatchRenderer, MapViewTransform)

Applies this map's horizon-fade settings to a tile renderer for a given view.

public void ApplyHorizonFadeTo(TileBatchRenderer batch, MapViewTransform view)

Parameters

batch TileBatchRenderer

Renderer to configure; null is ignored.

view MapViewTransform

View the fade band is measured against.

Remarks

Public so an offline renderer that owns its own TileBatchRenderer - the capture harness does - draws the same fade the live component draws, from this one derivation rather than a copy of the arithmetic that can drift from it.

ApplyTileDependencies()

protected override void ApplyTileDependencies()

AutoLayerCount(int)

Automatic layer count from this screen's worst-case footprint and a desktop-only floor-pin lower bound; tileSizePx is unused.

public int AutoLayerCount(int tileSizePx)

Parameters

tileSizePx int

Accepted to match RequestedLayerCount; the method reads the pipeline's tile size instead.

Returns

int

CancelFly()

Stops an in-flight FlyTo(double, double, double?, double), leaving the view where it is.

public void CancelFly()

CompactDiskCacheNow()

Tidies the disk tile cache now, reclaiming orphaned blobs, and returns true if any file got smaller.

public bool CompactDiskCacheNow()

Returns

bool

Remarks

This is a synchronous copy of everything the cache still holds - up to several seconds at desktop cache sizes - so call it at a moment a pause is acceptable, not during interaction. The map does this by itself when the app is paused, quits, or loses focus, so most apps never need it. The exception is an app that keeps running while unfocused (Application.runInBackground): it reaches none of those moments, so if its cache fills up it stops storing new tiles until something calls this. The warning logged in that state names this method. Not rate limited, unlike the automatic hooks - a caller asking for it explicitly has already decided it is affordable.

DeriveUserAgent(string, string)

Builds a tile-request User-Agent from the player's identifier and version.

public static string DeriveUserAgent(string identifier, string version)

Parameters

identifier string

Application identifier token; empty becomes "unknown-unity-app".

version string

Application version token; empty becomes "0".

Returns

string

DeviceTileMemoryBudgetMB()

GPU memory budget for resident tiles, in megabytes, from the effective policy.

public int DeviceTileMemoryBudgetMB()

Returns

int

EffectiveLayerCount(int, int, TileTextureFormat)

Layer count that will actually be allocated: requested clamped down to the memory budget, never raised.

public int EffectiveLayerCount(int requested, int tileSizePx, TileTextureFormat format = TileTextureFormat.RGBA32)

Parameters

requested int

Requested layer count before the budget clamp.

tileSizePx int

Tile size in px used to convert the megabyte budget into layers.

format TileTextureFormat

Uncompressed GPU format when blockBytesPer4x4 is 0.

Returns

int

EffectiveLayerCount(int, int, TileTextureFormat, int)

Layer count that will actually be allocated, including block-compressed tiles.

public int EffectiveLayerCount(int requested, int tileSizePx, TileTextureFormat format, int blockBytesPer4x4)

Parameters

requested int

Requested layer count before the budget clamp.

tileSizePx int

Tile size in px used to convert the megabyte budget into layers.

format TileTextureFormat

Uncompressed GPU format when blockBytesPer4x4 is not positive.

blockBytesPer4x4 int

Bytes per 4x4 compressed block; 0 or negative uses the uncompressed arithmetic.

Returns

int

FitToBounds(GeoBounds, ScreenSize, double)

Centers and zooms so bounds fit an explicit viewport.

public void FitToBounds(GeoBounds bounds, ScreenSize screen, double paddingPx = 60)

Parameters

bounds GeoBounds

Geographic extent to fit.

screen ScreenSize

Viewport size in px.

paddingPx double

Inset from each edge in px.

FitToBounds(GeoBounds, double)

Centers and zooms so bounds fit the live screen, ignoring the call when the screen is too small for paddingPx.

public void FitToBounds(GeoBounds bounds, double paddingPx = 60)

Parameters

bounds GeoBounds

Geographic extent to fit.

paddingPx double

Inset from each screen edge in screen px.

FitToMarkers(ScreenSize, double)

Centers and zooms to the live bulk markers using an explicit viewport, for callers outside a live player loop.

public void FitToMarkers(ScreenSize screen, double paddingPx = 60)

Parameters

screen ScreenSize

Viewport size in px.

paddingPx double

Inset from each edge in px.

FitToMarkers(double)

Centers and zooms to the live bulk markers, ignoring the call when the store is empty or the screen is too small for paddingPx.

public void FitToMarkers(double paddingPx = 60)

Parameters

paddingPx double

Inset from each screen edge in screen px.

FlyTo(double, double, double?, double)

Animates the view to a coordinate, snapping immediately when durationSeconds is not positive.

public void FlyTo(double lat, double lon, double? zoom = null, double durationSeconds = 0.3)

Parameters

lat double

Target latitude in degrees WGS84.

lon double

Target longitude in degrees WGS84.

zoom double?

Target zoom in Web Mercator zoom units; null keeps the current zoom.

durationSeconds double

Requested hop duration in seconds; nearby targets honor this exactly, far off-screen jumps take a longer zoom-out-then-in arc at their own pace, capped by MaxFlySeconds. See ArcMode to force or disable the arc.

IdentifiesNobody(string)

True when identifier is empty or a Unity default-company string.

public static bool IdentifiesNobody(string identifier)

Parameters

identifier string

Application identifier to test.

Returns

bool

MinimumLayerCount(int)

Smallest layer count that can pin the whole footprint: the footprint plus the evictable reserve.

public static int MinimumLayerCount(int worstCaseFootprint)

Parameters

worstCaseFootprint int

Tile count from WorstCaseFootprint(int, int).

Returns

int

RecommendedLayerCount(int)

Recommended layer count: two footprints (current plus last-frame retain) plus pin headroom, not a safety factor.

public static int RecommendedLayerCount(int worstCaseFootprint)

Parameters

worstCaseFootprint int

Tile count from WorstCaseFootprint(int, int).

Returns

int

RenderInto(MapViewTransform)

Draws the full map stack into the active render target with an arbitrary view.

public void RenderInto(MapViewTransform view)

Parameters

view MapViewTransform

View to render; typically a screenshot or export camera.

ReportUrpTargetSize(Camera, int, int)

Records the render-target dimensions URP selected for a camera.

public static void ReportUrpTargetSize(Camera camera, int width, int height)

Parameters

camera Camera
width int
height int

Remarks

Called by the URP renderer feature. It is useful to diagnostics because camera screen dimensions do not reveal a scaled intermediate target.

RequestedLayerCount(int)

Layer count this map asks for before the memory budget clamps it: Manual uses LayerCount; Automatic derives it and ignores tileSizePx.

public int RequestedLayerCount(int tileSizePx)

Parameters

tileSizePx int

Accepted to match ITilePipelineTarget; Automatic reads the pipeline's tile size instead.

Returns

int

ResolvedElevationCoverageTiles()

The resolved elevation coverage tiles for this view, from the current view location and zoom; null if elevation is off.

protected override IEnumerable<TileCoord> ResolvedElevationCoverageTiles()

Returns

IEnumerable<TileCoord>

Remarks

Used by drift detection and the pipeline's initial build.

SetDiskCacheMaxBytes(long)

Changes how much disk the tile cache may use while the app runs, for a consuming app that offers its user a storage setting.

public void SetDiskCacheMaxBytes(long maxDataBytes)

Parameters

maxDataBytes long

New cap in bytes. Must be positive.

Remarks

Growing takes effect immediately. Shrinking drops entries over the following frames rather than in this one. The overlay layer, if any, takes half, matching the inspector's base/overlay pair. This does not write the inspector fields, so it does not survive a scene reload: the consuming app owns persisting the user's choice.

Exceptions

ArgumentOutOfRangeException

Thrown when maxDataBytes is zero or negative. It is not clamped, unlike the inspector field: a slider handing this a zero is a bug in the consuming app and a cache silently resized to one megabyte hides it.

SetProvider(TileProvider, string, string, bool?, bool?)

Switches the tile provider and rebuilds the tile pipeline; before Start only the serialized fields change.

public void SetProvider(TileProvider provider, string style = "", string apiKey = null, bool? retina512 = null, bool? labels = null)

Parameters

provider TileProvider

Tile source preset.

style string

Provider style name; empty is the provider default.

apiKey string

API key; null leaves the current key unchanged.

retina512 bool?

512 px @2x tiles where the provider serves them; null leaves the current value.

labels bool?

Base-map labels on or off; null leaves the current value.

ShouldCatchUpLabelsAtRest(bool, bool)

True exactly once, the call after the view stops moving, so a caller whose throttle gate above otherwise never calls Rebuild again at rest still gets one settle-triggered call.

public static bool ShouldCatchUpLabelsAtRest(bool pendingRestSnap, bool viewMoved)

Parameters

pendingRestSnap bool

True when the most recent Rebuild call ran with the view still moving, so its anchor is left sub-pixel.

viewMoved bool

True when pan, zoom, rotate, or pitch changed since the last rebuild.

Returns

bool

ShouldRebuildLabels(bool, bool, double, double, double)

True when a marker drag must rebuild now, or when the view moved and the 0.1 s throttle has elapsed.

public static bool ShouldRebuildLabels(bool needsRebuild, bool viewMoved, double now, double lastRebuild, double throttleSeconds = 0.1)

Parameters

needsRebuild bool

True when a marker drag (or other label dirty) must bypass the throttle.

viewMoved bool

True when pan, zoom, rotate, or pitch changed since the last rebuild.

now double

Current time in seconds (realtimeSinceStartupAsDouble).

lastRebuild double

Time of the last rebuild, in the same seconds unit as now.

throttleSeconds double

Throttle window; defaults to LabelRebuildThrottleSeconds. A caller with its own cadence (e.g. PlaceLabelLayer) can pass its own window while sharing the same needsRebuild-bypasses-throttle semantics.

Returns

bool

TryGetUrpTargetSize(Camera, out Vector2Int)

Gets the most recently reported URP render-target dimensions for a camera.

public static bool TryGetUrpTargetSize(Camera camera, out Vector2Int size)

Parameters

camera Camera
size Vector2Int

Returns

bool

UnregisterExternalOverlay(IMapScreenSpaceOverlay)

public override void UnregisterExternalOverlay(IMapScreenSpaceOverlay overlay)

Parameters

overlay IMapScreenSpaceOverlay

Overlay to stop drawing.

ViewStateChanged(MapViewTransform, MapViewTransform)

True when center, zoom, bearing, pitch, altitude scale, or tile size differ; viewport size is not compared.

public static bool ViewStateChanged(MapViewTransform a, MapViewTransform b)

Parameters

a MapViewTransform

First view.

b MapViewTransform

Second view.

Returns

bool

WorstCaseFootprint(int, int)

Worst-case visible tile count for a screen of screenW x screenH under this map's settings at max pitch.

public int WorstCaseFootprint(int screenW, int screenH)

Parameters

screenW int

Viewport width in screen px.

screenH int

Viewport height in screen px.

Returns

int

Events

ViewChanged

public event Action<MapViewChange> ViewChanged

Event Type

Action<MapViewChange>