Token导航 LogoToken导航TokenDH.com
研究检索权限需确认github未标认证来源可访问许可证需确认审计通过

maui-geolocation毛伊岛地理定位

Agent Skill

maui-geolocation 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

445

周安装

18

GitHub Stars

129

下载量

140
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:maui-geolocation(毛伊岛地理定位)
来源仓库:https://github.com/davidortinau/maui-skills
仓库路径:skills/maui-geolocation
安装命令:
npx skills add https://github.com/davidortinau/maui-skills --skill maui-geolocation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/davidortinau/maui-skills --skill maui-geolocation

简介

用于查找、检索和筛选相关信息。maui-geolocation 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

  • 适合在关键词搜索或任务场景下快速定位候选结果。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装前建议确认权限范围和是否会触发文件读写。
  • 维护状态不明时需人工复核功能稳定性。

SKILL.md

.NET MAUI Geolocation

Critical: Always Pass a CancellationToken

GetLocationAsync can hang indefinitely if GPS is off, the device is indoors, or permissions are in a pending state. Always set a timeout.

// ❌ Hangs forever if no GPS fix is available
var location = await Geolocation.Default.GetLocationAsync(
    new GeolocationRequest(GeolocationAccuracy.High));

// ✅ Times out after 30 seconds
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
var location = await Geolocation.Default.GetLocationAsync(
    new GeolocationRequest(GeolocationAccuracy.High), cts.Token);

Accuracy vs. Battery Trade-off

Use the lowest accuracy that satisfies your feature. Higher accuracy drains battery significantly faster — especially on Android.

Use caseRecommended accuracy
City-level / weatherLowest or Low
Nearby search / store finderMedium
Turn-by-turn navigationHigh or Best

Platform Gotchas

iOS 14 reduced accuracy

Users can grant "approximate" location (accuracy > 1 km). Your app receives a location, but it may be useless for precision features.

  • Check location.Accuracy — values > 100 m likely indicate reduced precision.
  • Use GeolocationRequest.RequestFullAccuracy with a key matching NSLocationTemporaryUsageDescriptionDictionary in Info.plist to prompt for full accuracy.

Android: mock locations in security-sensitive flows

// ⚠️ Always check in security-sensitive flows (e.g., geofence, check-in)
if (location.IsFromMockProvider)
{
    // Reject — user is spoofing location
}

Android: Altitude 0.0 is not sea level

Some Android devices return 0.0 for Altitude when the GPS has no barometric sensor. Treat 0.0 as "unknown", not sea level.

Android 10+: background location requires separate permission

ACCESS_BACKGROUND_LOCATION must be requested separately from foreground permissions and triggers a distinct system dialog. Requesting it together with foreground permissions causes both to be denied on some devices.

GetLastKnownLocationAsync returns null

This is expected on first boot or after a location-data reset. Always fall back to GetLocationAsync:

// ✅ Cache-first with fresh fallback
var location = await geolocation.GetLastKnownLocationAsync();
if (location is null || location.Timestamp < DateTimeOffset.UtcNow.AddMinutes(-5))
{
    location = await geolocation.GetLocationAsync(
        new GeolocationRequest(GeolocationAccuracy.Medium, TimeSpan.FromSeconds(10)), ct);
}

Permissions must be requested before any geolocation call

Call Permissions.RequestAsync<Permissions.LocationWhenInUse>() first, or catch PermissionException. Calling GetLocationAsync without permission throws on some platforms and returns null on others — inconsistent behaviour across platforms.


Continuous Listening: Don't Forget to Unsubscribe

Failing to remove the LocationChanged handler when stopping causes continued GPS usage and battery drain.

// ❌ Forgetting to unsubscribe — GPS stays active
public void StopTracking()
{
    Geolocation.Default.StopListeningForeground();
    // LocationChanged handler still fires!
}

// ✅ Always remove the event handler
public void StopTracking()
{
    Geolocation.Default.StopListeningForeground();
    Geolocation.Default.LocationChanged -= OnLocationChanged;
}

Checklist

  • CancellationToken passed to every GetLocationAsync call
  • Accuracy level matched to feature need (not blindly set to Best)
  • GetLastKnownLocationAsync null-check with GetLocationAsync fallback
  • Runtime permissions requested before first geolocation call
  • LocationChanged handler removed when stopping continuous listening
  • Android: ACCESS_BACKGROUND_LOCATION requested separately (if needed)
  • iOS: NSLocationTemporaryUsageDescriptionDictionary added for full-accuracy prompt
  • Android: IsFromMockProvider checked in security-sensitive flows

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.68%
按下载量换算50

Claude

28.75%
按下载量换算40

Cursor

19.31%
按下载量换算27

Gemini CLI

7.82%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills