new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Tauri · Plugins and security · all subjects

geolocation/api

4 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Geolocation JavaScript API functions

The geolocation plugin provides the following JavaScript functions: checkPermissions(), requestPermissions(), getCurrentPosition(), and watchPosition().

Geolocation API usage example

import { checkPermissions, requestPermissions, getCurrentPosition, watchPosition } from '@tauri-apps/plugin-geolocation'; let permissions = await checkPermissions(); if (permissions.location === 'prompt' || permissions.location === 'prompt-with-rationale') { permissions = await requestPermissions(['location']); } if (permissions.location === 'granted') { const pos = await getCurrentPosition(); await watchPosition({ enableHighAccuracy: true, timeout: 10000, maximumAge: 0 }, (pos) => { console.log(pos); }); }

Geolocation watchPosition options

The watchPosition() function accepts an options object with the following properties: enableHighAccuracy (boolean), timeout (number in milliseconds), and maximumAge (number in milliseconds).

Geolocation permission status values

The permissions object returned by checkPermissions() and requestPermissions() has a location property that can have the values: 'prompt', 'prompt-with-rationale', or 'granted'.

Give your agent this brain