package maplibre

import maplibre "github.com/maplibre/maplibre-native-ffi/bindings/go"

Package maplibre provides low-level Go bindings for the MapLibre Native C API.

Runtime, map, projection, render-session, acquired-frame, and offline operation handles follow the C API owner-thread model. Call runtime.LockOSThread before creating a RuntimeHandle and keep that runtime's lifecycle on the locked goroutine.

Index

Constants

const ExpectedCABIVersion uint32 = 0

ExpectedCABIVersion is the C ABI contract version supported by this Go binding.

Variables

var (
	// ErrInvalidArgument reports invalid arguments, released handles, invalid
	// enum values, invalid string shapes, or other binding-owned argument errors.
	ErrInvalidArgument = errors.New("maplibre: invalid argument")
	// ErrInvalidState reports valid objects used in an invalid lifecycle state.
	ErrInvalidState = errors.New("maplibre: invalid state")
	// ErrWrongThread reports use of an owner-thread-affine handle from the wrong
	// OS thread.
	ErrWrongThread = errors.New("maplibre: wrong thread")
	// ErrUnsupported reports a backend, platform, or operation unavailable in
	// the linked native build.
	ErrUnsupported = errors.New("maplibre: unsupported")
	// ErrNative reports a MapLibre Native error converted to a C status.
	ErrNative = errors.New("maplibre: native error")
	// ErrABIVersionMismatch reports that the loaded C ABI version is
	// incompatible with this binding.
	ErrABIVersionMismatch = errors.New("maplibre: ABI version mismatch")
	// ErrUnknownStatus reports a status value unknown to this binding version.
	ErrUnknownStatus = errors.New("maplibre: unknown native status")
)

Functions

func CVersion

func CVersion() uint32

CVersion returns the native C ABI contract version.

func ClearLogCallback

func ClearLogCallback() error

ClearLogCallback clears the process-global native log callback.

func SetAsyncLogSeverityMask

func SetAsyncLogSeverityMask(mask LogSeverityMask) error

SetAsyncLogSeverityMask controls which native log severities may dispatch asynchronously.

func SetLogCallback

func SetLogCallback(logCallback LogCallback) error

SetLogCallback installs or replaces the process-global native log callback.

func SetNetworkStatus

func SetNetworkStatus(status NetworkStatus) error

SetNetworkStatus sets MapLibre Native's process-global network status.

Types

type AmbientCacheOperation

type AmbientCacheOperation uint32

AmbientCacheOperation selects a native ambient cache maintenance operation.

const (
	AmbientCacheOperationResetDatabase AmbientCacheOperation = AmbientCacheOperation(C.MLN_AMBIENT_CACHE_OPERATION_RESET_DATABASE)
	AmbientCacheOperationPackDatabase  AmbientCacheOperation = AmbientCacheOperation(C.MLN_AMBIENT_CACHE_OPERATION_PACK_DATABASE)
	AmbientCacheOperationInvalidate    AmbientCacheOperation = AmbientCacheOperation(C.MLN_AMBIENT_CACHE_OPERATION_INVALIDATE)
	AmbientCacheOperationClear         AmbientCacheOperation = AmbientCacheOperation(C.MLN_AMBIENT_CACHE_OPERATION_CLEAR)
)

type AnimationOptions

type AnimationOptions struct {
	DurationMS *float64
	Velocity   *float64
	MinZoom    *float64
	Easing     *UnitBezier
	// TransitionID is a caller-chosen identity for the transition these options
	// start. When it is set, the transition emits exactly one
	// RuntimeEventMapCameraTransitionFinished event carrying this value,
	// whether it completes, is superseded, or is cancelled. The event marks the
	// moment the transition releases the camera and carries no outcome, so a
	// host that must tell completion from cancellation compares the resulting
	// camera or tracks which transition ID is current. A command this API
	// rejects starts no transition and emits no event.
	TransitionID *uint64
}

AnimationOptions configures camera transition animation behavior.

func (AnimationOptions) Equal
func (options AnimationOptions) Equal(other AnimationOptions) bool

Equal reports whether two descriptors hold the same field values.

func (AnimationOptions) WithDurationMS
func (options AnimationOptions) WithDurationMS(durationMS float64) AnimationOptions

WithDurationMS returns a copy that sets the duration in milliseconds.

func (AnimationOptions) WithEasing
func (options AnimationOptions) WithEasing(easing UnitBezier) AnimationOptions

WithEasing returns a copy that sets the cubic easing curve.

func (AnimationOptions) WithMinZoom
func (options AnimationOptions) WithMinZoom(minZoom float64) AnimationOptions

WithMinZoom returns a copy that sets the peak zoom for fly-to transitions.

func (AnimationOptions) WithTransitionID
func (options AnimationOptions) WithTransitionID(transitionID uint64) AnimationOptions

WithTransitionID returns a copy that stamps a caller-chosen identity on the transition these options start. See AnimationOptions.TransitionID.

func (AnimationOptions) WithVelocity
func (options AnimationOptions) WithVelocity(velocity float64) AnimationOptions

WithVelocity returns a copy that sets the fly-to velocity in screenfuls per second.

type BoundOptions

type BoundOptions struct {
	Bounds   *BoundsConstraint
	MinZoom  *float64
	MaxZoom  *float64
	MinPitch *float64
	MaxPitch *float64
}

BoundOptions configures map camera constraints.

func (BoundOptions) Equal
func (options BoundOptions) Equal(other BoundOptions) bool

Equal reports whether two descriptors hold the same field values.

func (BoundOptions) WithBounds
func (options BoundOptions) WithBounds(bounds LatLngBounds) BoundOptions

WithBounds returns a copy that keeps the camera center inside the given bounds.

func (BoundOptions) WithMaxPitch
func (options BoundOptions) WithMaxPitch(maxPitch float64) BoundOptions

WithMaxPitch returns a copy that sets maximum pitch.

func (BoundOptions) WithMaxZoom
func (options BoundOptions) WithMaxZoom(maxZoom float64) BoundOptions

WithMaxZoom returns a copy that sets maximum zoom.

func (BoundOptions) WithMinPitch
func (options BoundOptions) WithMinPitch(minPitch float64) BoundOptions

WithMinPitch returns a copy that sets minimum pitch.

func (BoundOptions) WithMinZoom
func (options BoundOptions) WithMinZoom(minZoom float64) BoundOptions

WithMinZoom returns a copy that sets minimum zoom.

func (BoundOptions) WithUnbounded
func (options BoundOptions) WithUnbounded() BoundOptions

WithUnbounded returns a copy that leaves the camera center unconstrained.

type BoundsConstraint

type BoundsConstraint struct {
	Kind BoundsConstraintKind
	// Bounds is read when Kind is BoundsConstraintBounded.
	Bounds LatLngBounds
}

BoundsConstraint is the geographic constraint applied to the map camera center. An unbounded constraint lets the map pan across the antimeridian, unlike world bounds of -90/-180 to 90/180, which clamp longitude.

type BoundsConstraintKind

type BoundsConstraintKind int

BoundsConstraintKind selects which case a BoundsConstraint carries.

const (
	// BoundsConstraintBounded keeps the camera center inside the constraint's bounds.
	BoundsConstraintBounded BoundsConstraintKind = iota
	// BoundsConstraintUnbounded leaves the camera center unconstrained.
	BoundsConstraintUnbounded
)

type CameraChangeMode

type CameraChangeMode uint32

CameraChangeMode reports whether a camera change belongs to an animated transition. It is the meaning of RuntimeEvent.Code for RuntimeEventMapCameraWillChange and RuntimeEventMapCameraDidChange.

const (
	// CameraChangeModeImmediate marks a camera that reached its new value
	// without an animated transition.
	CameraChangeModeImmediate CameraChangeMode = CameraChangeMode(C.MLN_CAMERA_CHANGE_MODE_IMMEDIATE)
	// CameraChangeModeAnimated marks a camera that moved as part of an animated
	// transition.
	CameraChangeModeAnimated CameraChangeMode = CameraChangeMode(C.MLN_CAMERA_CHANGE_MODE_ANIMATED)
)

type CameraFitOptions

type CameraFitOptions struct {
	Padding *EdgeInsets
	Bearing *float64
	Pitch   *float64
}

CameraFitOptions configures camera fitting queries.

func (CameraFitOptions) Equal
func (options CameraFitOptions) Equal(other CameraFitOptions) bool

Equal reports whether two descriptors hold the same field values.

func (CameraFitOptions) WithBearing
func (options CameraFitOptions) WithBearing(bearing float64) CameraFitOptions

WithBearing returns a copy that sets fit bearing.

func (CameraFitOptions) WithPadding
func (options CameraFitOptions) WithPadding(padding EdgeInsets) CameraFitOptions

WithPadding returns a copy that sets fit padding.

func (CameraFitOptions) WithPitch
func (options CameraFitOptions) WithPitch(pitch float64) CameraFitOptions

WithPitch returns a copy that sets fit pitch.

type CameraOptions

type CameraOptions struct {
	Center         *LatLng
	CenterAltitude *float64
	Padding        *EdgeInsets
	// Anchor is input-only: JumpTo, EaseTo, and FlyTo pivot the camera around
	// this screen point, and every read path reports it as nil.
	Anchor      *ScreenPoint
	Zoom        *float64
	Bearing     *float64
	Pitch       *float64
	Roll        *float64
	FieldOfView *float64
}

CameraOptions configures map camera snapshots and commands.

func (CameraOptions) Equal
func (options CameraOptions) Equal(other CameraOptions) bool

Equal reports whether two descriptors hold the same field values.

func (CameraOptions) WithBearing
func (options CameraOptions) WithBearing(bearing float64) CameraOptions

WithBearing returns a copy that sets the bearing field.

func (CameraOptions) WithCenter
func (options CameraOptions) WithCenter(center LatLng) CameraOptions

WithCenter returns a copy that sets the center coordinate.

func (CameraOptions) WithPitch
func (options CameraOptions) WithPitch(pitch float64) CameraOptions

WithPitch returns a copy that sets the pitch field.

func (CameraOptions) WithZoom
func (options CameraOptions) WithZoom(zoom float64) CameraOptions

WithZoom returns a copy that sets the zoom field.

type CanonicalTileID

type CanonicalTileID struct {
	Z uint32
	X uint32
	Y uint32
}

CanonicalTileID identifies one canonical tile.

type ConstrainMode

type ConstrainMode uint32

ConstrainMode controls map panning constraints.

const (
	ConstrainModeNone           ConstrainMode = ConstrainMode(C.MLN_CONSTRAIN_MODE_NONE)
	ConstrainModeHeightOnly     ConstrainMode = ConstrainMode(C.MLN_CONSTRAIN_MODE_HEIGHT_ONLY)
	ConstrainModeWidthAndHeight ConstrainMode = ConstrainMode(C.MLN_CONSTRAIN_MODE_WIDTH_AND_HEIGHT)
	ConstrainModeScreen         ConstrainMode = ConstrainMode(C.MLN_CONSTRAIN_MODE_SCREEN)
)

type CustomGeometrySourceOptions

type CustomGeometrySourceOptions struct {
	FetchTile  CustomGeometryTileCallback
	CancelTile CustomGeometryTileCallback
	MinZoom    *float64
	MaxZoom    *float64
	Tolerance  *float64
	TileSize   *uint32
	Buffer     *uint32
	Clip       *bool
	Wrap       *bool
}

CustomGeometrySourceOptions configures a custom geometry source. CancelTile is best-effort and may be repeated or race with FetchTile.

type CustomGeometryTileCallback

type CustomGeometryTileCallback func(CanonicalTileID)

CustomGeometryTileCallback receives custom geometry tile requests. Native code may invoke it on worker threads, racing owner-thread map calls, so it must be thread-safe, must not call MapLibre map APIs, and should queue SetCustomGeometrySourceTileData or invalidation work back to the map owner thread. Panics are recovered and ignored.

type EGLContextDescriptor

type EGLContextDescriptor struct {
	Display NativePointer
	Config  NativePointer
	// ShareContext is the EGLContext whose share group the session context
	// joins. Required under shared ownership, where the session also takes its
	// client API from this context. A dedicated session joins no share group,
	// so it must be zero there and names ClientAPI instead.
	ShareContext NativePointer
	// ClientAPI is the client API the session creates its context for.
	// Required under dedicated ownership. A shared session queries
	// ShareContext for it, so this is ignored there.
	ClientAPI      OpenGLClientAPI
	GetProcAddress NativePointer
}

EGLContextDescriptor contains EGL context provider data for OpenGL render targets.

type EdgeInsets

type EdgeInsets struct {
	Top    float64
	Left   float64
	Bottom float64
	Right  float64
}

EdgeInsets is a screen-space inset in logical map pixels.

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error describes a MapLibre Native binding or C status failure.

func (*Error) Diagnostic
func (e *Error) Diagnostic() string

Diagnostic returns the copied native diagnostic or binding-owned message.

func (*Error) Error
func (e *Error) Error() string

Error returns a human-readable failure description.

func (*Error) RawStatus
func (e *Error) RawStatus() (int32, bool)

RawStatus returns the C status value and whether this error came from native status conversion.

func (*Error) Unwrap
func (e *Error) Unwrap() error

Unwrap returns the stable category sentinel so errors.Is works.

type FeatureStateSelector

type FeatureStateSelector struct {
	SourceID      string
	SourceLayerID *string
	FeatureID     *string
	StateKey      *string
}

FeatureStateSelector selects feature state by source, feature, and key.

type FreeCameraOptions

type FreeCameraOptions struct {
	Position    *Vec3
	Orientation *Quaternion
}

FreeCameraOptions configures camera position and orientation directly.

func (FreeCameraOptions) Equal
func (options FreeCameraOptions) Equal(other FreeCameraOptions) bool

Equal reports whether two descriptors hold the same field values.

func (FreeCameraOptions) WithOrientation
func (options FreeCameraOptions) WithOrientation(orientation Quaternion) FreeCameraOptions

WithOrientation returns a copy that sets free camera orientation.

func (FreeCameraOptions) WithPosition
func (options FreeCameraOptions) WithPosition(position Vec3) FreeCameraOptions

WithPosition returns a copy that sets free camera position.

type GeoJSONSourceDataHandle

type GeoJSONSourceDataHandle struct {
	// contains filtered or unexported fields
}

GeoJSONSourceDataHandle owns prepared GeoJSON source data: one UTF-8 GeoJSON document parsed and tiled (or clustered) into the index a GeoJSON source consumes, with the source options baked in. The prepared data is immutable, so a live handle is safe to share across goroutines.

func NewGeoJSONSourceData
func NewGeoJSONSourceData(data []byte, options *StyleGeoJSONSourceOptions) (*GeoJSONSourceDataHandle, error)

NewGeoJSONSourceData prepares GeoJSON source data for installation on a map. data holds one complete UTF-8 GeoJSON document and options may be nil for defaults; both are copied into the prepared data before the call returns. Preparation touches no runtime or map and is callable from any goroutine, so the expensive parse and tiling can run off the map owner thread.

AddGeoJSONSourceData and SetGeoJSONSourceData borrow the handle, so one prepared value may be installed on any number of sources and closed at any time afterward; closing it never invalidates a source it was installed on.

func (*GeoJSONSourceDataHandle) Close
func (data *GeoJSONSourceDataHandle) Close() error

Close releases this prepared data. Close is callable from any goroutine, and a successful close makes later calls no-ops. Sources the data was installed on keep their own reference, so closing never invalidates a source.

type HttpHeader

type HttpHeader struct {
	Name  string
	Value string
}

HttpHeader is one owned outgoing HTTP request header.

type HttpHeaderTransformCallback

type HttpHeaderTransformCallback func(HttpHeaderTransformRequest) []HttpHeader

HttpHeaderTransformCallback supplies end-to-end headers for one native HTTP attempt. Panics and invalid or case-insensitively duplicated names leave the request unchanged.

type HttpHeaderTransformRequest

type HttpHeaderTransformRequest struct {
	Kind    ResourceKind
	RawKind uint32
	URL     string
}

HttpHeaderTransformRequest describes an outgoing HTTP attempt after URL transformation. Its fields are copied before the callback runs.

type ImageContent

type ImageContent struct {
	Left   float32
	Top    float32
	Right  float32
	Bottom float32
}

ImageContent holds content-box insets in image pixels, from the image's top-left.

type ImageStretch

type ImageStretch struct {
	From float32
	To   float32
}

ImageStretch is one stretchable interval along an image axis, in image pixels.

type LatLng

type LatLng struct {
	Latitude  float64
	Longitude float64
}

LatLng is a geographic coordinate in degrees.

func LatLngForProjectedMeters
func LatLngForProjectedMeters(meters ProjectedMeters) (LatLng, error)

LatLngForProjectedMeters converts Spherical Mercator projected meters to a geographic coordinate.

type LatLngBounds

type LatLngBounds struct {
	Southwest LatLng
	Northeast LatLng
}

LatLngBounds is a geographic bounds rectangle in degrees.

type LocationIndicatorImageKind

type LocationIndicatorImageKind uint32

LocationIndicatorImageKind identifies an image-name slot on a location indicator layer.

const (
	LocationIndicatorImageKindTop     LocationIndicatorImageKind = LocationIndicatorImageKind(C.MLN_LOCATION_INDICATOR_IMAGE_KIND_TOP)
	LocationIndicatorImageKindBearing LocationIndicatorImageKind = LocationIndicatorImageKind(C.MLN_LOCATION_INDICATOR_IMAGE_KIND_BEARING)
	LocationIndicatorImageKindShadow  LocationIndicatorImageKind = LocationIndicatorImageKind(C.MLN_LOCATION_INDICATOR_IMAGE_KIND_SHADOW)
)

type LogCallback

type LogCallback func(LogRecord) bool

LogCallback receives copied native log records. Native code may invoke it on worker threads or while internal logging locks are held. The callback must be thread-safe, return quickly, and must not call MapLibre APIs. Returning true consumes the record. Returning false, panicking, or installing no callback lets MapLibre Native's platform logger handle it.

type LogEvent

type LogEvent uint32

LogEvent is a native log category.

