geolocation

package
v0.10.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetProvider

func SetProvider(p Provider)

Types

type Position

type Position struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	Accuracy  float64 `json:"accuracy,omitempty"`
}

func GetCurrentPosition

func GetCurrentPosition(opts PositionOptions) (*Position, error)

type PositionOptions

type PositionOptions struct {
	EnableHighAccuracy bool `json:"enableHighAccuracy,omitempty"`
	Timeout            int  `json:"timeout,omitempty"`    // ms
	MaximumAge         int  `json:"maximumAge,omitempty"` // ms
}

type Provider

type Provider interface {
	GetCurrentPosition(opts PositionOptions) (*Position, error)
}

Provider is a native geolocation backend. On mobile the shell registers one via SetProvider (FusedLocationProvider / CLLocationManager); on desktop the built-in platform implementation is used when no provider is set.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL