{"id":178,"date":"2026-03-21T22:47:21","date_gmt":"2026-03-21T14:47:21","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/nodes-location-command\/"},"modified":"2026-03-21T23:08:57","modified_gmt":"2026-03-21T15:08:57","slug":"nodes-location-command","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/nodes-location-command\/","title":{"rendered":"\u4f4d\u7f6e\u547d\u4ee4"},"content":{"rendered":"<h1>\u4f4d\u7f6e\u547d\u4ee4<\/h1>\n<h1>\u4f4d\u7f6e\u547d\u4ee4\uff08\u8282\u70b9\uff09<\/h1>\n<h2>\u7b80\u8981\u6982\u8ff0<\/h2>\n<ul>\n<li><code>location.get<\/code> \u662f\u4e00\u4e2a\u8282\u70b9\u547d\u4ee4\uff08\u901a\u8fc7 <code>node.invoke<\/code>\uff09\u3002<\/li>\n<li>\u9ed8\u8ba4\u5173\u95ed\u3002<\/li>\n<li>\u8bbe\u7f6e\u4f7f\u7528\u9009\u62e9\u5668\uff1a\u5173\u95ed \/ \u4f7f\u7528\u65f6 \/ \u59cb\u7ec8\u3002<\/li>\n<li>\u5355\u72ec\u7684\u5f00\u5173\uff1a\u7cbe\u786e\u4f4d\u7f6e\u3002<\/li>\n<\/ul>\n<h2>\u4e3a\u4ec0\u4e48\u7528\u9009\u62e9\u5668\uff08\u800c\u4e0d\u53ea\u662f\u5f00\u5173\uff09<\/h2>\n<p>\u64cd\u4f5c\u7cfb\u7edf\u6743\u9650\u662f\u591a\u7ea7\u7684\u3002\u6211\u4eec\u53ef\u4ee5\u5728\u5e94\u7528\u5185\u66b4\u9732\u9009\u62e9\u5668\uff0c\u4f46\u64cd\u4f5c\u7cfb\u7edf\u4ecd\u7136\u51b3\u5b9a\u5b9e\u9645\u6388\u6743\u3002<\/p>\n<ul>\n<li>iOS\/macOS\uff1a\u7528\u6237\u53ef\u4ee5\u5728\u7cfb\u7edf\u63d0\u793a\/\u8bbe\u7f6e\u4e2d\u9009\u62e9<strong>\u4f7f\u7528\u65f6<\/strong>\u6216<strong>\u59cb\u7ec8<\/strong>\u3002\u5e94\u7528\u53ef\u4ee5\u8bf7\u6c42\u5347\u7ea7\uff0c\u4f46\u64cd\u4f5c\u7cfb\u7edf\u53ef\u80fd\u8981\u6c42\u8fdb\u5165\u8bbe\u7f6e\u3002<\/li>\n<li>Android\uff1a\u540e\u53f0\u4f4d\u7f6e\u662f\u5355\u72ec\u7684\u6743\u9650\uff1b\u5728 Android 10+ \u4e0a\u901a\u5e38\u9700\u8981\u8fdb\u5165\u8bbe\u7f6e\u6d41\u7a0b\u3002<\/li>\n<li>\u7cbe\u786e\u4f4d\u7f6e\u662f\u5355\u72ec\u7684\u6388\u6743\uff08iOS 14+ &#8220;\u7cbe\u786e&#8221;\uff0cAndroid &#8220;\u7cbe\u7ec6&#8221; vs &#8220;\u7c97\u7565&#8221;\uff09\u3002<\/li>\n<\/ul>\n<p>UI \u4e2d\u7684\u9009\u62e9\u5668\u9a71\u52a8\u6211\u4eec\u8bf7\u6c42\u7684\u6a21\u5f0f\uff1b\u5b9e\u9645\u6388\u6743\u5b58\u5728\u4e8e\u64cd\u4f5c\u7cfb\u7edf\u8bbe\u7f6e\u4e2d\u3002<\/p>\n<h2>\u8bbe\u7f6e\u6a21\u578b<\/h2>\n<p>\u6bcf\u4e2a\u8282\u70b9\u8bbe\u5907\uff1a<\/p>\n<ul>\n<li><code>location.enabledMode<\/code>\uff1a<code>off | whileUsing | always<\/code><\/li>\n<li><code>location.preciseEnabled<\/code>\uff1abool<\/li>\n<\/ul>\n<p>UI \u884c\u4e3a\uff1a<\/p>\n<ul>\n<li>\u9009\u62e9 <code>whileUsing<\/code> \u8bf7\u6c42\u524d\u53f0\u6743\u9650\u3002<\/li>\n<li>\u9009\u62e9 <code>always<\/code> \u9996\u5148\u786e\u4fdd <code>whileUsing<\/code>\uff0c\u7136\u540e\u8bf7\u6c42\u540e\u53f0\uff08\u6216\u5728\u9700\u8981\u65f6\u5c06\u7528\u6237\u5f15\u5bfc\u5230\u8bbe\u7f6e\uff09\u3002<\/li>\n<li>\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u62d2\u7edd\u8bf7\u6c42\u7684\u7ea7\u522b\uff0c\u56de\u9000\u5230\u5df2\u6388\u4e88\u7684\u6700\u9ad8\u7ea7\u522b\u5e76\u663e\u793a\u72b6\u6001\u3002<\/li>\n<\/ul>\n<h2>\u6743\u9650\u6620\u5c04\uff08node.permissions\uff09<\/h2>\n<p>\u53ef\u9009\u3002macOS \u8282\u70b9\u901a\u8fc7\u6743\u9650\u6620\u5c04\u62a5\u544a <code>location<\/code>\uff1biOS\/Android \u53ef\u80fd\u7701\u7565\u5b83\u3002<\/p>\n<h2>\u547d\u4ee4\uff1a<code>location.get<\/code><\/h2>\n<p>\u901a\u8fc7 <code>node.invoke<\/code> \u8c03\u7528\u3002<\/p>\n<p>\u53c2\u6570\uff08\u5efa\u8bae\uff09\uff1a<\/p>\n<p>&#8220;`json  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{<br \/>\n  &#8220;timeoutMs&#8221;: 10000,<br \/>\n  &#8220;maxAgeMs&#8221;: 15000,<br \/>\n  &#8220;desiredAccuracy&#8221;: &#8220;coarse|balanced|precise&#8221;<br \/>\n}<\/p>\n<pre><code>\n\u54cd\u5e94\u8d1f\u8f7d\uff1a\n\n```json  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n{\n  &quot;lat&quot;: 48.20849,\n  &quot;lon&quot;: 16.37208,\n  &quot;accuracyMeters&quot;: 12.5,\n  &quot;altitudeMeters&quot;: 182.0,\n  &quot;speedMps&quot;: 0.0,\n  &quot;headingDeg&quot;: 270.0,\n  &quot;timestamp&quot;: &quot;2026-01-03T12:34:56.000Z&quot;,\n  &quot;isPrecise&quot;: true,\n  &quot;source&quot;: &quot;gps|wifi|cell|unknown&quot;\n}\n<\/code><\/pre>\n<p>\u9519\u8bef\uff08\u7a33\u5b9a\u4ee3\u7801\uff09\uff1a<\/p>\n<ul>\n<li><code>LOCATION_DISABLED<\/code>\uff1a\u9009\u62e9\u5668\u5df2\u5173\u95ed\u3002<\/li>\n<li><code>LOCATION_PERMISSION_REQUIRED<\/code>\uff1a\u7f3a\u5c11\u8bf7\u6c42\u6a21\u5f0f\u7684\u6743\u9650\u3002<\/li>\n<li><code>LOCATION_BACKGROUND_UNAVAILABLE<\/code>\uff1a\u5e94\u7528\u5728\u540e\u53f0\u4f46\u53ea\u5141\u8bb8\u4f7f\u7528\u65f6\u3002<\/li>\n<li><code>LOCATION_TIMEOUT<\/code>\uff1a\u5728\u65f6\u95f4\u5185\u6ca1\u6709\u5b9a\u4f4d\u3002<\/li>\n<li><code>LOCATION_UNAVAILABLE<\/code>\uff1a\u7cfb\u7edf\u6545\u969c\/\u6ca1\u6709\u63d0\u4f9b\u5546\u3002<\/li>\n<\/ul>\n<h2>\u540e\u53f0\u884c\u4e3a\uff08\u672a\u6765\uff09<\/h2>\n<p>\u76ee\u6807\uff1a\u6a21\u578b\u53ef\u4ee5\u5728\u8282\u70b9\u5904\u4e8e\u540e\u53f0\u65f6\u8bf7\u6c42\u4f4d\u7f6e\uff0c\u4f46\u4ec5\u5f53\uff1a<\/p>\n<ul>\n<li>\u7528\u6237\u9009\u62e9\u4e86<strong>\u59cb\u7ec8<\/strong>\u3002<\/li>\n<li>\u64cd\u4f5c\u7cfb\u7edf\u6388\u4e88\u540e\u53f0\u4f4d\u7f6e\u6743\u9650\u3002<\/li>\n<li>\u5e94\u7528\u88ab\u5141\u8bb8\u5728\u540e\u53f0\u8fd0\u884c\u4ee5\u83b7\u53d6\u4f4d\u7f6e\uff08iOS \u540e\u53f0\u6a21\u5f0f\/Android \u524d\u53f0\u670d\u52a1\u6216\u7279\u6b8a\u8bb8\u53ef\uff09\u3002<\/li>\n<\/ul>\n<p>\u63a8\u9001\u89e6\u53d1\u6d41\u7a0b\uff08\u672a\u6765\uff09\uff1a<\/p>\n<ol>\n<li>Gateway \u7f51\u5173\u5411\u8282\u70b9\u53d1\u9001\u63a8\u9001\uff08\u9759\u9ed8\u63a8\u9001\u6216 FCM \u6570\u636e\uff09\u3002<\/li>\n<li>\u8282\u70b9\u77ed\u6682\u5524\u9192\u5e76\u4ece\u8bbe\u5907\u8bf7\u6c42\u4f4d\u7f6e\u3002<\/li>\n<li>\u8282\u70b9\u5c06\u8d1f\u8f7d\u8f6c\u53d1\u7ed9 Gateway \u7f51\u5173\u3002<\/li>\n<\/ol>\n<p>\u8bf4\u660e\uff1a<\/p>\n<ul>\n<li>iOS\uff1a\u9700\u8981\u59cb\u7ec8\u6743\u9650 + \u540e\u53f0\u4f4d\u7f6e\u6a21\u5f0f\u3002\u9759\u9ed8\u63a8\u9001\u53ef\u80fd\u88ab\u9650\u6d41\uff1b\u9884\u671f\u4f1a\u6709\u95f4\u6b47\u6027\u5931\u8d25\u3002<\/li>\n<li>Android\uff1a\u540e\u53f0\u4f4d\u7f6e\u53ef\u80fd\u9700\u8981\u524d\u53f0\u670d\u52a1\uff1b\u5426\u5219\u9884\u671f\u4f1a\u88ab\u62d2\u7edd\u3002<\/li>\n<\/ul>\n<h2>\u6a21\u578b\/\u5de5\u5177\u96c6\u6210<\/h2>\n<ul>\n<li>\u5de5\u5177\u63a5\u53e3\uff1a<code>nodes<\/code> \u5de5\u5177\u6dfb\u52a0 <code>location_get<\/code> \u64cd\u4f5c\uff08\u9700\u8981\u8282\u70b9\uff09\u3002<\/li>\n<li>CLI\uff1a<code>openclaw nodes location get --node &lt;id&gt;<\/code>\u3002<\/li>\n<li>\u667a\u80fd\u4f53\u6307\u5357\uff1a\u4ec5\u5728\u7528\u6237\u542f\u7528\u4f4d\u7f6e\u5e76\u7406\u89e3\u8303\u56f4\u65f6\u8c03\u7528\u3002<\/li>\n<\/ul>\n<h2>UX \u6587\u6848\uff08\u5efa\u8bae\uff09<\/h2>\n<ul>\n<li>\u5173\u95ed\uff1a&#8221;\u4f4d\u7f6e\u5171\u4eab\u5df2\u7981\u7528\u3002&#8221;<\/li>\n<li>\u4f7f\u7528\u65f6\uff1a&#8221;\u4ec5\u5f53 OpenClaw \u6253\u5f00\u65f6\u3002&#8221;<\/li>\n<li>\u59cb\u7ec8\uff1a&#8221;\u5141\u8bb8\u540e\u53f0\u4f4d\u7f6e\u3002\u9700\u8981\u7cfb\u7edf\u6743\u9650\u3002&#8221;<\/li>\n<li>\u7cbe\u786e\uff1a&#8221;\u4f7f\u7528\u7cbe\u786e GPS \u4f4d\u7f6e\u3002\u5173\u95ed\u4ee5\u5171\u4eab\u5927\u81f4\u4f4d\u7f6e\u3002&#8221;<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4f4d\u7f6e\u547d\u4ee4 \u4f4d\u7f6e\u547d\u4ee4\uff08\u8282\u70b9\uff09 \u7b80\u8981\u6982\u8ff0 location.get \u662f\u4e00\u4e2a\u8282\u70b9\u547d\u4ee4\uff08\u901a\u8fc7 node.invoke\uff09 [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-178","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=178"}],"version-history":[{"count":1,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/178\/revisions"}],"predecessor-version":[{"id":473,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/178\/revisions\/473"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}