const (
	LogEventGeneral     LogEvent = LogEvent(C.MLN_LOG_EVENT_GENERAL)
	LogEventSetup       LogEvent = LogEvent(C.MLN_LOG_EVENT_SETUP)
	LogEventShader      LogEvent = LogEvent(C.MLN_LOG_EVENT_SHADER)
	LogEventParseStyle  LogEvent = LogEvent(C.MLN_LOG_EVENT_PARSE_STYLE)
	LogEventParseTile   LogEvent = LogEvent(C.MLN_LOG_EVENT_PARSE_TILE)
	LogEventRender      LogEvent = LogEvent(C.MLN_LOG_EVENT_RENDER)
	LogEventStyle       LogEvent = LogEvent(C.MLN_LOG_EVENT_STYLE)
	LogEventDatabase    LogEvent = LogEvent(C.MLN_LOG_EVENT_DATABASE)
	LogEventHTTPRequest LogEvent = LogEvent(C.MLN_LOG_EVENT_HTTP_REQUEST)
	LogEventSprite      LogEvent = LogEvent(C.MLN_LOG_EVENT_SPRITE)
	LogEventImage       LogEvent = LogEvent(C.MLN_LOG_EVENT_IMAGE)
	LogEventOpenGL      LogEvent = LogEvent(C.MLN_LOG_EVENT_OPENGL)
	LogEventJNI         LogEvent = LogEvent(C.MLN_LOG_EVENT_JNI)
	LogEventAndroid     LogEvent = LogEvent(C.MLN_LOG_EVENT_ANDROID)
	LogEventCrash       LogEvent = LogEvent(C.MLN_LOG_EVENT_CRASH)
	LogEventGlyph       LogEvent = LogEvent(C.MLN_LOG_EVENT_GLYPH)
	LogEventTiming      LogEvent = LogEvent(C.MLN_LOG_EVENT_TIMING)
)

type LogRecord

type LogRecord struct {
	Severity LogSeverity
	Event    LogEvent
	Code     int64
	Message  string
}

LogRecord is a copied native log record.

type LogSeverity

type LogSeverity uint32

LogSeverity is a native log severity.

const (
	LogSeverityInfo    LogSeverity = LogSeverity(C.MLN_LOG_SEVERITY_INFO)
	LogSeverityWarning LogSeverity = LogSeverity(C.MLN_LOG_SEVERITY_WARNING)
	LogSeverityError   LogSeverity = LogSeverity(C.MLN_LOG_SEVERITY_ERROR)
)

type LogSeverityMask

type LogSeverityMask uint32

LogSeverityMask selects severities that native logging may dispatch asynchronously.

const (
	LogSeverityMaskInfo    LogSeverityMask = LogSeverityMask(C.MLN_LOG_SEVERITY_MASK_INFO)
	LogSeverityMaskWarning LogSeverityMask = LogSeverityMask(C.MLN_LOG_SEVERITY_MASK_WARNING)
	LogSeverityMaskError   LogSeverityMask = LogSeverityMask(C.MLN_LOG_SEVERITY_MASK_ERROR)
	LogSeverityMaskDefault LogSeverityMask = LogSeverityMask(C.MLN_LOG_SEVERITY_MASK_DEFAULT)
	LogSeverityMaskAll     LogSeverityMask = LogSeverityMask(C.MLN_LOG_SEVERITY_MASK_ALL)
)

type MapDebugOptions

type MapDebugOptions uint32

MapDebugOptions is a mask of native map debug overlays.

const (
	MapDebugTileBorders MapDebugOptions = MapDebugOptions(C.MLN_MAP_DEBUG_TILE_BORDERS)
	MapDebugParseStatus MapDebugOptions = MapDebugOptions(C.MLN_MAP_DEBUG_PARSE_STATUS)
	MapDebugTimestamps  MapDebugOptions = MapDebugOptions(C.MLN_MAP_DEBUG_TIMESTAMPS)
	MapDebugCollision   MapDebugOptions = MapDebugOptions(C.MLN_MAP_DEBUG_COLLISION)
	MapDebugOverdraw    MapDebugOptions = MapDebugOptions(C.MLN_MAP_DEBUG_OVERDRAW)
	MapDebugStencilClip MapDebugOptions = MapDebugOptions(C.MLN_MAP_DEBUG_STENCIL_CLIP)
	MapDebugDepthBuffer MapDebugOptions = MapDebugOptions(C.MLN_MAP_DEBUG_DEPTH_BUFFER)
)
func (MapDebugOptions) Has
func (options MapDebugOptions) Has(requested MapDebugOptions) bool

Has reports whether all requested debug overlay bits are set.

type MapHandle

type MapHandle struct {
	// contains filtered or unexported fields
}

MapHandle owns map state for one RuntimeHandle.

func (*MapHandle) AddColorReliefLayer
func (m *MapHandle) AddColorReliefLayer(layerID string, sourceID string, beforeLayerID string) error

AddColorReliefLayer adds a color-relief layer for a raster DEM source. Passing an empty beforeLayerID appends the layer.

func (*MapHandle) AddCustomGeometrySource
func (m *MapHandle) AddCustomGeometrySource(sourceID string, options CustomGeometrySourceOptions) error

AddCustomGeometrySource adds a custom geometry source to the current style. Callback state remains valid until source removal, style replacement, or map close, each of which frees it on the map owner thread. A failed add frees it before returning.

func (*MapHandle) AddGeoJSONSourceData
func (m *MapHandle) AddGeoJSONSourceData(sourceID string, data *GeoJSONSourceDataHandle) error

AddGeoJSONSourceData adds a GeoJSON source with prepared inline data. The call borrows the handle and retains the prepared index, and the source adopts the options the data was prepared with, fixed for the lifetime of the source.

func (*MapHandle) AddGeoJSONSourceURL
func (m *MapHandle) AddGeoJSONSourceURL(sourceID string, url string, options *StyleGeoJSONSourceOptions) error

AddGeoJSONSourceURL adds a GeoJSON source that loads from a URL. Later SetGeoJSONSourceURL calls keep the options passed here, and later SetGeoJSONSourceData calls require data prepared with matching options.

func (*MapHandle) AddHillshadeLayer
func (m *MapHandle) AddHillshadeLayer(layerID string, sourceID string, beforeLayerID string) error

AddHillshadeLayer adds a hillshade layer for a raster DEM source. Passing an empty beforeLayerID appends the layer.

func (*MapHandle) AddImageSourceImage
func (m *MapHandle) AddImageSourceImage(sourceID string, coordinates []LatLng, image PremultipliedRGBA8Image) error

AddImageSourceImage adds an image source with inline image pixels.

func (*MapHandle) AddImageSourceURL
func (m *MapHandle) AddImageSourceURL(sourceID string, coordinates []LatLng, url string) error

AddImageSourceURL adds an image source that loads its image from a URL.

func (*MapHandle) AddLocationIndicatorLayer
func (m *MapHandle) AddLocationIndicatorLayer(layerID string, beforeLayerID string) error

AddLocationIndicatorLayer adds a source-free location indicator layer. Passing an empty beforeLayerID appends the layer.

func (*MapHandle) AddRasterDEMSourceTiles
func (m *MapHandle) AddRasterDEMSourceTiles(sourceID string, tiles []string, options *StyleTileSourceOptions) error

AddRasterDEMSourceTiles adds a raster DEM source with inline tile URLs.

func (*MapHandle) AddRasterDEMSourceURL
func (m *MapHandle) AddRasterDEMSourceURL(sourceID string, url string, options *StyleTileSourceOptions) error

AddRasterDEMSourceURL adds a raster DEM source with a TileJSON URL.

func (*MapHandle) AddRasterSourceTiles
func (m *MapHandle) AddRasterSourceTiles(sourceID string, tiles []string, options *StyleTileSourceOptions) error

AddRasterSourceTiles adds a raster source with inline tile URLs.

func (*MapHandle) AddRasterSourceURL
func (m *MapHandle) AddRasterSourceURL(sourceID string, url string, options *StyleTileSourceOptions) error

AddRasterSourceURL adds a raster source with a TileJSON URL.

func (*MapHandle) AddStyleLayerJSON
func (m *MapHandle) AddStyleLayerJSON(layerJSON []byte, beforeLayerID string) error

AddStyleLayerJSON adds one style layer from a style-spec layer JSON object. Passing an empty beforeLayerID appends the layer.

func (*MapHandle) AddStyleSourceJSON
func (m *MapHandle) AddStyleSourceJSON(sourceID string, sourceJSON []byte) error

AddStyleSourceJSON adds one style source from a style-spec source JSON object.

func (*MapHandle) AddVectorSourceTiles
func (m *MapHandle) AddVectorSourceTiles(sourceID string, tiles []string, options *StyleTileSourceOptions) error

AddVectorSourceTiles adds a vector source with inline tile URLs.

func (*MapHandle) AddVectorSourceURL
func (m *MapHandle) AddVectorSourceURL(sourceID string, url string, options *StyleTileSourceOptions) error

AddVectorSourceURL adds a vector source with a TileJSON URL.

func (*MapHandle) AttachMetalBorrowedTexture
func (m *MapHandle) AttachMetalBorrowedTexture(descriptor MetalBorrowedTextureDescriptor) (*RenderSessionHandle, error)

AttachMetalBorrowedTexture attaches a Metal caller-owned texture render target. The caller keeps the texture valid until detach or session close and synchronizes external use.

func (*MapHandle) AttachMetalOwnedTexture
func (m *MapHandle) AttachMetalOwnedTexture(descriptor MetalOwnedTextureDescriptor) (*RenderSessionHandle, error)

AttachMetalOwnedTexture attaches a Metal session-owned texture render target.

func (*MapHandle) AttachMetalSurface
func (m *MapHandle) AttachMetalSurface(descriptor MetalSurfaceDescriptor) (*RenderSessionHandle, error)

AttachMetalSurface attaches a Metal native surface render target to this map. The returned session is affine to the OS thread that attaches it, which need not be the map owner thread.

func (*MapHandle) AttachOpenGLBorrowedTexture
func (m *MapHandle) AttachOpenGLBorrowedTexture(descriptor OpenGLBorrowedTextureDescriptor) (*RenderSessionHandle, error)

AttachOpenGLBorrowedTexture attaches an OpenGL caller-owned texture render target.

func (*MapHandle) AttachOpenGLOwnedTexture
func (m *MapHandle) AttachOpenGLOwnedTexture(descriptor OpenGLOwnedTextureDescriptor) (*RenderSessionHandle, error)

AttachOpenGLOwnedTexture attaches an OpenGL session-owned texture render target.

func (*MapHandle) AttachOpenGLSurface
func (m *MapHandle) AttachOpenGLSurface(descriptor OpenGLSurfaceDescriptor) (*RenderSessionHandle, error)

AttachOpenGLSurface attaches an OpenGL native surface render target to this map. The returned session is affine to the OS thread that attaches it, which need not be the map owner thread, and borrowed OpenGL context handles must outlive detach or session close.

func (*MapHandle) AttachVulkanBorrowedTexture
func (m *MapHandle) AttachVulkanBorrowedTexture(descriptor VulkanBorrowedTextureDescriptor) (*RenderSessionHandle, error)

AttachVulkanBorrowedTexture attaches a Vulkan caller-owned texture render target. The caller owns image lifetime, queue-family ownership, image layout transitions, and external synchronization around each RenderUpdate.

func (*MapHandle) AttachVulkanOwnedTexture
func (m *MapHandle) AttachVulkanOwnedTexture(descriptor VulkanOwnedTextureDescriptor) (*RenderSessionHandle, error)

AttachVulkanOwnedTexture attaches a Vulkan session-owned texture render target.

func (*MapHandle) AttachVulkanSurface
func (m *MapHandle) AttachVulkanSurface(descriptor VulkanSurfaceDescriptor) (*RenderSessionHandle, error)

AttachVulkanSurface attaches a Vulkan native surface render target to this map. The returned session is affine to the OS thread that attaches it, which need not be the map owner thread, and borrowed Vulkan handles must outlive detach or session close.

func (*MapHandle) Bounds
func (m *MapHandle) Bounds() (BoundOptions, error)

Bounds returns map camera constraint options.

func (*MapHandle) Camera
func (m *MapHandle) Camera() (CameraOptions, error)

Camera returns the current camera snapshot.

func (*MapHandle) CameraForGeometry
func (m *MapHandle) CameraForGeometry(geometry []byte, fitOptions *CameraFitOptions) (CameraOptions, error)

CameraForGeometry computes a camera that fits a geometry. Passing nil fitOptions uses native default fitting options.

func (*MapHandle) CameraForLatLngBounds
func (m *MapHandle) CameraForLatLngBounds(bounds LatLngBounds, fitOptions *CameraFitOptions) (CameraOptions, error)

CameraForLatLngBounds computes a camera that fits geographic bounds. Passing nil fitOptions uses native default fitting options.

func (*MapHandle) CameraForLatLngs
func (m *MapHandle) CameraForLatLngs(coordinates []LatLng, fitOptions *CameraFitOptions) (CameraOptions, error)

CameraForLatLngs computes a camera that fits geographic coordinates. Passing nil fitOptions uses native default fitting options.

func (*MapHandle) CancelTransitions
func (m *MapHandle) CancelTransitions() error

CancelTransitions cancels active camera transitions.

func (*MapHandle) Close
func (m *MapHandle) Close() error

Close destroys this map. A successful close makes later calls no-ops. A failed close leaves the native handle live so callers can retry on the owner thread. Close discards this map's queued runtime events and its recorded loading failure without a flush and without a terminal event, and releases the callback state of every custom geometry source the map still holds.

func (*MapHandle) DebugOptions
func (m *MapHandle) DebugOptions() (MapDebugOptions, error)

DebugOptions returns the current MapLibre debug overlay mask bits.

func (*MapHandle) DumpDebugLogs
func (m *MapHandle) DumpDebugLogs() error

DumpDebugLogs dumps map debug logs through MapLibre Native logging.

func (*MapHandle) EaseTo
func (m *MapHandle) EaseTo(camera CameraOptions, animation *AnimationOptions) error

EaseTo applies a camera ease transition command. A nil animation, or one with no Duration, uses the native default duration of zero, so the camera reaches the target immediately; set Duration explicitly to animate.

func (*MapHandle) EventMask
func (m *MapHandle) EventMask() (RuntimeEventMask, error)

EventMask reports which map-originated event types this map queues. A map that has not been narrowed reports RuntimeEventMaskAll.

func (*MapHandle) FlyTo
func (m *MapHandle) FlyTo(camera CameraOptions, animation *AnimationOptions) error

FlyTo applies a camera fly transition command. A nil animation, or one with no Duration, flies at a default velocity of 1.2 ρ-screenfuls per second, so the duration scales with the distance travelled.

func (*MapHandle) FreeCameraOptions
func (m *MapHandle) FreeCameraOptions() (FreeCameraOptions, error)

FreeCameraOptions returns current free camera position and orientation.

func (*MapHandle) ID
func (m *MapHandle) ID() (MapID, error)

ID returns this map's event source identity, which matches RuntimeEventSource.MapID on runtime events this map raises.

func (*MapHandle) ImageSourceCoordinates
func (m *MapHandle) ImageSourceCoordinates(sourceID string) ([]LatLng, bool, error)

ImageSourceCoordinates returns copied image source coordinates.

func (*MapHandle) InvalidateCustomGeometrySourceRegion
func (m *MapHandle) InvalidateCustomGeometrySourceRegion(sourceID string, bounds LatLngBounds) error

InvalidateCustomGeometrySourceRegion invalidates custom geometry data inside one geographic region.

func (*MapHandle) InvalidateCustomGeometrySourceTile
func (m *MapHandle) InvalidateCustomGeometrySourceTile(sourceID string, tileID CanonicalTileID) error

InvalidateCustomGeometrySourceTile invalidates custom geometry data for one tile.

func (*MapHandle) IsFullyLoaded
func (m *MapHandle) IsFullyLoaded() (bool, error)

IsFullyLoaded reports whether MapLibre currently considers the map fully loaded.

func (*MapHandle) IsGestureInProgress
func (m *MapHandle) IsGestureInProgress() (bool, error)

IsGestureInProgress reports whether a host-driven gesture is currently in progress.

func (*MapHandle) JumpTo
func (m *MapHandle) JumpTo(camera CameraOptions) error

JumpTo applies a camera jump command.

func (*MapHandle) LatLngBoundsForCamera
func (m *MapHandle) LatLngBoundsForCamera(camera CameraOptions) (LatLngBounds, error)

LatLngBoundsForCamera computes geographic bounds for a camera from two viewport corners.

The box is the hull of the top-left and bottom-right screen corners for that camera in the current viewport. When bearing and pitch are zero, the box equals the visible area. Those corners are the northwest and southeast of the viewport. Longitudes stay in -180 to 180.

func (*MapHandle) LatLngBoundsForCameraUnwrapped
func (m *MapHandle) LatLngBoundsForCameraUnwrapped(camera CameraOptions) (LatLngBounds, error)

LatLngBoundsForCameraUnwrapped computes geographic bounds for a camera from the four viewport corners.

The axis-aligned hull of all four screen corners and the center encompasses the projected viewport. Longitudes unwrap onto the shortest path through the center. A viewport that crosses the antimeridian reports values outside -180 to 180.

func (*MapHandle) LatLngForPixel
func (m *MapHandle) LatLngForPixel(point ScreenPoint) (LatLng, error)

LatLngForPixel converts a logical screen point to a geographic coordinate for the current map.

func (*MapHandle) LatLngsForPixels
func (m *MapHandle) LatLngsForPixels(points []ScreenPoint) ([]LatLng, error)

LatLngsForPixels converts logical screen points to geographic coordinates for the current map.

func (*MapHandle) LayerFilter
func (m *MapHandle) LayerFilter(layerID string) ([]byte, error)

LayerFilter returns one copied style layer filter as a style-spec JSON value.

func (*MapHandle) LayerMaxZoom
func (m *MapHandle) LayerMaxZoom(layerID string) (float64, error)

LayerMaxZoom returns the highest zoom at which one layer draws. A layer with no upper bound reports math.Inf(1).

func (*MapHandle) LayerMinZoom
func (m *MapHandle) LayerMinZoom(layerID string) (float64, error)

LayerMinZoom returns the lowest zoom at which one layer draws. A layer with no lower bound reports math.Inf(-1).

func (*MapHandle) LayerProperty
func (m *MapHandle) LayerProperty(layerID string, propertyName string) ([]byte, error)

LayerProperty returns one copied style layer property as a style-spec JSON value.

func (*MapHandle) LayerSourceID
func (m *MapHandle) LayerSourceID(layerID string) (string, error)

LayerSourceID returns one layer's source ID, empty when the layer carries none.

func (*MapHandle) LayerSourceLayer
func (m *MapHandle) LayerSourceLayer(layerID string) (string, error)

LayerSourceLayer returns one layer's source-layer ID, empty when the layer carries none.

func (*MapHandle) LayerVisibility
func (m *MapHandle) LayerVisibility(layerID string) (StyleLayerVisibility, error)

LayerVisibility returns whether one layer draws.

func (*MapHandle) LoadedStyleJSON
func (m *MapHandle) LoadedStyleJSON() ([]byte, error)

LoadedStyleJSON returns the style document this map's style was last parsed from, byte for byte, rather than a serialization of the live style. Runtime mutations such as adding a layer do not change it, and a failed parse leaves the previously parsed document in place. The result is empty only when no document has been parsed.

func (*MapHandle) MoveBy
func (m *MapHandle) MoveBy(delta ScreenPoint) error

MoveBy applies a screen-space pan command.

func (*MapHandle) MoveByAnimated
func (m *MapHandle) MoveByAnimated(delta ScreenPoint, animation *AnimationOptions) error

MoveByAnimated applies an animated screen-space pan command. A nil animation, or one with no Duration, applies the change instantly; see EaseTo.

func (*MapHandle) MoveStyleLayer
func (m *MapHandle) MoveStyleLayer(layerID string, beforeLayerID string) error

MoveStyleLayer moves one style layer before another layer. Passing an empty beforeLayerID moves layerID to the top of the style order.

func (*MapHandle) NewProjection
func (m *MapHandle) NewProjection() (*MapProjectionHandle, error)

NewProjection creates a standalone projection helper from this map's current transform. Later map changes do not update the helper.

func (*MapHandle) PitchBy
func (m *MapHandle) PitchBy(pitch float64) error

PitchBy applies a pitch delta command.

func (*MapHandle) PitchByAnimated
func (m *MapHandle) PitchByAnimated(pitch float64, animation *AnimationOptions) error

PitchByAnimated applies an animated pitch delta command. A nil animation, or one with no Duration, applies the change instantly; see EaseTo.

func (*MapHandle) PixelForLatLng
func (m *MapHandle) PixelForLatLng(coordinate LatLng) (ScreenPoint, error)

PixelForLatLng converts a geographic coordinate to a logical screen point for the current map.

func (*MapHandle) PixelsForLatLngs
func (m *MapHandle) PixelsForLatLngs(coordinates []LatLng) ([]ScreenPoint, error)

PixelsForLatLngs converts geographic coordinates to logical screen points for the current map.

func (*MapHandle) ProjectionMode
func (m *MapHandle) ProjectionMode() (ProjectionModeOptions, error)

ProjectionMode returns current axonometric rendering options.

func (*MapHandle) RemoveStyleImage
func (m *MapHandle) RemoveStyleImage(imageID string) (bool, error)

RemoveStyleImage removes one runtime style image and reports whether it existed.

func (*MapHandle) RemoveStyleLayer
func (m *MapHandle) RemoveStyleLayer(layerID string) (bool, error)

RemoveStyleLayer removes one style layer by ID and reports whether it was present.

func (*MapHandle) RemoveStyleSource
func (m *MapHandle) RemoveStyleSource(sourceID string) (bool, error)

RemoveStyleSource removes one style source by ID and reports whether it was present.

func (*MapHandle) RenderingStatsViewEnabled
func (m *MapHandle) RenderingStatsViewEnabled() (bool, error)

RenderingStatsViewEnabled reports whether MapLibre's rendering stats overlay view is enabled.

func (*MapHandle) RequestRepaint
func (m *MapHandle) RequestRepaint() error

RequestRepaint requests a repaint for a continuous map.

func (*MapHandle) RequestStillImage
func (m *MapHandle) RequestStillImage() error

RequestStillImage requests one still image for a static or tile map.

func (*MapHandle) RotateBy
func (m *MapHandle) RotateBy(first ScreenPoint, second ScreenPoint) error

RotateBy applies a screen-space rotate command.

func (*MapHandle) RotateByAnimated
func (m *MapHandle) RotateByAnimated(first ScreenPoint, second ScreenPoint, animation *AnimationOptions) error

RotateByAnimated applies an animated screen-space rotate command. A nil animation, or one with no Duration, applies the change instantly; see EaseTo.

func (*MapHandle) ScaleBy
func (m *MapHandle) ScaleBy(scale float64, anchor *ScreenPoint) error

ScaleBy applies a screen-space zoom command. Passing nil anchor uses the native default zoom anchor.

func (*MapHandle) ScaleByAnimated
func (m *MapHandle) ScaleByAnimated(scale float64, anchor *ScreenPoint, animation *AnimationOptions) error

ScaleByAnimated applies an animated screen-space zoom command. Passing nil anchor or animation uses the native default for that option.

func (*MapHandle) SetBounds
func (m *MapHandle) SetBounds(options BoundOptions) error

SetBounds applies selected map camera constraint options.

func (*MapHandle) SetCustomGeometrySourceTileData
func (m *MapHandle) SetCustomGeometrySourceTileData(sourceID string, tileID CanonicalTileID, data []byte) error

SetCustomGeometrySourceTileData sets custom geometry data for one tile.

func (*MapHandle) SetDebugOptions
func (m *MapHandle) SetDebugOptions(options MapDebugOptions) error

SetDebugOptions applies MapLibre debug overlay mask bits to a map.

func (*MapHandle) SetEventMask
func (m *MapHandle) SetEventMask(mask RuntimeEventMask) error

SetEventMask selects which map-originated event types this map queues. It accepts RuntimeEventMaskAll, reads the bits in RuntimeEventMaskAllMapEvents, and returns ErrInvalidArgument for a bit outside RuntimeEventMaskAll.

Select every event type the caller reads. Render-update-available is the map's only invalidation report, the two still-image types are the only reports that a still-image request finished, and loading-failed and render-error carry native failure text. Narrowing gates later events and keeps queued ones, so a caller drains what it already caused.

func (*MapHandle) SetFreeCameraOptions
func (m *MapHandle) SetFreeCameraOptions(options FreeCameraOptions) error

SetFreeCameraOptions applies selected free camera position and orientation fields.

func (*MapHandle) SetGeoJSONSourceData
func (m *MapHandle) SetGeoJSONSourceData(sourceID string, data *GeoJSONSourceDataHandle) error

SetGeoJSONSourceData updates a GeoJSON source with prepared inline data. The call borrows the handle and retains the prepared index. The data must have been prepared with options equal to the options the source was added with, ClusterProperties excepted.

func (*MapHandle) SetGeoJSONSourceSynchronousTiling
func (m *MapHandle) SetGeoJSONSourceSynchronousTiling(sourceID string, enabled bool) error

SetGeoJSONSourceSynchronousTiling overrides a GeoJSON source's synchronous tiling at runtime. While enabled is true, the source slices requested tiles inline during the update pass, as if its options had set SynchronousTiling; false restores the option the source was added with.

func (*MapHandle) SetGeoJSONSourceURL
func (m *MapHandle) SetGeoJSONSourceURL(sourceID string, url string) error

SetGeoJSONSourceURL updates a GeoJSON source to load from a URL.

func (*MapHandle) SetGestureInProgress
func (m *MapHandle) SetGestureInProgress(inProgress bool) error

SetGestureInProgress marks whether a host-driven gesture is in progress. The flag stays set until the host clears it, so pair every true with a false.

func (*MapHandle) SetImageSourceCoordinates
func (m *MapHandle) SetImageSourceCoordinates(sourceID string, coordinates []LatLng) error

SetImageSourceCoordinates updates image source coordinates.

func (*MapHandle) SetImageSourceImage
func (m *MapHandle) SetImageSourceImage(sourceID string, image PremultipliedRGBA8Image) error

SetImageSourceImage updates an image source with inline image pixels.

func (*MapHandle) SetImageSourceURL
func (m *MapHandle) SetImageSourceURL(sourceID string, url string) error

SetImageSourceURL updates an image source to load its image from a URL.

func (*MapHandle) SetLayerFilter
func (m *MapHandle) SetLayerFilter(layerID string, filter []byte) error

SetLayerFilter sets or clears one style layer filter. Passing nil clears the filter.

func (*MapHandle) SetLayerMaxZoom
func (m *MapHandle) SetLayerMaxZoom(layerID string, maxZoom float64) error

SetLayerMaxZoom sets the highest zoom at which one layer draws. Pass math.Inf(1) for no upper bound.

func (*MapHandle) SetLayerMinZoom
func (m *MapHandle) SetLayerMinZoom(layerID string, minZoom float64) error

SetLayerMinZoom sets the lowest zoom at which one layer draws. Pass math.Inf(-1) for no lower bound.

func (*MapHandle) SetLayerProperty
func (m *MapHandle) SetLayerProperty(layerID string, propertyName string, value []byte) error

SetLayerProperty sets one style layer property.

func (*MapHandle) SetLayerSourceID
func (m *MapHandle) SetLayerSourceID(layerID string, sourceID string) error

SetLayerSourceID sets one layer's source ID. Layer types that take no source, such as background, are rejected. The named source need not exist yet.

func (*MapHandle) SetLayerSourceLayer
func (m *MapHandle) SetLayerSourceLayer(layerID string, sourceLayer string) error

SetLayerSourceLayer sets one layer's source-layer ID. Layer types that take no source, such as background, are rejected.

func (*MapHandle) SetLayerVisibility
func (m *MapHandle) SetLayerVisibility(layerID string, visibility StyleLayerVisibility) error

SetLayerVisibility sets whether one layer draws.

func (*MapHandle) SetLocationIndicatorAccuracyRadius
func (m *MapHandle) SetLocationIndicatorAccuracyRadius(layerID string, radius float64) error

SetLocationIndicatorAccuracyRadius sets a location indicator layer accuracy radius.

func (*MapHandle) SetLocationIndicatorBearing
func (m *MapHandle) SetLocationIndicatorBearing(layerID string, bearing float64) error

SetLocationIndicatorBearing sets a location indicator layer bearing in degrees.

func (*MapHandle) SetLocationIndicatorImageName
func (m *MapHandle) SetLocationIndicatorImageName(layerID string, imageKind LocationIndicatorImageKind, imageID string) error

SetLocationIndicatorImageName sets one location indicator image-name property.

func (*MapHandle) SetLocationIndicatorLocation
func (m *MapHandle) SetLocationIndicatorLocation(layerID string, coordinate LatLng, altitude float64) error

SetLocationIndicatorLocation sets a location indicator layer location.

func (*MapHandle) SetProjectionMode
func (m *MapHandle) SetProjectionMode(options ProjectionModeOptions) error

SetProjectionMode applies axonometric rendering option fields.

func (*MapHandle) SetRenderingStatsViewEnabled
func (m *MapHandle) SetRenderingStatsViewEnabled(enabled bool) error

SetRenderingStatsViewEnabled enables or disables MapLibre's rendering stats overlay view.

func (*MapHandle) SetStyleImage
func (m *MapHandle) SetStyleImage(imageID string, image PremultipliedRGBA8Image, options StyleImageOptions) error

SetStyleImage sets or replaces one runtime style image.

func (*MapHandle) SetStyleJSON
func (m *MapHandle) SetStyleJSON(json []byte) error

SetStyleJSON loads inline style JSON. Malformed JSON is reported twice: this call returns the parse error, and the same message arrives as a map-loading-failed runtime event. A well-formed style that MapLibre rejects semantically produces neither an error nor an event.

func (*MapHandle) SetStyleLightJSON
func (m *MapHandle) SetStyleLightJSON(lightJSON []byte) error

SetStyleLightJSON sets the style light from a style-spec light JSON object.

func (*MapHandle) SetStyleLightProperty
func (m *MapHandle) SetStyleLightProperty(propertyName string, value []byte) error

SetStyleLightProperty sets one style light property.

func (*MapHandle) SetStyleTransitionOptions
func (m *MapHandle) SetStyleTransitionOptions(options StyleTransitionOptions) error

SetStyleTransitionOptions replaces the style's global transition options rather than merging into them, so absent duration and delay clear the style-wide override. Loading a style replaces these options with the ones that style declares, so apply an override after the style loads.

func (*MapHandle) SetStyleURL
func (m *MapHandle) SetStyleURL(url string) error

SetStyleURL loads a style URL. Loading is asynchronous: a style that is missing, unreachable, or malformed still returns success here and reports through a map-loading-failed runtime event. A well-formed style that MapLibre rejects semantically produces neither an error nor an event.

func (*MapHandle) SetTileOptions
func (m *MapHandle) SetTileOptions(options TileOptions) error

SetTileOptions applies selected tile prefetch and LOD tuning controls.

func (*MapHandle) SetViewportOptions
func (m *MapHandle) SetViewportOptions(options ViewportOptions) error

SetViewportOptions applies selected live map viewport and render-transform controls.

func (*MapHandle) Size
func (m *MapHandle) Size() (width uint32, height uint32, scaleFactor float64, err error)

Size returns the map's logical viewport size in UI pixels and its scale factor. The scale factor is independent of any render target's.

func (*MapHandle) StyleImageExists
func (m *MapHandle) StyleImageExists(imageID string) (bool, error)

StyleImageExists reports whether one runtime style image exists.

func (*MapHandle) StyleImageInfo
func (m *MapHandle) StyleImageInfo(imageID string) (StyleImageInfo, bool, error)

StyleImageInfo returns copied metadata for one runtime style image.

func (*MapHandle) StyleImagePremultipliedRGBA8
func (m *MapHandle) StyleImagePremultipliedRGBA8(imageID string) ([]byte, bool, error)

StyleImagePremultipliedRGBA8 returns copied tightly packed premultiplied RGBA8 pixels.

func (*MapHandle) StyleImagePremultipliedRGBA8Into
func (m *MapHandle) StyleImagePremultipliedRGBA8Into(imageID string, buffer []byte) (uint64, bool, error)

StyleImagePremultipliedRGBA8Into copies tightly packed premultiplied RGBA8 pixels into buffer.

func (*MapHandle) StyleImageStretches
func (m *MapHandle) StyleImageStretches(imageID string) (stretchX, stretchY []ImageStretch, found bool, err error)

StyleImageStretches returns one runtime style image's stretchable intervals and whether the image exists.

func (*MapHandle) StyleLayerExists
func (m *MapHandle) StyleLayerExists(layerID string) (bool, error)

StyleLayerExists reports whether one style layer ID exists.

func (*MapHandle) StyleLayerIDs
func (m *MapHandle) StyleLayerIDs() ([]string, error)

StyleLayerIDs returns copied layer IDs in style order.

func (*MapHandle) StyleLayerJSON
func (m *MapHandle) StyleLayerJSON(layerID string) ([]byte, bool, error)

StyleLayerJSON returns one copied style layer as a style-spec JSON object and whether the layer exists.

func (*MapHandle) StyleLayerType
func (m *MapHandle) StyleLayerType(layerID string) (string, bool, error)

StyleLayerType returns a layer type string and whether the layer exists.

func (*MapHandle) StyleLightProperty
func (m *MapHandle) StyleLightProperty(propertyName string) ([]byte, error)

StyleLightProperty returns one copied style light property as a style-spec JSON value.

func (*MapHandle) StyleSourceAttribution
func (m *MapHandle) StyleSourceAttribution(sourceID string) (string, bool, error)

StyleSourceAttribution returns copied source attribution and whether the source exists.

func (*MapHandle) StyleSourceExists
func (m *MapHandle) StyleSourceExists(sourceID string) (bool, error)

StyleSourceExists reports whether one style source ID exists.

func (*MapHandle) StyleSourceIDs
func (m *MapHandle) StyleSourceIDs() ([]string, error)

StyleSourceIDs returns copied source IDs in style order.

func (*MapHandle) StyleSourceInfo
func (m *MapHandle) StyleSourceInfo(sourceID string) (StyleSourceInfo, bool, error)

StyleSourceInfo returns copied source metadata and whether the source exists.

func (*MapHandle) StyleSourceType
func (m *MapHandle) StyleSourceType(sourceID string) (StyleSourceType, bool, error)

StyleSourceType returns a source type and whether the source exists.

func (*MapHandle) StyleTransitionOptions
func (m *MapHandle) StyleTransitionOptions() (StyleTransitionOptions, error)

StyleTransitionOptions returns the style's copied global transition options.

func (*MapHandle) StyleURL
func (m *MapHandle) StyleURL() (string, error)

StyleURL returns the URL this map's style was last requested from. SetStyleURL records the URL when the request is made, before the response arrives or the document parses, and SetStyleJSON clears it, so this and LoadedStyleJSON can disagree while a load is in flight or after one fails.

The result is empty for a style loaded from inline JSON, a map that has loaded no style, and a URL load requested with an empty string alike.

func (*MapHandle) TileOptions
func (m *MapHandle) TileOptions() (TileOptions, error)

TileOptions returns tile prefetch and LOD tuning controls.

func (*MapHandle) ViewportOptions
func (m *MapHandle) ViewportOptions() (ViewportOptions, error)

ViewportOptions returns live map viewport and render-transform controls.

type MapID

type MapID uint64

MapID identifies a map within one RuntimeHandle.

type MapMode

type MapMode uint32

MapMode selects the native map rendering mode.

const (
	MapModeContinuous MapMode = MapMode(C.MLN_MAP_MODE_CONTINUOUS)
	MapModeStatic     MapMode = MapMode(C.MLN_MAP_MODE_STATIC)
	MapModeTile       MapMode = MapMode(C.MLN_MAP_MODE_TILE)
)

type MapOptions

type MapOptions struct {
	// Width is the initial logical width in UI pixels, replaced by the extent of
	// the first attached render session.
	Width uint32
	// Height is the initial logical height in UI pixels, replaced by the extent
	// of the first attached render session.
	Height uint32
	// ScaleFactor is the UI-to-device pixel scale, fixed for the lifetime of the
	// map. It selects sprites, glyphs, and raster tiles. A render session whose
	// own scale factor differs logs a warning and renders imagery chosen for
	// this density.
	ScaleFactor float64
	Mode        MapMode
	// FastPFOREnabled decodes MapLibre Tile (MLT) tiles whose integer streams
	// use FastPFOR encodings, fixed for the lifetime of the map. A map created
	// with this false logs a tile parse warning for those tiles.
	FastPFOREnabled bool
	// EventMask selects the map-originated event types this map queues.
	// NewMapOptions sets it to the native default, which selects every type.
	// The mask applies during construction. See MapHandle.SetEventMask.
	EventMask RuntimeEventMask
}

MapOptions configures map creation.

func NewMapOptions
func NewMapOptions(width, height uint32, scaleFactor float64) MapOptions

NewMapOptions returns map creation options for a viewport size and scale. The returned options select every map-originated event type.

func (MapOptions) Equal
func (options MapOptions) Equal(other MapOptions) bool

Equal reports whether two descriptors hold the same field values.

type MapProjectionHandle

type MapProjectionHandle struct {
	// contains filtered or unexported fields
}

MapProjectionHandle owns a standalone projection snapshot.

func (*MapProjectionHandle) Camera
func (projection *MapProjectionHandle) Camera() (CameraOptions, error)

Camera returns this projection helper's camera snapshot.

func (*MapProjectionHandle) Close
func (projection *MapProjectionHandle) Close() error

Close destroys this projection helper. A successful close makes later calls no-ops. A failed close leaves the native handle live so callers can retry on the owner thread.

func (*MapProjectionHandle) LatLngForPixel
func (projection *MapProjectionHandle) LatLngForPixel(point ScreenPoint) (LatLng, error)

LatLngForPixel converts a logical screen point to a geographic coordinate.

func (*MapProjectionHandle) PixelForLatLng
func (projection *MapProjectionHandle) PixelForLatLng(coordinate LatLng) (ScreenPoint, error)

PixelForLatLng converts a geographic coordinate to a logical screen point.

func (*MapProjectionHandle) SetCamera
func (projection *MapProjectionHandle) SetCamera(camera CameraOptions) error

SetCamera applies selected camera fields to this projection helper.

func (*MapProjectionHandle) SetVisibleCoordinates
func (projection *MapProjectionHandle) SetVisibleCoordinates(coordinates []LatLng, padding EdgeInsets) error

SetVisibleCoordinates updates this projection helper's camera to fit coordinates inside padding.

func (*MapProjectionHandle) SetVisibleGeometry
func (projection *MapProjectionHandle) SetVisibleGeometry(geometry []byte, padding EdgeInsets) error

SetVisibleGeometry updates this projection helper's camera to fit geometry inside padding.

type MetalBorrowedTextureDescriptor

type MetalBorrowedTextureDescriptor struct {
	Extent RenderTargetExtent
	// PhysicalWidth and PhysicalHeight are the texture's size in device pixels,
	// stated rather than derived from Extent because its owner sizes it.
	PhysicalWidth  uint32
	PhysicalHeight uint32
	Texture        NativePointer
}

MetalBorrowedTextureDescriptor describes a Metal caller-owned texture render target. The caller keeps Texture valid until detach or session close and synchronizes all use outside this session.

type MetalContextDescriptor

type MetalContextDescriptor struct {
	Device NativePointer
}

MetalContextDescriptor contains Metal backend context handles.

type MetalOwnedTextureDescriptor

type MetalOwnedTextureDescriptor struct {
	Extent  RenderTargetExtent
	Context MetalContextDescriptor
}

MetalOwnedTextureDescriptor describes a Metal session-owned texture render target.

type MetalOwnedTextureFrame

type MetalOwnedTextureFrame struct {
	// contains filtered or unexported fields
}

MetalOwnedTextureFrame is an acquired session-owned Metal texture frame. Backend handles are borrowed and remain valid only while the frame is active. Close the frame on the render session owner thread before resizing, rendering, reading back, detaching, closing the session, or acquiring another frame.

func (*MetalOwnedTextureFrame) Close
func (frame *MetalOwnedTextureFrame) Close() error

Close releases this acquired Metal texture frame on the session owner thread. A second Close is a no-op after a successful release; failed releases remain retryable.

func (*MetalOwnedTextureFrame) Device
func (frame *MetalOwnedTextureFrame) Device() (NativePointer, error)

Device returns the borrowed Metal device while the frame remains live.

func (*MetalOwnedTextureFrame) Texture
func (frame *MetalOwnedTextureFrame) Texture() (NativePointer, error)

Texture returns the borrowed Metal texture while the frame remains live.

func (*MetalOwnedTextureFrame) WithInfo
func (frame *MetalOwnedTextureFrame) WithInfo(fn func(MetalOwnedTextureFrameInfo) error) error

WithInfo passes copied Metal frame metadata after verifying the frame is live.

type MetalOwnedTextureFrameInfo

type MetalOwnedTextureFrameInfo struct {
	Generation  uint64
	Width       uint32
	Height      uint32
	ScaleFactor float64
	PixelFormat uint64
}

MetalOwnedTextureFrameInfo contains copied metadata for an acquired session-owned texture frame.

type MetalSurfaceDescriptor

type MetalSurfaceDescriptor struct {
	Extent  RenderTargetExtent
	Context MetalContextDescriptor
	Layer   NativePointer
}

MetalSurfaceDescriptor describes a Metal-backed surface render target. The session retains the layer and optional device while attached.

type NativePointer

type NativePointer uintptr

NativePointer is a borrowed opaque backend-native address. It grants no memory access and transfers no ownership.

type NetworkStatus

type NetworkStatus uint32

NetworkStatus is MapLibre Native's process-global network reachability mode.

const (
	NetworkStatusOnline  NetworkStatus = NetworkStatus(C.MLN_NETWORK_STATUS_ONLINE)
	NetworkStatusOffline NetworkStatus = NetworkStatus(C.MLN_NETWORK_STATUS_OFFLINE)
)
func CurrentNetworkStatus
func CurrentNetworkStatus() (NetworkStatus, error)

CurrentNetworkStatus reads MapLibre Native's process-global network status.

func (NetworkStatus) String
func (status NetworkStatus) String() string

String returns a diagnostic name for the status.

type NorthOrientation

type NorthOrientation uint32

NorthOrientation controls which screen edge points north.

const (
	NorthOrientationUp    NorthOrientation = NorthOrientation(C.MLN_NORTH_ORIENTATION_UP)
	NorthOrientationRight NorthOrientation = NorthOrientation(C.MLN_NORTH_ORIENTATION_RIGHT)
	NorthOrientationDown  NorthOrientation = NorthOrientation(C.MLN_NORTH_ORIENTATION_DOWN)
	NorthOrientationLeft  NorthOrientation = NorthOrientation(C.MLN_NORTH_ORIENTATION_LEFT)
)

type OfflineGeometryRegionDefinition

type OfflineGeometryRegionDefinition struct {
	StyleURL          string
	Geometry          []byte
	MinZoom           float64
	MaxZoom           float64
	PixelRatio        float32
	IncludeIdeographs bool
}

OfflineGeometryRegionDefinition describes a geometry offline region.

type OfflineOperationHandle

type OfflineOperationHandle[T any] struct {
	// contains filtered or unexported fields
}

OfflineOperationHandle owns a runtime-scoped offline operation token.

func (*OfflineOperationHandle[T]) Discard
func (operation *OfflineOperationHandle[T]) Discard() error

Discard drops runtime-owned state for this operation. The operation remains retryable when native discard fails.

func (*OfflineOperationHandle[T]) ID
func (operation *OfflineOperationHandle[T]) ID() uint64

ID returns the native offline operation ID.

func (*OfflineOperationHandle[T]) Kind
func (operation *OfflineOperationHandle[T]) Kind() OfflineOperationKind

Kind returns the native offline operation kind.

func (*OfflineOperationHandle[T]) ResultKind
func (operation *OfflineOperationHandle[T]) ResultKind() OfflineOperationResultKind

ResultKind returns the expected native result shape.

func (*OfflineOperationHandle[T]) Take
func (operation *OfflineOperationHandle[T]) Take() (T, error)

Take consumes a completed offline operation result and copies it into Go values. If native reports that the result is not ready, the handle remains live so callers can retry later or discard it.

type OfflineOperationKind

type OfflineOperationKind uint32

OfflineOperationKind identifies a native offline operation kind.

const (
	OfflineOperationAmbientCache               OfflineOperationKind = OfflineOperationKind(C.MLN_OFFLINE_OPERATION_AMBIENT_CACHE)
	OfflineOperationRegionCreate               OfflineOperationKind = OfflineOperationKind(C.MLN_OFFLINE_OPERATION_REGION_CREATE)
	OfflineOperationRegionGet                  OfflineOperationKind = OfflineOperationKind(C.MLN_OFFLINE_OPERATION_REGION_GET)
	OfflineOperationRegionsList                OfflineOperationKind = OfflineOperationKind(C.MLN_OFFLINE_OPERATION_REGIONS_LIST)
	OfflineOperationRegionsMergeDatabase       OfflineOperationKind = OfflineOperationKind(C.MLN_OFFLINE_OPERATION_REGIONS_MERGE_DATABASE)
	OfflineOperationRegionUpdateMetadata       OfflineOperationKind = OfflineOperationKind(C.MLN_OFFLINE_OPERATION_REGION_UPDATE_METADATA)
	OfflineOperationRegionGetStatus            OfflineOperationKind = OfflineOperationKind(C.MLN_OFFLINE_OPERATION_REGION_GET_STATUS)
	OfflineOperationRegionSetObserved          OfflineOperationKind = OfflineOperationKind(C.MLN_OFFLINE_OPERATION_REGION_SET_OBSERVED)
	OfflineOperationRegionSetDownloadState     OfflineOperationKind = OfflineOperationKind(C.MLN_OFFLINE_OPERATION_REGION_SET_DOWNLOAD_STATE)
	OfflineOperationRegionInvalidate           OfflineOperationKind = OfflineOperationKind(C.MLN_OFFLINE_OPERATION_REGION_INVALIDATE)
	OfflineOperationRegionDelete               OfflineOperationKind = OfflineOperationKind(C.MLN_OFFLINE_OPERATION_REGION_DELETE)
	OfflineOperationSetMaximumAmbientCacheSize OfflineOperationKind = OfflineOperationKind(C.MLN_OFFLINE_OPERATION_SET_MAXIMUM_AMBIENT_CACHE_SIZE)
)

type OfflineOperationResultKind

type OfflineOperationResultKind uint32

OfflineOperationResultKind identifies the expected result shape for an offline operation.

const (
	OfflineOperationResultNone           OfflineOperationResultKind = OfflineOperationResultKind(C.MLN_OFFLINE_OPERATION_RESULT_NONE)
	OfflineOperationResultRegion         OfflineOperationResultKind = OfflineOperationResultKind(C.MLN_OFFLINE_OPERATION_RESULT_REGION)
	OfflineOperationResultOptionalRegion OfflineOperationResultKind = OfflineOperationResultKind(C.MLN_OFFLINE_OPERATION_RESULT_OPTIONAL_REGION)
	OfflineOperationResultRegionList     OfflineOperationResultKind = OfflineOperationResultKind(C.MLN_OFFLINE_OPERATION_RESULT_REGION_LIST)
	OfflineOperationResultRegionStatus   OfflineOperationResultKind = OfflineOperationResultKind(C.MLN_OFFLINE_OPERATION_RESULT_REGION_STATUS)
)

type OfflineRegionDefinition

type OfflineRegionDefinition interface {
	// contains filtered or unexported methods
}

OfflineRegionDefinition describes an offline region to create.

type OfflineRegionDownloadState

type OfflineRegionDownloadState uint32

OfflineRegionDownloadState controls native offline region downloading.

const (
	OfflineRegionDownloadInactive OfflineRegionDownloadState = OfflineRegionDownloadState(C.MLN_OFFLINE_REGION_DOWNLOAD_INACTIVE)
	OfflineRegionDownloadActive   OfflineRegionDownloadState = OfflineRegionDownloadState(C.MLN_OFFLINE_REGION_DOWNLOAD_ACTIVE)
)

type OfflineRegionID

type OfflineRegionID int64

OfflineRegionID identifies a native offline region.

type OfflineRegionInfo

type OfflineRegionInfo struct {
	ID                OfflineRegionID
	Definition        OfflineRegionDefinition
	RawDefinitionType uint32
	Metadata          []byte
}

OfflineRegionInfo is a copied offline region snapshot.

type OfflineRegionStatus

type OfflineRegionStatus struct {
	DownloadState                  OfflineRegionDownloadState
	RawDownloadState               uint32
	CompletedResourceCount         uint64
	CompletedResourceSize          uint64
	CompletedTileCount             uint64
	RequiredTileCount              uint64
	CompletedTileSize              uint64
	RequiredResourceCount          uint64
	RequiredResourceCountIsPrecise bool
	Complete                       bool
}

OfflineRegionStatus is a copied offline region status snapshot.

type OfflineTilePyramidRegionDefinition

type OfflineTilePyramidRegionDefinition struct {
	StyleURL          string
	Bounds            LatLngBounds
	MinZoom           float64
	MaxZoom           float64
	PixelRatio        float32
	IncludeIdeographs bool
}

OfflineTilePyramidRegionDefinition describes a tile-pyramid offline region.

type OpenGLBorrowedTextureDescriptor

type OpenGLBorrowedTextureDescriptor struct {
	Extent RenderTargetExtent
	// PhysicalWidth and PhysicalHeight are the texture's size in device pixels,
	// stated rather than derived from Extent because its owner sizes it.
	PhysicalWidth  uint32
	PhysicalHeight uint32
	Context        OpenGLContextDescriptor
	Texture        uint32
	Target         uint32
}

OpenGLBorrowedTextureDescriptor describes an OpenGL caller-owned texture render target.

type OpenGLClientAPI

type OpenGLClientAPI uint32

OpenGLClientAPI names the OpenGL client API a dedicated EGL session creates its context for.

const (
	// OpenGLClientAPIUnspecified names no client API.
	OpenGLClientAPIUnspecified OpenGLClientAPI = OpenGLClientAPI(C.MLN_OPENGL_CLIENT_API_UNSPECIFIED)
	// OpenGLClientAPIGL is desktop OpenGL, as EGL_OPENGL_API names it.
	OpenGLClientAPIGL OpenGLClientAPI = OpenGLClientAPI(C.MLN_OPENGL_CLIENT_API_GL)
	// OpenGLClientAPIGLES is OpenGL ES, as EGL_OPENGL_ES_API names it.
	OpenGLClientAPIGLES OpenGLClientAPI = OpenGLClientAPI(C.MLN_OPENGL_CLIENT_API_GLES)
)

type OpenGLContextDescriptor

type OpenGLContextDescriptor struct {
	WGL *WGLContextDescriptor
	EGL *EGLContextDescriptor
	// Ownership is whether the session shares its thread with host graphics
	// work. The zero value is OpenGLContextOwnershipShared. WGL and EGL
	// surface sessions support both. A WebGL session renders through the
	// host's own context and a texture session hands its texture to the host,
	// so both are shared only.
	Ownership OpenGLContextOwnership
}

OpenGLContextDescriptor contains one OpenGL platform context provider.

type OpenGLContextOwnership

type OpenGLContextOwnership uint32

OpenGLContextOwnership names how a session's OpenGL context relates to the thread that attached it.

const (
	// OpenGLContextOwnershipShared leaves the thread as the session found it:
	// every render makes the session context current and restores whatever was
	// current before. The session context joins the host share group named by
	// the descriptor, so a host may hand the session a texture and sample it
	// from its own context.
	OpenGLContextOwnershipShared OpenGLContextOwnership = OpenGLContextOwnership(C.MLN_OPENGL_CONTEXT_OWNERSHIP_SHARED)
	// OpenGLContextOwnershipDedicated gives the session its thread. It makes
	// its context current once and keeps it current between renders, and it
	// joins no share group. Use this when a thread exists to drive one render
	// session and runs no other graphics work.
	OpenGLContextOwnershipDedicated OpenGLContextOwnership = OpenGLContextOwnership(C.MLN_OPENGL_CONTEXT_OWNERSHIP_DEDICATED)
)

type OpenGLContextProviderMask

type OpenGLContextProviderMask uint32

OpenGLContextProviderMask preserves the OpenGL context provider bits reported by the native library. Unknown future bits remain in the mask.

const (
	OpenGLContextProviderWGL   OpenGLContextProviderMask = OpenGLContextProviderMask(C.MLN_OPENGL_CONTEXT_PROVIDER_FLAG_WGL)
	OpenGLContextProviderEGL   OpenGLContextProviderMask = OpenGLContextProviderMask(C.MLN_OPENGL_CONTEXT_PROVIDER_FLAG_EGL)
	OpenGLContextProviderWebGL OpenGLContextProviderMask = OpenGLContextProviderMask(C.MLN_OPENGL_CONTEXT_PROVIDER_FLAG_WEBGL)
)
func SupportedOpenGLContextProviders
func SupportedOpenGLContextProviders() OpenGLContextProviderMask

SupportedOpenGLContextProviders returns the OpenGL context providers compiled into the linked native library.

func (OpenGLContextProviderMask) Has
func (mask OpenGLContextProviderMask) Has(provider OpenGLContextProviderMask) bool

Has reports whether all provider bits in provider are present.

type OpenGLOwnedTextureDescriptor

type OpenGLOwnedTextureDescriptor struct {
	Extent  RenderTargetExtent
	Context OpenGLContextDescriptor
}

OpenGLOwnedTextureDescriptor describes an OpenGL session-owned texture render target.

type OpenGLOwnedTextureFrame

type OpenGLOwnedTextureFrame struct {
	// contains filtered or unexported fields
}

OpenGLOwnedTextureFrame is an acquired session-owned OpenGL texture frame. Backend object names are borrowed and remain valid only while the frame is active. Close the frame on the render session owner thread before resizing, rendering, reading back, detaching, closing the session, or acquiring another frame.

func (*OpenGLOwnedTextureFrame) Close
func (frame *OpenGLOwnedTextureFrame) Close() error

Close releases this acquired OpenGL texture frame on the session owner thread. A second Close is a no-op after a successful release; failed releases remain retryable.

func (*OpenGLOwnedTextureFrame) Target
func (frame *OpenGLOwnedTextureFrame) Target() (uint32, error)

Target returns the borrowed OpenGL texture target while the frame remains live.

func (*OpenGLOwnedTextureFrame) Texture
func (frame *OpenGLOwnedTextureFrame) Texture() (uint32, error)

Texture returns the borrowed OpenGL texture object name while the frame remains live.

