places

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package places is a native module of views: a map of the platform shown in native UI, and the system's share menu, anchored to what the window shows. Its implementation is the Swift package in swift/, with MapKit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map interface {
	native.View
	// Show centers the map on a place, span degrees across.
	Show(p Place, span float64)
	// Center returns the place at the center of the map.
	Center() Place
	// Pin puts a pin at p, titled with text and its language, which a of
	// the native module language tells: the platform calls that module's
	// object itself.
	Pin(p Place, a language.Analyzer, text string)
	// OnMove calls f with the center of the map once the user moved it,
	// until the subscription is closed.
	OnMove(f func(center Place)) io.Closer
}

Map shows a map, which ui.NativeView places in a window of native UI.

func NewMap

func NewMap() (Map, error)

NewMap makes the implementation of Map on this platform. It returns errors.ErrUnsupported where the module has none, or the system lacks what it needs.

type Place

type Place struct {
	Latitude, Longitude float64
}

Place is a point on Earth.

type Sharing

type Sharing interface {
	// Share shows the share menu for text, from rect of win.
	Share(win *mygo.Window, rect ui.Rect, text string)
	// ShareFrom shows the share menu for text, from a view of a module.
	ShareFrom(view native.View, text string)
}

Sharing shows the system's share menu.

func NewSharing

func NewSharing() (Sharing, error)

NewSharing makes the implementation of Sharing on this platform. It returns errors.ErrUnsupported where the module has none, or the system lacks what it needs.

Jump to

Keyboard shortcuts

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