func (*OpenGLOwnedTextureFrame) WithInfo
func (frame *OpenGLOwnedTextureFrame) WithInfo(fn func(OpenGLOwnedTextureFrameInfo) error) error

WithInfo passes copied OpenGL frame metadata after verifying the frame is live.

type OpenGLOwnedTextureFrameInfo

type OpenGLOwnedTextureFrameInfo struct {
	Generation     uint64
	Width          uint32
	Height         uint32
	ScaleFactor    float64
	InternalFormat uint32
	Format         uint32
	Type           uint32
}

OpenGLOwnedTextureFrameInfo contains copied metadata for an acquired session-owned texture frame.

type OpenGLSurfaceDescriptor

type OpenGLSurfaceDescriptor struct {
	Extent  RenderTargetExtent
	Context OpenGLContextDescriptor
	Surface NativePointer
}

OpenGLSurfaceDescriptor describes an OpenGL-backed surface render target.

type PremultipliedRGBA8Image

type PremultipliedRGBA8Image struct {
	Width      uint32
	Height     uint32
	Stride     uint32
	Pixels     []byte
	ByteLength uint64
}

PremultipliedRGBA8Image contains caller-owned premultiplied RGBA8 pixels.

type ProjectedMeters

type ProjectedMeters struct {
	Northing float64
	Easting  float64
}

ProjectedMeters is a spherical Mercator coordinate in meters.

func ProjectedMetersForLatLng
func ProjectedMetersForLatLng(coordinate LatLng) (ProjectedMeters, error)

ProjectedMetersForLatLng converts a geographic coordinate to Spherical Mercator projected meters.

type ProjectionModeOptions

type ProjectionModeOptions struct {
	Axonometric *bool
	XSkew       *float64
	YSkew       *float64
}

ProjectionModeOptions configures axonometric render transform fields.

func (ProjectionModeOptions) Equal
func (options ProjectionModeOptions) Equal(other ProjectionModeOptions) bool

Equal reports whether two descriptors hold the same field values.

func (ProjectionModeOptions) WithAxonometric
func (options ProjectionModeOptions) WithAxonometric(value bool) ProjectionModeOptions

WithAxonometric returns a copy that sets the axonometric field.

func (ProjectionModeOptions) WithSkew
func (options ProjectionModeOptions) WithSkew(x, y float64) ProjectionModeOptions

WithSkew returns a copy that sets x and y skew fields.

type Quaternion

type Quaternion struct {
	X float64
	Y float64
	Z float64
	W float64
}

Quaternion stores x, y, z, w components.

type QueriedFeature

type QueriedFeature struct {
	Feature       []byte
	SourceID      *string
	SourceLayerID *string
	State         []byte
}

QueriedFeature is one copied feature query hit.

Feature is a UTF-8 GeoJSON Feature. SourceID and SourceLayerID are nil when absent. State is nil when absent and otherwise a UTF-8 JSON object.

func (QueriedFeature) Equal
func (feature QueriedFeature) Equal(other QueriedFeature) bool

Equal reports whether two copied hits hold the same field values. Absent optional fields stay distinct from present empty values.

type RenderBackendMask

type RenderBackendMask uint32

RenderBackendMask preserves the render backend bits reported by the native library. Unknown future bits remain in the mask.

const (
	RenderBackendMetal  RenderBackendMask = RenderBackendMask(C.MLN_RENDER_BACKEND_FLAG_METAL)
	RenderBackendVulkan RenderBackendMask = RenderBackendMask(C.MLN_RENDER_BACKEND_FLAG_VULKAN)
	RenderBackendOpenGL RenderBackendMask = RenderBackendMask(C.MLN_RENDER_BACKEND_FLAG_OPENGL)
	RenderBackendWebGPU RenderBackendMask = RenderBackendMask(C.MLN_RENDER_BACKEND_FLAG_WEBGPU)
)
func SupportedRenderBackends
func SupportedRenderBackends() RenderBackendMask

SupportedRenderBackends returns the render backends compiled into the linked native library.

func (RenderBackendMask) Has
func (mask RenderBackendMask) Has(backend RenderBackendMask) bool

Has reports whether all backend bits in backend are present.

type RenderMode

type RenderMode uint32

RenderMode identifies a render observer mode.

const (
	RenderModePartial RenderMode = RenderMode(C.MLN_RENDER_MODE_PARTIAL)
	RenderModeFull    RenderMode = RenderMode(C.MLN_RENDER_MODE_FULL)
)

type RenderResult

type RenderResult uint32

RenderResult is the outcome of a successful render-update call. This is an open domain: a value may have no named constant here, so a switch over it needs a default case. Unknown values keep their raw value.

const (
	// RenderResultRendered means the call rendered a frame into the render
	// target.
	RenderResultRendered RenderResult = RenderResult(C.MLN_RENDER_RESULT_RENDERED)
	// RenderResultNoUpdate means the call produced no frame. Wait for a
	// render-update-available event.
	RenderResultNoUpdate RenderResult = RenderResult(C.MLN_RENDER_RESULT_NO_UPDATE)
	// RenderResultSizePending means the map has not applied the session's
	// current size yet. Wait for the next render-update-available event.
	RenderResultSizePending RenderResult = RenderResult(C.MLN_RENDER_RESULT_SIZE_PENDING)
	// RenderResultTargetNotReady means the render target had no frame to draw
	// into. Wait for a host event that changes the render target, or back off
	// and retry.
	RenderResultTargetNotReady RenderResult = RenderResult(C.MLN_RENDER_RESULT_TARGET_NOT_READY)
)

type RenderSessionHandle

type RenderSessionHandle struct {
	// contains filtered or unexported fields
}

RenderSessionHandle owns a map render session.

func (*RenderSessionHandle) AcquireMetalTextureFrame
func (session *RenderSessionHandle) AcquireMetalTextureFrame() (*MetalOwnedTextureFrame, error)

AcquireMetalTextureFrame acquires the latest Metal session-owned texture frame. While the frame is live, resize, render update, detach, readback, session close, and another frame acquire are invalid.

func (*RenderSessionHandle) AcquireOpenGLTextureFrame
func (session *RenderSessionHandle) AcquireOpenGLTextureFrame() (*OpenGLOwnedTextureFrame, error)

AcquireOpenGLTextureFrame acquires the latest OpenGL session-owned texture frame. While the frame is live, resize, render update, detach, readback, session close, and another frame acquire are invalid.

func (*RenderSessionHandle) AcquireVulkanTextureFrame
func (session *RenderSessionHandle) AcquireVulkanTextureFrame() (*VulkanOwnedTextureFrame, error)

AcquireVulkanTextureFrame acquires the latest Vulkan session-owned texture frame. While the frame is live, resize, render update, detach, readback, session close, and another frame acquire are invalid.

func (*RenderSessionHandle) ClearData
func (session *RenderSessionHandle) ClearData() error

ClearData clears render-session data.

func (*RenderSessionHandle) Close
func (session *RenderSessionHandle) Close() error

Close destroys this render session. A successful close makes later calls no-ops. A failed close leaves the native handle live so callers can retry on the owner thread.

func (*RenderSessionHandle) Detach
func (session *RenderSessionHandle) Detach() error

Detach detaches the render target from the session. The session stays live and still needs Close, but it no longer holds its map: the map can be closed while this session is open, and every session operation that needs an attached target reports a native error. A detached session stays detached.

func (*RenderSessionHandle) DumpDebugLogs
func (session *RenderSessionHandle) DumpDebugLogs() error

DumpDebugLogs dumps render-session debug logs.

func (*RenderSessionHandle) FeatureState
func (session *RenderSessionHandle) FeatureState(selector FeatureStateSelector) ([]byte, error)

FeatureState returns copied per-feature state from a render source.

func (*RenderSessionHandle) QueryFeatureExtensions
func (session *RenderSessionHandle) QueryFeatureExtensions(sourceID string, feature []byte, extension string, extensionField string, arguments []byte) ([]byte, error)

QueryFeatureExtensions queries a feature extension from the latest render session state.

feature contains one UTF-8 GeoJSON Feature. arguments, when present, contains a UTF-8 JSON object. The result contains either JSON or GeoJSON bytes.

func (*RenderSessionHandle) QueryRenderedFeatures
func (session *RenderSessionHandle) QueryRenderedFeatures(geometry RenderedQueryGeometry, options *RenderedFeatureQueryOptions) ([]QueriedFeature, error)

QueryRenderedFeatures queries rendered features from the latest render session state and returns copied hits.

func (*RenderSessionHandle) QuerySourceFeatures
func (session *RenderSessionHandle) QuerySourceFeatures(sourceID string, options *SourceFeatureQueryOptions) ([]QueriedFeature, error)

QuerySourceFeatures queries source features from the latest render session state and returns copied hits.

func (*RenderSessionHandle) ReadPremultipliedRGBA8
func (session *RenderSessionHandle) ReadPremultipliedRGBA8() ([]byte, TextureImageInfo, error)

ReadPremultipliedRGBA8 reads the latest session-owned texture frame into a new byte slice.

func (*RenderSessionHandle) ReadPremultipliedRGBA8Into
func (session *RenderSessionHandle) ReadPremultipliedRGBA8Into(buffer []byte) (TextureImageInfo, error)

ReadPremultipliedRGBA8Into reads the latest session-owned texture frame into caller-owned storage.

func (*RenderSessionHandle) ReduceMemoryUse
func (session *RenderSessionHandle) ReduceMemoryUse() error

ReduceMemoryUse asks the render session to release cached render resources.

func (*RenderSessionHandle) RemoveFeatureState
func (session *RenderSessionHandle) RemoveFeatureState(selector FeatureStateSelector) error

RemoveFeatureState removes per-feature state from a render source.

func (*RenderSessionHandle) RenderUpdate
func (session *RenderSessionHandle) RenderUpdate() (RenderUpdate, error)

RenderUpdate renders the latest available map render update into the attached render target.

The map retains its latest update, so repeated calls re-render it and report RenderResultRendered again. Every other result names the wake to wait for: RenderResultNoUpdate and RenderResultSizePending resolve on a RuntimeEventMapRenderUpdateAvailable event, and RenderResultTargetNotReady resolves when the host changes the render target.

func (*RenderSessionHandle) Resize
func (session *RenderSessionHandle) Resize(extent RenderTargetExtent) error

Resize changes the render session target extent.

Surface and owned-texture sessions resize in place. Borrowed texture targets are sized by their owner and report an unsupported-feature error; hand over a texture at the new size with SetMetalBorrowedTextureTarget, SetVulkanBorrowedTextureTarget, or SetOpenGLBorrowedTextureTarget instead.

The session keeps its renderer across a resize, so renderer-held state such as feature state carries over. A scale factor change starts a new renderer with that state empty, because a renderer compiles its shaders for one pixel ratio. Map state such as camera, style, and sources survives either way.

func (*RenderSessionHandle) SetFeatureState
func (session *RenderSessionHandle) SetFeatureState(selector FeatureStateSelector, state []byte) error

SetFeatureState sets per-feature state on a render source. The state value is copied before the call returns.

func (*RenderSessionHandle) SetMetalBorrowedTextureTarget
func (session *RenderSessionHandle) SetMetalBorrowedTextureTarget(descriptor MetalBorrowedTextureDescriptor) error

SetMetalBorrowedTextureTarget renders this attached texture session into a new caller-owned Metal texture.

Handing over a replacement keeps this session's renderer, unlike Resize, which reports an unsupported-feature error for a caller-owned texture. A scale factor change still starts a new renderer for the new pixel ratio.

The replacement must belong to the device this session attached with, which reports an invalid-argument error otherwise, and carry the pixel format it attached with, which reports an unsupported-feature error otherwise; both leave this session rendering into the texture it has. The caller keeps the replacement valid until the next replacement, detach, or session close. This session never retains or releases the outgoing texture.

func (*RenderSessionHandle) SetMetalSurfaceTarget
func (session *RenderSessionHandle) SetMetalSurfaceTarget(descriptor MetalSurfaceDescriptor) error

SetMetalSurfaceTarget presents this attached surface session through a new Metal surface. Replacing the surface in place keeps this session's renderer, and with it the tile pyramid, glyph and image atlases, symbol placement, and feature state. The extent applies as Resize applies one, scale factor change included.

A descriptor whose Context.Device is neither zero nor this session's device reports an invalid-argument error and leaves this session rendering into the surface it has. The session assigns the layer its own device and pixel format.

func (*RenderSessionHandle) SetOpenGLBorrowedTextureTarget
func (session *RenderSessionHandle) SetOpenGLBorrowedTextureTarget(descriptor OpenGLBorrowedTextureDescriptor) error

SetOpenGLBorrowedTextureTarget renders this attached texture session into a new caller-owned OpenGL texture.

See SetMetalBorrowedTextureTarget for what replacing a target preserves. The replacement must belong to the context this session attached with or one in its share group, and that context must be current on the calling thread.

func (*RenderSessionHandle) SetOpenGLSurfaceTarget
func (session *RenderSessionHandle) SetOpenGLSurfaceTarget(descriptor OpenGLSurfaceDescriptor) error

SetOpenGLSurfaceTarget presents this attached surface session through a new OpenGL surface.

See SetMetalSurfaceTarget for what replacing a surface preserves. The new surface is made current on the next render, so a host may hand over a replacement for one it has already destroyed. An unusable surface accepted here reports a native error from the next RenderUpdate rather than this call.

func (*RenderSessionHandle) SetVulkanBorrowedTextureTarget
func (session *RenderSessionHandle) SetVulkanBorrowedTextureTarget(descriptor VulkanBorrowedTextureDescriptor) error

SetVulkanBorrowedTextureTarget renders this attached texture session into a new caller-owned Vulkan image.

See SetMetalBorrowedTextureTarget for what replacing a target preserves. The replacement must carry the format and both layouts this session attached with, because its render pass was built around them.

func (*RenderSessionHandle) SetVulkanSurfaceTarget
func (session *RenderSessionHandle) SetVulkanSurfaceTarget(descriptor VulkanSurfaceDescriptor) error

SetVulkanSurfaceTarget presents this attached surface session through a new Vulkan surface.

See SetMetalSurfaceTarget for what replacing a surface preserves. The outgoing VkSurfaceKHR must still be valid, because this session holds a swapchain built from it; a host that must release its surface first closes this session and attaches again afterward.

The replacement must support the color format and surface transform this session compiled its render pass and shaders for. One that does not reports an unsupported-feature error, leaving this session rendering into the surface it has.

type RenderTargetExtent

type RenderTargetExtent struct {
	Width       uint32
	Height      uint32
	ScaleFactor float64
}

RenderTargetExtent is a logical render target extent in UI pixels.

func (RenderTargetExtent) PhysicalSize
func (extent RenderTargetExtent) PhysicalSize() (width uint32, height uint32, err error)

PhysicalSize returns the extent's physical device-pixel size as ceil(logical * ScaleFactor) per dimension. Surface and session-owned texture targets are sized this way; borrowed texture targets state their physical size instead.

type RenderUpdate

type RenderUpdate struct {
	// Result is what the call produced; each value names the wake a host
	// waits for before it calls again.
	Result RenderResult
	// NeedsRepaint reports whether the map asked for another frame while it
	// rendered this one, as during an ongoing camera transition. It is true
	// only when Result is RenderResultRendered and reads false for every other
	// outcome. This is the same signal a RuntimeEventMapRenderFrameFinished
	// event carries in its NeedsRepaint field, delivered here without the
	// event round trip, so a host can re-arm its frame loop before it drains
	// events.
	NeedsRepaint bool
}

RenderUpdate is the outcome of a successful RenderSessionHandle.RenderUpdate call.

type RenderedFeatureQueryOptions

type RenderedFeatureQueryOptions struct {
	LayerIDs []string
	Filter   []byte
}

RenderedFeatureQueryOptions configures rendered feature queries.

func (RenderedFeatureQueryOptions) Equal
func (options RenderedFeatureQueryOptions) Equal(other RenderedFeatureQueryOptions) bool

Equal reports whether two descriptors hold the same field values.

type RenderedQueryGeometry

type RenderedQueryGeometry struct {
	Type   RenderedQueryGeometryType
	Point  ScreenPoint
	Box    ScreenBox
	Points []ScreenPoint
}

RenderedQueryGeometry describes a rendered feature query geometry.

func RenderedQueryBox
func RenderedQueryBox(box ScreenBox) RenderedQueryGeometry

RenderedQueryBox returns a box rendered-query geometry.

func RenderedQueryLineString
func RenderedQueryLineString(points []ScreenPoint) RenderedQueryGeometry

RenderedQueryLineString returns a line-string rendered-query geometry.

func RenderedQueryPoint
func RenderedQueryPoint(point ScreenPoint) RenderedQueryGeometry

RenderedQueryPoint returns a point rendered-query geometry.

type RenderedQueryGeometryType

type RenderedQueryGeometryType uint32

RenderedQueryGeometryType identifies a rendered feature query geometry shape.

const (
	RenderedQueryGeometryTypePoint      RenderedQueryGeometryType = RenderedQueryGeometryType(C.MLN_RENDERED_QUERY_GEOMETRY_TYPE_POINT)
	RenderedQueryGeometryTypeBox        RenderedQueryGeometryType = RenderedQueryGeometryType(C.MLN_RENDERED_QUERY_GEOMETRY_TYPE_BOX)
	RenderedQueryGeometryTypeLineString RenderedQueryGeometryType = RenderedQueryGeometryType(C.MLN_RENDERED_QUERY_GEOMETRY_TYPE_LINE_STRING)
)

type RenderingStats

type RenderingStats struct {
	EncodingTime       float64
	RenderingTime      float64
	FrameCount         int64
	DrawCallCount      int64
	TotalDrawCallCount int64
}

RenderingStats is copied render-frame statistics.

type ResourceErrorReason

type ResourceErrorReason uint32

ResourceErrorReason identifies provider error categories.

const (
	ResourceErrorReasonNone       ResourceErrorReason = ResourceErrorReason(C.MLN_RESOURCE_ERROR_REASON_NONE)
	ResourceErrorReasonNotFound   ResourceErrorReason = ResourceErrorReason(C.MLN_RESOURCE_ERROR_REASON_NOT_FOUND)
	ResourceErrorReasonServer     ResourceErrorReason = ResourceErrorReason(C.MLN_RESOURCE_ERROR_REASON_SERVER)
	ResourceErrorReasonConnection ResourceErrorReason = ResourceErrorReason(C.MLN_RESOURCE_ERROR_REASON_CONNECTION)
	ResourceErrorReasonRateLimit  ResourceErrorReason = ResourceErrorReason(C.MLN_RESOURCE_ERROR_REASON_RATE_LIMIT)
	ResourceErrorReasonOther      ResourceErrorReason = ResourceErrorReason(C.MLN_RESOURCE_ERROR_REASON_OTHER)
)

type ResourceKind

type ResourceKind uint32

ResourceKind identifies the native resource category for a request.

const (
	ResourceKindUnknown     ResourceKind = ResourceKind(C.MLN_RESOURCE_KIND_UNKNOWN)
	ResourceKindStyle       ResourceKind = ResourceKind(C.MLN_RESOURCE_KIND_STYLE)
	ResourceKindSource      ResourceKind = ResourceKind(C.MLN_RESOURCE_KIND_SOURCE)
	ResourceKindTile        ResourceKind = ResourceKind(C.MLN_RESOURCE_KIND_TILE)
	ResourceKindGlyphs      ResourceKind = ResourceKind(C.MLN_RESOURCE_KIND_GLYPHS)
	ResourceKindSpriteImage ResourceKind = ResourceKind(C.MLN_RESOURCE_KIND_SPRITE_IMAGE)
	ResourceKindSpriteJSON  ResourceKind = ResourceKind(C.MLN_RESOURCE_KIND_SPRITE_JSON)
	ResourceKindImage       ResourceKind = ResourceKind(C.MLN_RESOURCE_KIND_IMAGE)
)

type ResourceLoadingMethod

type ResourceLoadingMethod uint32

ResourceLoadingMethod identifies native cache/network loading policy.

const (
	ResourceLoadingMethodAll         ResourceLoadingMethod = ResourceLoadingMethod(C.MLN_RESOURCE_LOADING_METHOD_ALL)
	ResourceLoadingMethodCacheOnly   ResourceLoadingMethod = ResourceLoadingMethod(C.MLN_RESOURCE_LOADING_METHOD_CACHE_ONLY)
	ResourceLoadingMethodNetworkOnly ResourceLoadingMethod = ResourceLoadingMethod(C.MLN_RESOURCE_LOADING_METHOD_NETWORK_ONLY)
)

type ResourcePriority

type ResourcePriority uint32

ResourcePriority identifies native request priority.

const (
	ResourcePriorityRegular ResourcePriority = ResourcePriority(C.MLN_RESOURCE_PRIORITY_REGULAR)
	ResourcePriorityLow     ResourcePriority = ResourcePriority(C.MLN_RESOURCE_PRIORITY_LOW)
)

type ResourceProviderCallback

type ResourceProviderCallback func(ResourceRequest, *ResourceRequestHandle) ResourceProviderDecision

ResourceProviderCallback intercepts network resource requests. Native code may invoke it on worker or network threads, so it must not call MapLibre map or runtime APIs. After returning ResourceProviderDecisionHandle, complete or close the provided handle. Panics return an unknown decision unless the handle was already completed.

type ResourceProviderDecision

type ResourceProviderDecision uint32

ResourceProviderDecision selects whether native networking or the Go provider handles a request.

const (
	ResourceProviderDecisionPassThrough ResourceProviderDecision = ResourceProviderDecision(C.MLN_RESOURCE_PROVIDER_DECISION_PASS_THROUGH)
	ResourceProviderDecisionHandle      ResourceProviderDecision = ResourceProviderDecision(C.MLN_RESOURCE_PROVIDER_DECISION_HANDLE)
)

type ResourceRequest

type ResourceRequest struct {
	// RequestedURL preserves configured URI-scheme aliases and is the
	// request's logical, cache-facing identity.
	RequestedURL string
	// ResolvedURL is the URL to fetch, after tile server normalization.
	ResolvedURL         string
	Kind                ResourceKind
	RawKind             uint32
	LoadingMethod       ResourceLoadingMethod
	Priority            ResourcePriority
	Usage               ResourceUsage
	StoragePolicy       ResourceStoragePolicy
	HasRange            bool
	RangeStart          uint64
	RangeEnd            uint64
	HasPriorModified    bool
	PriorModifiedUnixMS int64
	HasPriorExpires     bool
	PriorExpiresUnixMS  int64
	PriorETag           string
	PriorData           []byte
}

ResourceRequest is a copied native resource request.

type ResourceRequestHandle

type ResourceRequestHandle struct {
	// contains filtered or unexported fields
}

ResourceRequestHandle owns a provider-selected native request handle.

func (*ResourceRequestHandle) Cancelled
func (handle *ResourceRequestHandle) Cancelled() (bool, error)

Cancelled reports whether native code cancelled the provider request.

func (*ResourceRequestHandle) Close
func (handle *ResourceRequestHandle) Close()

Close releases the provider-owned request handle without completing it.

func (*ResourceRequestHandle) Complete
func (handle *ResourceRequestHandle) Complete(response ResourceResponse) error

Complete sends a resource response to native code and releases the handle when native ownership has been finalized.

type ResourceResponse

type ResourceResponse struct {
	Status           ResourceResponseStatus
	ErrorReason      ResourceErrorReason
	Bytes            []byte
	ErrorMessage     string
	MustRevalidate   bool
	HasModified      bool
	ModifiedUnixMS   int64
	HasExpires       bool
	ExpiresUnixMS    int64
	ETag             string
	HasRetryAfter    bool
	RetryAfterUnixMS int64
}

ResourceResponse is copied into native memory during request completion.

type ResourceResponseStatus

type ResourceResponseStatus uint32

ResourceResponseStatus identifies provider response status.

const (
	ResourceResponseStatusOK          ResourceResponseStatus = ResourceResponseStatus(C.MLN_RESOURCE_RESPONSE_STATUS_OK)
	ResourceResponseStatusError       ResourceResponseStatus = ResourceResponseStatus(C.MLN_RESOURCE_RESPONSE_STATUS_ERROR)
	ResourceResponseStatusNoContent   ResourceResponseStatus = ResourceResponseStatus(C.MLN_RESOURCE_RESPONSE_STATUS_NO_CONTENT)
	ResourceResponseStatusNotModified ResourceResponseStatus = ResourceResponseStatus(C.MLN_RESOURCE_RESPONSE_STATUS_NOT_MODIFIED)
)

type ResourceStoragePolicy

type ResourceStoragePolicy uint32

ResourceStoragePolicy identifies native cache persistence policy.

const (
	ResourceStoragePolicyPermanent ResourceStoragePolicy = ResourceStoragePolicy(C.MLN_RESOURCE_STORAGE_POLICY_PERMANENT)
	ResourceStoragePolicyVolatile  ResourceStoragePolicy = ResourceStoragePolicy(C.MLN_RESOURCE_STORAGE_POLICY_VOLATILE)
)

type ResourceTransformCallback

type ResourceTransformCallback func(ResourceTransformRequest) (replacementURL string, replace bool)

ResourceTransformCallback rewrites network resource URLs. Native code may invoke it on worker or network threads, so it must not call MapLibre map or runtime APIs. Return replace=false or an empty URL to keep the original URL. Panics become native callback errors, and replacement URLs containing embedded NUL are rejected.

type ResourceTransformRequest

type ResourceTransformRequest struct {
	Kind    ResourceKind
	RawKind uint32
	URL     string
}

ResourceTransformRequest describes a URL transform request copied for Go.

type ResourceUsage

type ResourceUsage uint32

ResourceUsage identifies online or offline request use.

const (
	ResourceUsageOnline  ResourceUsage = ResourceUsage(C.MLN_RESOURCE_USAGE_ONLINE)
	ResourceUsageOffline ResourceUsage = ResourceUsage(C.MLN_RESOURCE_USAGE_OFFLINE)
)

type RuntimeEvent

type RuntimeEvent struct {
	Type       RuntimeEventType
	SourceType RuntimeEventSourceType
	Source     RuntimeEventSource
	// Code is a secondary event detail whose meaning Type selects: a
	// CameraChangeMode for the camera-will-change and camera-did-change events,
	// the ordinal of MapLibre Native's internal map load error kind for
	// map-loading-failed, and the result status for
	// offline-operation-completed. Every other event type reports 0.
	Code        int32
	PayloadType RuntimeEventPayloadType
	// Message is the event's text: a failure description, a missing style image
	// ID, or a tile action's source ID. It is empty for an event that carries no
	// message.
	Message string
	// Payload is the typed payload PayloadType selects, nil for an event without
	// one, and a RuntimeEventUnknownPayload for a payload type this binding
	// version does not define.
	Payload any
}

RuntimeEvent is a copied runtime event. Unknown payloads preserve raw metadata and bytes.

type RuntimeEventBatch

type RuntimeEventBatch struct {
	Events []RuntimeEvent
	// RemainingCount is the number of events still queued after this batch. A
	// nonzero value means another drain reports more.
	RemainingCount uint64
}

RuntimeEventBatch is one drained batch of runtime events in queue order. Every field of every event is copied out of runtime-owned storage before the drain returns, so a batch and the values taken out of it stay readable after the next drain.

type RuntimeEventCameraTransitionFinishedPayload

type RuntimeEventCameraTransitionFinishedPayload struct {
	TransitionID uint64
}

RuntimeEventCameraTransitionFinishedPayload is a copied camera transition-finished event payload. It carries the identity the caller stamped on the transition through AnimationOptions.TransitionID.

type RuntimeEventMask

type RuntimeEventMask uint64

RuntimeEventMask selects which event types a map or a runtime queues. An event whose type is unselected is never built and never queued, so it neither reaches a batch nor raises the runtime's wake flag.

Every bit value comes from the C API, so a mask cannot drift from the RuntimeEventType constants. Masks combine with the bitwise operators: | adds types, &^ clears them, and RuntimeEventMaskNone is the empty mask.

const (
	// RuntimeEventMaskNone selects no event type.
	RuntimeEventMaskNone                                RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_NONE)
	RuntimeEventMaskMapCameraWillChange                 RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_CAMERA_WILL_CHANGE)
	RuntimeEventMaskMapCameraIsChanging                 RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_CAMERA_IS_CHANGING)
	RuntimeEventMaskMapCameraDidChange                  RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_CAMERA_DID_CHANGE)
	RuntimeEventMaskMapStyleLoaded                      RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_STYLE_LOADED)
	RuntimeEventMaskMapLoadingStarted                   RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_LOADING_STARTED)
	RuntimeEventMaskMapLoadingFinished                  RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_LOADING_FINISHED)
	RuntimeEventMaskMapLoadingFailed                    RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_LOADING_FAILED)
	RuntimeEventMaskMapIdle                             RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_IDLE)
	RuntimeEventMaskMapRenderUpdateAvailable            RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_RENDER_UPDATE_AVAILABLE)
	RuntimeEventMaskMapRenderError                      RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_RENDER_ERROR)
	RuntimeEventMaskMapStillImageFinished               RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_STILL_IMAGE_FINISHED)
	RuntimeEventMaskMapStillImageFailed                 RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_STILL_IMAGE_FAILED)
	RuntimeEventMaskMapRenderFrameStarted               RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_RENDER_FRAME_STARTED)
	RuntimeEventMaskMapRenderFrameFinished              RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_RENDER_FRAME_FINISHED)
	RuntimeEventMaskMapRenderMapStarted                 RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_RENDER_MAP_STARTED)
	RuntimeEventMaskMapRenderMapFinished                RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_RENDER_MAP_FINISHED)
	RuntimeEventMaskMapStyleImageMissing                RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_STYLE_IMAGE_MISSING)
	RuntimeEventMaskMapTileAction                       RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_TILE_ACTION)
	RuntimeEventMaskMapCameraTransitionFinished         RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_MAP_CAMERA_TRANSITION_FINISHED)
	RuntimeEventMaskOfflineRegionStatusChanged          RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_OFFLINE_REGION_STATUS_CHANGED)
	RuntimeEventMaskOfflineRegionResponseError          RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_OFFLINE_REGION_RESPONSE_ERROR)
	RuntimeEventMaskOfflineRegionTileCountLimitExceeded RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_OFFLINE_REGION_TILE_COUNT_LIMIT_EXCEEDED)
	RuntimeEventMaskOfflineOperationCompleted           RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_OFFLINE_OPERATION_COMPLETED)
	// RuntimeEventMaskAllMapEvents selects every map-originated event type this
	// binding version defines.
	RuntimeEventMaskAllMapEvents RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_ALL_MAP_EVENTS)
	// RuntimeEventMaskAllRuntimeEvents selects every runtime-originated event
	// type this binding version defines.
	RuntimeEventMaskAllRuntimeEvents RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_ALL_RUNTIME_EVENTS)
	// RuntimeEventMaskAll selects every event type this binding version defines,
	// and both mask setters accept it.
	RuntimeEventMaskAll RuntimeEventMask = RuntimeEventMask(C.MLN_RUNTIME_EVENT_MASK_ALL)
)
func (RuntimeEventMask) Has
func (mask RuntimeEventMask) Has(requested RuntimeEventMask) bool

Has reports whether all requested event type bits are set.

type RuntimeEventOfflineOperationCompletedPayload

type RuntimeEventOfflineOperationCompletedPayload struct {
	OperationID   uint64
	OperationKind OfflineOperationKind
	ResultKind    OfflineOperationResultKind
	ResultStatus  int32
	Found         bool
}

RuntimeEventOfflineOperationCompletedPayload is a copied offline operation completion event payload.

type RuntimeEventOfflineRegionResponseErrorPayload

type RuntimeEventOfflineRegionResponseErrorPayload struct {
	RegionID  OfflineRegionID
	Reason    ResourceErrorReason
	RawReason uint32
}

RuntimeEventOfflineRegionResponseErrorPayload is a copied offline response error event payload.

type RuntimeEventOfflineRegionStatusPayload

type RuntimeEventOfflineRegionStatusPayload struct {
	RegionID OfflineRegionID
	Status   OfflineRegionStatus
}

RuntimeEventOfflineRegionStatusPayload is a copied offline status event payload.

type RuntimeEventOfflineRegionTileCountLimitPayload

type RuntimeEventOfflineRegionTileCountLimitPayload struct {
	RegionID OfflineRegionID
	Limit    uint64
}

RuntimeEventOfflineRegionTileCountLimitPayload is a copied offline tile-count limit event payload.

type RuntimeEventPayloadType

type RuntimeEventPayloadType uint32

RuntimeEventPayloadType identifies the copied event payload shape.

const (
	RuntimeEventPayloadNone                        RuntimeEventPayloadType = RuntimeEventPayloadType(C.MLN_RUNTIME_EVENT_PAYLOAD_NONE)
	RuntimeEventPayloadRenderFrame                 RuntimeEventPayloadType = RuntimeEventPayloadType(C.MLN_RUNTIME_EVENT_PAYLOAD_RENDER_FRAME)
	RuntimeEventPayloadRenderMap                   RuntimeEventPayloadType = RuntimeEventPayloadType(C.MLN_RUNTIME_EVENT_PAYLOAD_RENDER_MAP)
	RuntimeEventPayloadTileAction                  RuntimeEventPayloadType = RuntimeEventPayloadType(C.MLN_RUNTIME_EVENT_PAYLOAD_TILE_ACTION)
	RuntimeEventPayloadOfflineRegionStatus         RuntimeEventPayloadType = RuntimeEventPayloadType(C.MLN_RUNTIME_EVENT_PAYLOAD_OFFLINE_REGION_STATUS)
	RuntimeEventPayloadOfflineRegionResponseError  RuntimeEventPayloadType = RuntimeEventPayloadType(C.MLN_RUNTIME_EVENT_PAYLOAD_OFFLINE_REGION_RESPONSE_ERROR)
	RuntimeEventPayloadOfflineRegionTileCountLimit RuntimeEventPayloadType = RuntimeEventPayloadType(C.MLN_RUNTIME_EVENT_PAYLOAD_OFFLINE_REGION_TILE_COUNT_LIMIT)
	RuntimeEventPayloadOfflineOperationCompleted   RuntimeEventPayloadType = RuntimeEventPayloadType(C.MLN_RUNTIME_EVENT_PAYLOAD_OFFLINE_OPERATION_COMPLETED)
	RuntimeEventPayloadCameraTransitionFinished    RuntimeEventPayloadType = RuntimeEventPayloadType(C.MLN_RUNTIME_EVENT_PAYLOAD_CAMERA_TRANSITION_FINISHED)
)

type RuntimeEventRenderFramePayload

type RuntimeEventRenderFramePayload struct {
	Mode             RenderMode
	RawMode          uint32
	NeedsRepaint     bool
	PlacementChanged bool
	Stats            RenderingStats
}

RuntimeEventRenderFramePayload is a copied render-frame event payload.

type RuntimeEventRenderMapPayload

type RuntimeEventRenderMapPayload struct {
	Mode    RenderMode
	RawMode uint32
}

RuntimeEventRenderMapPayload is a copied render-map event payload.

type RuntimeEventSource

type RuntimeEventSource struct {
	Type RuntimeEventSourceType
	// RawID is the native source id the C API reported, whatever Type is. It
	// names one object for the life of the process, so a host may compare it
	// against an id it already holds, even for a source type this binding
	// version does not name or a map this runtime no longer tracks. It is an
	// identity value only: no public handle comes from it.
	RawID uint64
	// MapID is the identity of the live map this runtime resolved RawID to, and 0
	// when Type is not RuntimeEventSourceMap or the map is gone. Compare RawID
	// instead to attribute an event whose map has been closed.
	MapID MapID
}

RuntimeEventSource identifies the runtime object that emitted an event.

type RuntimeEventSourceType

type RuntimeEventSourceType uint32

RuntimeEventSourceType identifies the native handle kind that emitted an event.

const (
	RuntimeEventSourceRuntime RuntimeEventSourceType = RuntimeEventSourceType(C.MLN_RUNTIME_EVENT_SOURCE_RUNTIME)
	RuntimeEventSourceMap     RuntimeEventSourceType = RuntimeEventSourceType(C.MLN_RUNTIME_EVENT_SOURCE_MAP)
)

type RuntimeEventTileActionPayload

type RuntimeEventTileActionPayload struct {
	Operation    TileOperation
	RawOperation uint32
	TileID       TileID
}

RuntimeEventTileActionPayload is a copied tile-action event payload. The event message carries the source ID.

type RuntimeEventType

type RuntimeEventType uint32

RuntimeEventType identifies a runtime event kind.

const (
	RuntimeEventMapCameraWillChange                 RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_CAMERA_WILL_CHANGE)
	RuntimeEventMapCameraIsChanging                 RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_CAMERA_IS_CHANGING)
	RuntimeEventMapCameraDidChange                  RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_CAMERA_DID_CHANGE)
	RuntimeEventMapStyleLoaded                      RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_STYLE_LOADED)
	RuntimeEventMapLoadingStarted                   RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_LOADING_STARTED)
	RuntimeEventMapLoadingFinished                  RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_LOADING_FINISHED)
	RuntimeEventMapLoadingFailed                    RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_LOADING_FAILED)
	RuntimeEventMapIdle                             RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_IDLE)
	RuntimeEventMapRenderUpdateAvailable            RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_RENDER_UPDATE_AVAILABLE)
	RuntimeEventMapRenderError                      RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_RENDER_ERROR)
	RuntimeEventMapStillImageFinished               RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_STILL_IMAGE_FINISHED)
	RuntimeEventMapStillImageFailed                 RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_STILL_IMAGE_FAILED)
	RuntimeEventMapRenderFrameStarted               RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_RENDER_FRAME_STARTED)
	RuntimeEventMapRenderFrameFinished              RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_RENDER_FRAME_FINISHED)
	RuntimeEventMapRenderMapStarted                 RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_RENDER_MAP_STARTED)
	RuntimeEventMapRenderMapFinished                RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_RENDER_MAP_FINISHED)
	RuntimeEventMapStyleImageMissing                RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_STYLE_IMAGE_MISSING)
	RuntimeEventMapTileAction                       RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_TILE_ACTION)
	RuntimeEventOfflineRegionStatusChanged          RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_OFFLINE_REGION_STATUS_CHANGED)
	RuntimeEventOfflineRegionResponseError          RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_OFFLINE_REGION_RESPONSE_ERROR)
	RuntimeEventOfflineRegionTileCountLimitExceeded RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_OFFLINE_REGION_TILE_COUNT_LIMIT_EXCEEDED)
	RuntimeEventOfflineOperationCompleted           RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_OFFLINE_OPERATION_COMPLETED)
	RuntimeEventMapCameraTransitionFinished         RuntimeEventType = RuntimeEventType(C.MLN_RUNTIME_EVENT_MAP_CAMERA_TRANSITION_FINISHED)
)

type RuntimeEventUnknownPayload

type RuntimeEventUnknownPayload struct {
	Bytes []byte
}

RuntimeEventUnknownPayload contains copied bytes for a payload type unknown to this Go binding version. Bytes is the event's whole payload window, which is the batch's event stride minus this binding's payload offset.

type RuntimeHandle

type RuntimeHandle struct {
	// contains filtered or unexported fields
}

RuntimeHandle owns scheduler state and event storage for one owner thread.

func NewRuntime
func NewRuntime() (*RuntimeHandle, error)

NewRuntime creates a runtime on the current OS thread using native defaults.

func NewRuntimeWithOptions
func NewRuntimeWithOptions(options RuntimeOptions) (*RuntimeHandle, error)

NewRuntimeWithOptions creates a runtime on the current OS thread using explicit options. Start from NewRuntimeOptions to keep every event type selected; a zero-value RuntimeOptions queues no event.

func (*RuntimeHandle) ClearHttpHeaderTransform
func (runtime *RuntimeHandle) ClearHttpHeaderTransform() error

ClearHttpHeaderTransform clears the runtime-scoped outgoing HTTP header transform.

func (*RuntimeHandle) ClearResourceProvider
func (runtime *RuntimeHandle) ClearResourceProvider() error

ClearResourceProvider clears the runtime-scoped network resource provider, so later requests go to MapLibre's online file source. Once this call returns, the cleared provider is no longer invoked; requests it already took a handle for keep that handle, so complete or close each one as usual.

func (*RuntimeHandle) ClearResourceTransform
func (runtime *RuntimeHandle) ClearResourceTransform() error

ClearResourceTransform clears the runtime-scoped network URL transform.

func (*RuntimeHandle) Close
func (runtime *RuntimeHandle) Close() error

Close destroys this runtime. A successful close makes later calls no-ops. A failed close leaves the native handle live so callers can retry on the owner thread.

func (*RuntimeHandle) DrainEvents
func (runtime *RuntimeHandle) DrainEvents(maxEvents int) (RuntimeEventBatch, error)

DrainEvents takes this runtime's queued events as one batch of copied values. Events arrive in queue order, and the batch reports how many events stayed queued.

maxEvents bounds the drain: zero takes every queued event, and a positive value takes at most that many and leaves the rest queued. A negative value returns ErrInvalidArgument.

Call Pump first to advance the runtime, then drain the events that pump produced.

func (*RuntimeHandle) EventMask
func (runtime *RuntimeHandle) EventMask() (RuntimeEventMask, error)

EventMask reports which runtime-originated event types this runtime queues. A runtime that has not been narrowed reports RuntimeEventMaskAll.

func (*RuntimeHandle) NewMap
func (runtime *RuntimeHandle) NewMap() (*MapHandle, error)

NewMap creates a map owned by this runtime with native default options.

func (*RuntimeHandle) NewMapWithOptions
func (runtime *RuntimeHandle) NewMapWithOptions(options MapOptions) (*MapHandle, error)

NewMapWithOptions creates a map owned by this runtime with explicit options. Start from NewMapOptions to keep every map-originated event type selected; a zero-value MapOptions queues no event.

func (*RuntimeHandle) Pump
func (runtime *RuntimeHandle) Pump(timeout time.Duration, budget time.Duration) error

Pump advances this runtime. It parks the owner thread when timeout allows, then drains the owner-thread task queues, including tasks the drained ones enqueue. Take the queued runtime events with DrainEvents afterwards.

timeout sets the park bound: zero drains and returns, a positive value parks for up to that long, and a negative value parks until a wake arrives. A parking call returns as soon as the runtime's wake flag is set and clears it, and returns without parking while unread runtime events are queued. Timers and ready file descriptors set the flag only when they queue owner-thread work, so pass a bounded timeout to cap how long a call waits.

budget bounds the drain: a negative value drains without a bound, and zero or a positive value stops the drain at the first task boundary after that long, measured from the start of the drain. The first queued task always runs, so a bounded pump always makes progress, and tasks left behind set the wake flag so the next Pump returns without parking and continues them. The budget bounds the task queues alone: expired timers and ready file descriptors are serviced regardless, and a task runs to completion once started, so one long task can overrun the budget.

A non-zero timeout blocks the calling goroutine and its OS thread. Call it outside any lock that a goroutine signalling a WakeSource takes.

func (*RuntimeHandle) SetEventMask
func (runtime *RuntimeHandle) SetEventMask(mask RuntimeEventMask) error

SetEventMask selects which runtime-originated event types this runtime queues. It accepts RuntimeEventMaskAll, reads the bits in RuntimeEventMaskAllRuntimeEvents, and returns ErrInvalidArgument for a bit outside RuntimeEventMaskAll.

Narrowing gates later events and keeps queued ones, so a caller drains what it already caused. An offline operation records its result before this mask is consulted, so the matching take-result call reports the result of an operation whose completion event this mask cleared.

func (*RuntimeHandle) SetHttpHeaderTransform
func (runtime *RuntimeHandle) SetHttpHeaderTransform(transform HttpHeaderTransformCallback) error

SetHttpHeaderTransform installs or replaces the runtime-scoped outgoing HTTP header transform.

func (*RuntimeHandle) SetResourceProvider
func (runtime *RuntimeHandle) SetResourceProvider(provider ResourceProviderCallback) error

SetResourceProvider installs or replaces the runtime-scoped network resource provider, and may be called while maps are live. Native code may invoke the provider on worker or network threads, so callbacks must be thread-safe and must not call MapLibre map or runtime APIs. Once this call returns, a replaced provider is no longer invoked; requests it already took a handle for keep that handle, so complete or close each one as usual.

func (*RuntimeHandle) SetResourceTransform
func (runtime *RuntimeHandle) SetResourceTransform(transform ResourceTransformCallback) error

SetResourceTransform installs or replaces the runtime-scoped network URL transform. Native code may invoke the transform on worker or network threads, so callbacks must be thread-safe and must not call MapLibre map/runtime APIs.

func (*RuntimeHandle) StartAmbientCacheOperation
func (runtime *RuntimeHandle) StartAmbientCacheOperation(operation AmbientCacheOperation) (*OfflineOperationHandle[struct{}], error)

StartAmbientCacheOperation starts a native ambient cache maintenance operation.

func (*RuntimeHandle) StartCreateOfflineRegion
func (runtime *RuntimeHandle) StartCreateOfflineRegion(definition OfflineRegionDefinition, metadata []byte) (*OfflineOperationHandle[OfflineRegionInfo], error)

StartCreateOfflineRegion starts creating an offline region.

func (*RuntimeHandle) StartDeleteOfflineRegion
func (runtime *RuntimeHandle) StartDeleteOfflineRegion(id OfflineRegionID) (*OfflineOperationHandle[struct{}], error)

StartDeleteOfflineRegion starts deleting an offline region.

func (*RuntimeHandle) StartInvalidateOfflineRegion
func (runtime *RuntimeHandle) StartInvalidateOfflineRegion(id OfflineRegionID) (*OfflineOperationHandle[struct{}], error)

StartInvalidateOfflineRegion starts invalidating cached resources for a region.

func (*RuntimeHandle) StartMergeOfflineRegionsDatabase
func (runtime *RuntimeHandle) StartMergeOfflineRegionsDatabase(path string) (*OfflineOperationHandle[[]OfflineRegionInfo], error)

StartMergeOfflineRegionsDatabase starts merging offline regions from another database path.

func (*RuntimeHandle) StartOfflineRegion
func (runtime *RuntimeHandle) StartOfflineRegion(id OfflineRegionID) (*OfflineOperationHandle[*OfflineRegionInfo], error)

StartOfflineRegion starts getting an offline region snapshot by ID.

func (*RuntimeHandle) StartOfflineRegionStatus
func (runtime *RuntimeHandle) StartOfflineRegionStatus(id OfflineRegionID) (*OfflineOperationHandle[OfflineRegionStatus], error)

StartOfflineRegionStatus starts getting offline region status.

func (*RuntimeHandle) StartOfflineRegions
func (runtime *RuntimeHandle) StartOfflineRegions() (*OfflineOperationHandle[[]OfflineRegionInfo], error)

StartOfflineRegions starts listing offline regions.

func (*RuntimeHandle) StartSetMaximumAmbientCacheSize
func (runtime *RuntimeHandle) StartSetMaximumAmbientCacheSize(size uint64) (*OfflineOperationHandle[struct{}], error)

StartSetMaximumAmbientCacheSize starts a change to this runtime's maximum ambient cache size. Lowering it evicts ambient resources to fit the new budget; offline regions are unaffected.

func (*RuntimeHandle) StartSetOfflineRegionDownloadState
func (runtime *RuntimeHandle) StartSetOfflineRegionDownloadState(id OfflineRegionID, state OfflineRegionDownloadState) (*OfflineOperationHandle[struct{}], error)

StartSetOfflineRegionDownloadState starts setting offline region download state.

func (*RuntimeHandle) StartSetOfflineRegionObserved
func (runtime *RuntimeHandle) StartSetOfflineRegionObserved(id OfflineRegionID, observed bool) (*OfflineOperationHandle[struct{}], error)

StartSetOfflineRegionObserved starts setting offline event observation state.

func (*RuntimeHandle) StartUpdateOfflineRegionMetadata
func (runtime *RuntimeHandle) StartUpdateOfflineRegionMetadata(id OfflineRegionID, metadata []byte) (*OfflineOperationHandle[OfflineRegionInfo], error)

StartUpdateOfflineRegionMetadata starts updating offline region metadata.

func (*RuntimeHandle) WakeSource
func (runtime *RuntimeHandle) WakeSource() (*WakeSource, error)

WakeSource acquires a wake source that releases this runtime's parked owner thread. The returned source is usable from any goroutine, and the caller closes it.

type RuntimeOptions

type RuntimeOptions struct {
	AssetPath string
	CachePath string
	// EventMask selects the runtime-originated event types this runtime queues.
	// NewRuntimeOptions sets it to the native default, which selects every type.
	// See RuntimeHandle.SetEventMask.
	EventMask RuntimeEventMask
}

RuntimeOptions configures runtime creation.

func NewRuntimeOptions
func NewRuntimeOptions(assetPath, cachePath string) RuntimeOptions

NewRuntimeOptions returns runtime creation options for an asset root and a cache path, either of which may be empty to keep the native default. The returned options select every runtime-originated event type.

func (RuntimeOptions) Equal
func (options RuntimeOptions) Equal(other RuntimeOptions) bool

Equal reports whether two descriptors hold the same field values.

type ScreenBox

type ScreenBox struct {
	Min ScreenPoint
	Max ScreenPoint
}

ScreenBox is a screen-space query rectangle in logical map pixels. Corners may be given in any order and may extend past the viewport; rendered queries normalize the corners and clip the box to the viewport.

type ScreenPoint

type ScreenPoint struct {
	X float64
	Y float64
}

ScreenPoint is a logical pixel coordinate.

type SourceFeatureQueryOptions

type SourceFeatureQueryOptions struct {
	SourceLayerIDs []string
	Filter         []byte
}

SourceFeatureQueryOptions configures source feature queries.

func (SourceFeatureQueryOptions) Equal
func (options SourceFeatureQueryOptions) Equal(other SourceFeatureQueryOptions) bool

Equal reports whether two descriptors hold the same field values.

type StyleGeoJSONSourceOptions

type StyleGeoJSONSourceOptions struct {
	MinZoom        *float64
	MaxZoom        *float64
	Tolerance      *float64
	ClusterMaxZoom *float64
	// ClusterProperties holds cluster aggregation expressions as a JSON object
	// in the MapLibre Style Spec clusterProperties form.
	ClusterProperties []byte
	TileSize          *uint32
	Buffer            *uint32
	ClusterRadius     *uint32
	ClusterMinPoints  *uint32
	LineMetrics       *bool
	Cluster           *bool
	// SynchronousTiling slices requested tiles inline during the update pass,
	// so data set through SetGeoJSONSourceData reaches the next rendered frame
	// rather than a later one. SetGeoJSONSourceSynchronousTiling overrides this
	// at runtime.
	SynchronousTiling *bool
}

StyleGeoJSONSourceOptions configures GeoJSON sources. These options are baked into prepared data by NewGeoJSONSourceData and fixed when the source is created, so SetGeoJSONSourceURL keeps the options the source was added with and SetGeoJSONSourceData requires data prepared with matching options.

func (StyleGeoJSONSourceOptions) Clone
func (options StyleGeoJSONSourceOptions) Clone() StyleGeoJSONSourceOptions

Clone returns an independent deep copy of this descriptor.

func (StyleGeoJSONSourceOptions) Equal
func (options StyleGeoJSONSourceOptions) Equal(other StyleGeoJSONSourceOptions) bool

Equal reports whether two descriptors hold the same field values.

func (StyleGeoJSONSourceOptions) WithBuffer
func (options StyleGeoJSONSourceOptions) WithBuffer(buffer uint32) StyleGeoJSONSourceOptions

WithBuffer returns a copy that sets the tile buffer in pixels.

func (StyleGeoJSONSourceOptions) WithCluster
func (options StyleGeoJSONSourceOptions) WithCluster(cluster bool) StyleGeoJSONSourceOptions

WithCluster returns a copy that sets whether point features cluster.

func (StyleGeoJSONSourceOptions) WithClusterMaxZoom
func (options StyleGeoJSONSourceOptions) WithClusterMaxZoom(clusterMaxZoom float64) StyleGeoJSONSourceOptions

WithClusterMaxZoom returns a copy that sets the highest zoom that clusters points.

func (StyleGeoJSONSourceOptions) WithClusterMinPoints
func (options StyleGeoJSONSourceOptions) WithClusterMinPoints(clusterMinPoints uint32) StyleGeoJSONSourceOptions

WithClusterMinPoints returns a copy that sets the points required to form a cluster.

func (StyleGeoJSONSourceOptions) WithClusterProperties
func (options StyleGeoJSONSourceOptions) WithClusterProperties(clusterProperties []byte) StyleGeoJSONSourceOptions

WithClusterProperties returns a copy that sets cluster aggregation expressions.

func (StyleGeoJSONSourceOptions) WithClusterRadius
func (options StyleGeoJSONSourceOptions) WithClusterRadius(clusterRadius uint32) StyleGeoJSONSourceOptions

WithClusterRadius returns a copy that sets the cluster radius in pixels.

func (StyleGeoJSONSourceOptions) WithLineMetrics
func (options StyleGeoJSONSourceOptions) WithLineMetrics(lineMetrics bool) StyleGeoJSONSourceOptions

WithLineMetrics returns a copy that sets whether line distance metrics are added.

func (StyleGeoJSONSourceOptions) WithMaxZoom
func (options StyleGeoJSONSourceOptions) WithMaxZoom(maxZoom float64) StyleGeoJSONSourceOptions

WithMaxZoom returns a copy that sets the maximum tiling zoom.

func (StyleGeoJSONSourceOptions) WithMinZoom
func (options StyleGeoJSONSourceOptions) WithMinZoom(minZoom float64) StyleGeoJSONSourceOptions

WithMinZoom returns a copy that sets the minimum tiling zoom.

func (StyleGeoJSONSourceOptions) WithSynchronousTiling
func (options StyleGeoJSONSourceOptions) WithSynchronousTiling(synchronousTiling bool) StyleGeoJSONSourceOptions

WithSynchronousTiling returns a copy that sets whether requested tiles are sliced inline during the update pass.

func (StyleGeoJSONSourceOptions) WithTileSize
func (options StyleGeoJSONSourceOptions) WithTileSize(tileSize uint32) StyleGeoJSONSourceOptions

WithTileSize returns a copy that sets the tile extent in pixels.

func (StyleGeoJSONSourceOptions) WithTolerance
func (options StyleGeoJSONSourceOptions) WithTolerance(tolerance float64) StyleGeoJSONSourceOptions

WithTolerance returns a copy that sets the Douglas-Peucker simplification tolerance.

type StyleImageInfo

type StyleImageInfo struct {
	Width      uint32
	Height     uint32
	Stride     uint32
	ByteLength uint64
	PixelRatio float32
	SDF        bool
	// StretchXCount and StretchYCount report the interval counts. Read the
	// intervals themselves with StyleImageStretches.
	StretchXCount uint64
	StretchYCount uint64
	// Content is the content box, absent when the image carries none.
	Content       *ImageContent
	TextFitWidth  *StyleImageTextFit
	TextFitHeight *StyleImageTextFit
}

StyleImageInfo contains copied runtime style image metadata.

type StyleImageOptions

type StyleImageOptions struct {
	PixelRatio *float32
	SDF        *bool
	// StretchX and StretchY are the stretchable intervals along each axis. A
	// present empty slice stays distinguishable from an absent one.
	StretchX []ImageStretch
	StretchY []ImageStretch
	// Content is the content box used when icon-text-fit applies.
	Content       *ImageContent
	TextFitWidth  *StyleImageTextFit
	TextFitHeight *StyleImageTextFit
}

StyleImageOptions configures a runtime style image.

func (StyleImageOptions) Clone
func (options StyleImageOptions) Clone() StyleImageOptions

Clone returns an independent deep copy of this descriptor.

func (StyleImageOptions) Equal
func (options StyleImageOptions) Equal(other StyleImageOptions) bool

Equal reports whether two descriptors hold the same field values.

type StyleImageTextFit

type StyleImageTextFit uint32

StyleImageTextFit reports how a stretchable image fits text along one axis.

const (
	StyleImageTextFitStretchOrShrink StyleImageTextFit = StyleImageTextFit(C.MLN_STYLE_IMAGE_TEXT_FIT_STRETCH_OR_SHRINK)
	StyleImageTextFitStretchOnly     StyleImageTextFit = StyleImageTextFit(C.MLN_STYLE_IMAGE_TEXT_FIT_STRETCH_ONLY)
	StyleImageTextFitProportional    StyleImageTextFit = StyleImageTextFit(C.MLN_STYLE_IMAGE_TEXT_FIT_PROPORTIONAL)
)

Style image text-fit values.

type StyleLayerVisibility

type StyleLayerVisibility uint32

StyleLayerVisibility reports whether a style layer draws.

const (
	StyleLayerVisibilityVisible StyleLayerVisibility = StyleLayerVisibility(C.MLN_STYLE_LAYER_VISIBILITY_VISIBLE)
	StyleLayerVisibilityNone    StyleLayerVisibility = StyleLayerVisibility(C.MLN_STYLE_LAYER_VISIBILITY_NONE)
)

Style layer visibility values.

type StyleRasterDEMEncoding

type StyleRasterDEMEncoding uint32

StyleRasterDEMEncoding selects raster DEM tile encoding.

const (
	StyleRasterDEMEncodingMapbox    StyleRasterDEMEncoding = StyleRasterDEMEncoding(C.MLN_STYLE_RASTER_DEM_ENCODING_MAPBOX)
	StyleRasterDEMEncodingTerrarium StyleRasterDEMEncoding = StyleRasterDEMEncoding(C.MLN_STYLE_RASTER_DEM_ENCODING_TERRARIUM)
)

type StyleSourceInfo

type StyleSourceInfo struct {
	Type            StyleSourceType
	IDSize          uint64
	IsVolatile      bool
	HasAttribution  bool
	AttributionSize uint64
	Attribution     *string
	URL             *string
	TileJSON        *StyleSourceTileJSON
	TileSize        *uint32
	VectorEncoding  *StyleVectorTileEncoding
	RasterEncoding  *StyleRasterDEMEncoding
}

StyleSourceInfo contains copied metadata for one style source.

type StyleSourceTileJSON

type StyleSourceTileJSON struct {
	TileURLs []string
	MinZoom  float64
	MaxZoom  float64
	Scheme   StyleTileScheme
	Bounds   *LatLngBounds
}

StyleSourceTileJSON contains the retained TileJSON fields of an inline tile source.

type StyleSourceType

type StyleSourceType uint32

StyleSourceType identifies a native style source kind.

const (
	StyleSourceTypeUnknown         StyleSourceType = StyleSourceType(C.MLN_STYLE_SOURCE_TYPE_UNKNOWN)
	StyleSourceTypeVector          StyleSourceType = StyleSourceType(C.MLN_STYLE_SOURCE_TYPE_VECTOR)
	StyleSourceTypeRaster          StyleSourceType = StyleSourceType(C.MLN_STYLE_SOURCE_TYPE_RASTER)
	StyleSourceTypeRasterDEM       StyleSourceType = StyleSourceType(C.MLN_STYLE_SOURCE_TYPE_RASTER_DEM)
	StyleSourceTypeGeoJSON         StyleSourceType = StyleSourceType(C.MLN_STYLE_SOURCE_TYPE_GEOJSON)
	StyleSourceTypeImage           StyleSourceType = StyleSourceType(C.MLN_STYLE_SOURCE_TYPE_IMAGE)
	StyleSourceTypeVideo           StyleSourceType = StyleSourceType(C.MLN_STYLE_SOURCE_TYPE_VIDEO)
	StyleSourceTypeAnnotations     StyleSourceType = StyleSourceType(C.MLN_STYLE_SOURCE_TYPE_ANNOTATIONS)
	StyleSourceTypeCustomVector    StyleSourceType = StyleSourceType(C.MLN_STYLE_SOURCE_TYPE_CUSTOM_VECTOR)
	StyleSourceTypeCustomMVTVector StyleSourceType = StyleSourceType(C.MLN_STYLE_SOURCE_TYPE_CUSTOM_MVT_VECTOR)
)

type StyleTileScheme

type StyleTileScheme uint32

StyleTileScheme selects tile URL coordinate scheme.

const (
	StyleTileSchemeXYZ StyleTileScheme = StyleTileScheme(C.MLN_STYLE_TILE_SCHEME_XYZ)
	StyleTileSchemeTMS StyleTileScheme = StyleTileScheme(C.MLN_STYLE_TILE_SCHEME_TMS)
)

type StyleTileSourceOptions

type StyleTileSourceOptions struct {
	MinZoom        *float64
	MaxZoom        *float64
	Attribution    *string
	Scheme         *StyleTileScheme
	Bounds         *LatLngBounds
	TileSize       *uint32
	VectorEncoding *StyleVectorTileEncoding
	RasterEncoding *StyleRasterDEMEncoding
}

StyleTileSourceOptions configures vector, raster, and raster DEM sources.

func (StyleTileSourceOptions) Equal
func (options StyleTileSourceOptions) Equal(other StyleTileSourceOptions) bool

Equal reports whether two descriptors hold the same field values.

func (StyleTileSourceOptions) WithAttribution
func (options StyleTileSourceOptions) WithAttribution(attribution string) StyleTileSourceOptions

WithAttribution returns a copy that sets source attribution.

func (StyleTileSourceOptions) WithRasterEncoding
func (options StyleTileSourceOptions) WithRasterEncoding(encoding StyleRasterDEMEncoding) StyleTileSourceOptions

WithRasterEncoding returns a copy that sets raster DEM encoding.

func (StyleTileSourceOptions) WithTileSize
func (options StyleTileSourceOptions) WithTileSize(tileSize uint32) StyleTileSourceOptions

WithTileSize returns a copy that sets raster tile size.

func (StyleTileSourceOptions) WithVectorEncoding
func (options StyleTileSourceOptions) WithVectorEncoding(encoding StyleVectorTileEncoding) StyleTileSourceOptions

WithVectorEncoding returns a copy that sets vector tile encoding.

type StyleTransitionOptions

type StyleTransitionOptions struct {
	// DurationMS is the transition duration in milliseconds. An absent value
	// falls back to the duration the style declares per property.
	DurationMS *float64
	// DelayMS is the transition delay in milliseconds. An absent value falls
	// back to the delay the style declares per property.
	DelayMS *float64
	// EnablePlacementTransitions reports whether symbol placement changes
	// cross-fade, which an absent value leaves on. Clearing it makes symbol
	// placement changes apply to the next rendered frame. Reading the options
	// always reports a value.
	EnablePlacementTransitions *bool
}

StyleTransitionOptions configures how the style animates paint property changes and whether symbol placement changes cross-fade. These are distinct from camera animation options and from the per-property transitions a style declares.

func (StyleTransitionOptions) Clone
func (options StyleTransitionOptions) Clone() StyleTransitionOptions

Clone returns an independent deep copy of this descriptor.

func (StyleTransitionOptions) Equal
func (options StyleTransitionOptions) Equal(other StyleTransitionOptions) bool

Equal reports whether two descriptors hold the same field values.

type StyleVectorTileEncoding

type StyleVectorTileEncoding uint32

StyleVectorTileEncoding selects vector tile encoding.

const (
	StyleVectorTileEncodingMVT StyleVectorTileEncoding = StyleVectorTileEncoding(C.MLN_STYLE_VECTOR_TILE_ENCODING_MVT)
	StyleVectorTileEncodingMLT StyleVectorTileEncoding = StyleVectorTileEncoding(C.MLN_STYLE_VECTOR_TILE_ENCODING_MLT)
)

type TextureImageInfo

type TextureImageInfo struct {
	Width      uint32
	Height     uint32
	Stride     uint32
	ByteLength uint64
}

TextureImageInfo describes CPU readback image metadata.

type TileID

type TileID struct {
	OverscaledZ uint32
	Wrap        int32
	CanonicalZ  uint32
	CanonicalX  uint32
	CanonicalY  uint32
}

TileID is a copied overscaled/canonical tile identifier.

type TileLODMode

type TileLODMode uint32

TileLODMode selects the native tile LOD algorithm.

const (
	TileLODModeDefault  TileLODMode = TileLODMode(C.MLN_TILE_LOD_MODE_DEFAULT)
	TileLODModeDistance TileLODMode = TileLODMode(C.MLN_TILE_LOD_MODE_DISTANCE)
)

type TileOperation

type TileOperation uint32

TileOperation identifies a tile observer operation.

const (
	TileOperationRequestedFromCache   TileOperation = TileOperation(C.MLN_TILE_OPERATION_REQUESTED_FROM_CACHE)
	TileOperationRequestedFromNetwork TileOperation = TileOperation(C.MLN_TILE_OPERATION_REQUESTED_FROM_NETWORK)
	TileOperationLoadFromNetwork      TileOperation = TileOperation(C.MLN_TILE_OPERATION_LOAD_FROM_NETWORK)
	TileOperationLoadFromCache        TileOperation = TileOperation(C.MLN_TILE_OPERATION_LOAD_FROM_CACHE)
	TileOperationStartParse           TileOperation = TileOperation(C.MLN_TILE_OPERATION_START_PARSE)
	TileOperationEndParse             TileOperation = TileOperation(C.MLN_TILE_OPERATION_END_PARSE)
	TileOperationError                TileOperation = TileOperation(C.MLN_TILE_OPERATION_ERROR)
	TileOperationCancelled            TileOperation = TileOperation(C.MLN_TILE_OPERATION_CANCELLED)
	TileOperationNull                 TileOperation = TileOperation(C.MLN_TILE_OPERATION_NULL)
)

type TileOptions

type TileOptions struct {
	PrefetchZoomDelta *uint32
	LODMinRadius      *float64
	LODScale          *float64
	LODPitchThreshold *float64
	LODZoomShift      *float64
	LODMode           *TileLODMode
}

TileOptions configures tile prefetch and LOD tuning controls.

func (TileOptions) Equal
func (options TileOptions) Equal(other TileOptions) bool

Equal reports whether two descriptors hold the same field values.

func (TileOptions) WithLODMode
func (options TileOptions) WithLODMode(value TileLODMode) TileOptions

WithLODMode returns a copy that sets tile LOD mode.

func (TileOptions) WithPrefetchZoomDelta
func (options TileOptions) WithPrefetchZoomDelta(value uint32) TileOptions

WithPrefetchZoomDelta returns a copy that sets prefetch zoom delta.

type UnitBezier

type UnitBezier struct {
	X1 float64
	Y1 float64
	X2 float64
	Y2 float64
}

UnitBezier contains cubic easing curve control points.

type Vec3

type Vec3 struct {
	X float64
	Y float64
	Z float64
}

Vec3 is a three-component vector.

type ViewportMode

type ViewportMode uint32

ViewportMode controls viewport coordinate orientation.

const (
	ViewportModeDefault  ViewportMode = ViewportMode(C.MLN_VIEWPORT_MODE_DEFAULT)
	ViewportModeFlippedY ViewportMode = ViewportMode(C.MLN_VIEWPORT_MODE_FLIPPED_Y)
)

type ViewportOptions

type ViewportOptions struct {
	NorthOrientation *NorthOrientation
	ConstrainMode    *ConstrainMode
	ViewportMode     *ViewportMode
	FrustumOffset    *EdgeInsets
}

ViewportOptions configures live viewport and render-transform controls.

func (ViewportOptions) Equal
func (options ViewportOptions) Equal(other ViewportOptions) bool

Equal reports whether two descriptors hold the same field values.

func (ViewportOptions) WithConstrainMode
func (options ViewportOptions) WithConstrainMode(value ConstrainMode) ViewportOptions

WithConstrainMode returns a copy that sets the constrain mode field.

func (ViewportOptions) WithFrustumOffset
func (options ViewportOptions) WithFrustumOffset(value EdgeInsets) ViewportOptions

WithFrustumOffset returns a copy that sets the frustum offset field.

func (ViewportOptions) WithNorthOrientation
func (options ViewportOptions) WithNorthOrientation(value NorthOrientation) ViewportOptions

WithNorthOrientation returns a copy that sets the north orientation field.

func (ViewportOptions) WithViewportMode
func (options ViewportOptions) WithViewportMode(value ViewportMode) ViewportOptions

WithViewportMode returns a copy that sets the viewport mode field.

type VulkanBorrowedTextureDescriptor

type VulkanBorrowedTextureDescriptor struct {
	Extent RenderTargetExtent
	// PhysicalWidth and PhysicalHeight are the image's size in device pixels,
	// stated rather than derived from Extent because its owner sizes it.
	PhysicalWidth  uint32
	PhysicalHeight uint32
	Context        VulkanContextDescriptor
	Image          NativePointer
	ImageView      NativePointer
	Format         uint32
	InitialLayout  uint32
	FinalLayout    uint32
}

VulkanBorrowedTextureDescriptor describes a Vulkan caller-owned texture render target. The caller keeps Image and ImageView valid until detach or session close, manages queue-family ownership, makes the image available in InitialLayout before each RenderUpdate, avoids concurrent use during the update, and observes FinalLayout after RenderUpdate returns.

type VulkanContextDescriptor

type VulkanContextDescriptor struct {
	Instance                 NativePointer
	PhysicalDevice           NativePointer
	Device                   NativePointer
	GraphicsQueue            NativePointer
	GraphicsQueueFamilyIndex uint32
	GetInstanceProcAddr      NativePointer
	GetDeviceProcAddr        NativePointer
}

VulkanContextDescriptor contains Vulkan backend context handles.

type VulkanOwnedTextureDescriptor

type VulkanOwnedTextureDescriptor struct {
	Extent  RenderTargetExtent
	Context VulkanContextDescriptor
}

VulkanOwnedTextureDescriptor describes a Vulkan session-owned texture render target. Vulkan context handles are borrowed and must remain valid until detach or session close.

type VulkanOwnedTextureFrame

type VulkanOwnedTextureFrame struct {
	// contains filtered or unexported fields
}

VulkanOwnedTextureFrame is an acquired session-owned Vulkan texture frame. Backend handles are borrowed and remain valid only while the frame is active. Close the frame on the render session owner thread before resizing, rendering, reading back, detaching, closing the session, or acquiring another frame.

func (*VulkanOwnedTextureFrame) Close
func (frame *VulkanOwnedTextureFrame) Close() error

Close releases this acquired Vulkan texture frame on the session owner thread. A second Close is a no-op after a successful release; failed releases remain retryable.

func (*VulkanOwnedTextureFrame) Device
func (frame *VulkanOwnedTextureFrame) Device() (NativePointer, error)

Device returns the borrowed Vulkan device while the frame remains live.

func (*VulkanOwnedTextureFrame) Image
func (frame *VulkanOwnedTextureFrame) Image() (NativePointer, error)

Image returns the borrowed Vulkan image while the frame remains live.

func (*VulkanOwnedTextureFrame) ImageView
func (frame *VulkanOwnedTextureFrame) ImageView() (NativePointer, error)

ImageView returns the borrowed Vulkan image view while the frame remains live.

func (*VulkanOwnedTextureFrame) WithInfo
func (frame *VulkanOwnedTextureFrame) WithInfo(fn func(VulkanOwnedTextureFrameInfo) error) error

WithInfo passes copied Vulkan frame metadata after verifying the frame is live.

type VulkanOwnedTextureFrameInfo

type VulkanOwnedTextureFrameInfo struct {
	Generation  uint64
	Width       uint32
	Height      uint32
	ScaleFactor float64
	Format      uint32
	Layout      uint32
}

VulkanOwnedTextureFrameInfo contains copied metadata for an acquired session-owned texture frame.

type VulkanSurfaceDescriptor

type VulkanSurfaceDescriptor struct {
	Extent  RenderTargetExtent
	Context VulkanContextDescriptor
	Surface NativePointer
}

VulkanSurfaceDescriptor describes a Vulkan-backed surface render target. Vulkan handles are borrowed and must remain valid until detach or session close. The device must support swapchain presentation on the graphics queue family for Surface.

type WGLContextDescriptor

type WGLContextDescriptor struct {
	DeviceContext NativePointer
	// ShareContext is the HGLRC whose share group the session context joins.
	// Required under shared ownership. A dedicated session joins no share
	// group, so it must be zero there.
	ShareContext   NativePointer
	GetProcAddress NativePointer
}

WGLContextDescriptor contains WGL context provider data for OpenGL render targets.

type WakeSource

type WakeSource struct {
	// contains filtered or unexported fields
}

WakeSource releases a runtime owner thread parked in RuntimeHandle.Pump. It is usable from any goroutine. Signalling it after its runtime closes does nothing.

func (*WakeSource) Close
func (source *WakeSource) Close()

Close releases the wake source. Later signals report a closed handle.

func (*WakeSource) Signal
func (source *WakeSource) Signal() error

Signal sets the runtime's wake flag and releases the parked owner thread. A signal raised while the owner thread runs leaves the flag set, so the next Pump returns without parking.