{"id":9445,"date":"2022-11-07T13:57:02","date_gmt":"2022-11-07T05:57:02","guid":{"rendered":"https:\/\/www.yimenapp.com\/kb-yimen\/?p=9445"},"modified":"2022-11-07T13:57:02","modified_gmt":"2022-11-07T05:57:02","slug":"getcurrentposition-%e8%8e%b7%e5%8f%96%e5%bd%93%e5%89%8d%e4%bd%8d%e7%bd%ae-app%e6%8e%a5%e5%85%a5%e9%ab%98%e5%be%b7%e5%ae%9a%e4%bd%8d-app%e5%bc%80%e5%8f%91%e5%ae%9a%e4%bd%8d%e8%83%bd%e5%8a%9b","status":"publish","type":"post","link":"https:\/\/www.yimenapp.com\/kb-yimen\/9445\/","title":{"rendered":"getCurrentPosition\u00a0\u83b7\u53d6\u5f53\u524d\u4f4d\u7f6e APP\u63a5\u5165\u9ad8\u5fb7\u5b9a\u4f4d APP\u5f00\u53d1\u5b9a\u4f4d\u80fd\u529b"},"content":{"rendered":"\n<figure id=\"pid16585\" class=\"wp-block-table\"><table><tbody><tr><td>\u7528\u505a\u7f51\u9875\u7684\u6280\u672f\u505a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.yimenapp.com\/\" target=\"_blank\">APP<\/a>\uff01<br><span class=\"wpcom_keyword_link\"><a href=\"https:\/\/www.yimenapp.com\" title=\"\u5f00\u53d1APP\u4ece\u4e00\u95e8\u5f00\u59cb\">\u4e00\u95e8<\/a><\/span>\u63d0\u4f9b\u6807\u51c6\u5316\u7684<strong>jsbridge-mini.js\u5e93<\/strong>\uff0c\u60a8\u53ea\u9700\u8981\u5728\u9875\u9762<strong>\u5f15\u7528<\/strong>\u5e76<strong>\u6267\u884c<\/strong>JS\u5373\u53ef\u5b9e\u73b0\u5404\u79cd<strong>\u539f\u751fAPP\u3001\u539f\u751fPC<\/strong>\u7684\u529f\u80fd\u80fd\u529b\u3002<br><br><strong>==================APP\u7aef==================<\/strong><br><strong>\u3010APP\u7aef\u3011\uff08\u5b89\u5353\u7248&amp;\u82f9\u679c\u7248\uff09<\/strong>\u76ee\u524d\u63d0\u4f9b200+\u539f\u751f\u529f\u80fd\uff0c2000+JS\u6620\u5c04\u63a5\u53e3\uff0c\u7528\u505a\u7f51\u7ad9\u7684\u6280\u672f\u5373\u53ef\u5b9e\u73b0\u5404\u79cd\u539f\u751fAPP\u80fd\u529b\u3001APP demo\u5730\u5740<a rel=\"noreferrer noopener\" href=\"https:\/\/www.yimenapp.com\/doc\/demo.cshtml\" target=\"_blank\">https:\/\/www.yimenapp.com\/doc\/demo.cshtml<\/a>\u4e0b\u8f7d\u6559\u7a0b\uff1a<br>\u2666\u00a0<strong>JS-SDK<\/strong>\u00a0\u5f15\u7528\u65b9\u5f0f\uff1a<br>\u2666 \u666e\u901a\u7f51\u9875 script \u65b9\u5f0f\u52a0\u8f7d\uff1a\u4e0b\u8f7d\u6700\u65b0\u7248\uff0c\u8bf7\u5728\u9875\u9762\u4e0a\u8c03\u7528 jsBridge \u63a5\u53e3\u4e4b\u524d\u5f15\u7528 jsbridge-mini.js \u5e93\uff1b<br>\u2666 js module \u65b9\u5f0f\u5f15\u7528\uff1anpm install ym-jsbridge\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/www.npmjs.com\/package\/ym-jsbridge\" target=\"_blank\">\u5177\u4f53\u8bf7\u53c2\u8003 npm package<\/a><\/td><\/tr><\/tbody><\/table><figcaption>\u4e00\u95e8APP\u5f00\u53d1\u5e73\u53f0\u901a\u7528JS<\/figcaption><\/figure>\n\n\n\n<p><span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/getcurrentposition\/\" title=\"getCurrentPosition\" target=\"_blank\">getCurrentPosition<\/a><\/span>\u00a0\u83b7\u53d6\u5f53\u524d\u4f4d\u7f6e <span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/app%e6%8e%a5%e5%85%a5%e9%ab%98%e5%be%b7%e5%ae%9a%e4%bd%8d\/\" title=\"APP\u63a5\u5165\u9ad8\u5fb7\u5b9a\u4f4d\" target=\"_blank\">APP\u63a5\u5165\u9ad8\u5fb7\u5b9a\u4f4d<\/a><\/span> <span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/app%e5%bc%80%e5%8f%91%e5%ae%9a%e4%bd%8d\/\" title=\"APP\u5f00\u53d1\u5b9a\u4f4d\" target=\"_blank\">APP\u5f00\u53d1\u5b9a\u4f4d<\/a><\/span>\u80fd\u529b<\/p>\n\n\n\n<p>\u5355\u6b21<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e5%ae%9a%e4%bd%8d\/\" title=\"\u5b9a\u4f4d\" target=\"_blank\">\u5b9a\u4f4d<\/a><\/span>\uff0c\u56fd\u5185\u8fd4\u56de<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e9%ab%98%e5%be%b7\/\" title=\"\u9ad8\u5fb7\" target=\"_blank\">\u9ad8\u5fb7<\/a><\/span>\u5750\u6807\u7cfb\uff0c\u53ef\u4ee5\u76f4\u63a5\u6807\u8bb0\u5728\u9ad8\u5fb7\u5730\u56fe\u4e0a\uff0c\u6d77\u5916\u8fd4\u56deGPS\u5750\u6807\u3002<\/p>\n\n\n\n<p>\u6838\u5fc3\u4ee3\u7801\u793a\u4f8b\uff0c\u8be6\u60c5\u53c2\u9605demo<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>$(&quot;#cnt&quot;).hide();\nvar result = $(&quot;#result&quot;).text(&quot;\u5b9a\u4f4d\u4e2d...&quot;);    \n$(&#39;html,body&#39;).animate({scrollTop: $(&#39;#view&#39;).offset().top}, 1200);\n\n\/\/\u53d1\u8d77\u5b9a\u4f4d\u5355\u6b21\u5b9a\u4f4d(watch \u4e3a false)\njsBridge.amapLoc.getCurrentPosition({\n  \/\/\u53ef\u9009\uff0c\u5b9a\u4f4d\u8d85\u65f6\u65f6\u95f4(\u79d2)\uff0c\u9ed8\u8ba430\u79d2\uff0c\u5efa\u8bae\u8bbe\u7f6e\u4e3a 8 - 30 \u4e4b\u95f4\n  timeout: 30,\n  \/\/\u53ef\u9009\uff0c\u6570\u5b57\u7c7b\u578b\uff0c\u5b9a\u4f4d\u6a21\u5f0f\uff0c\u9ed8\u8ba4 1\n  \/\/1 \u9ad8\u7cbe\u5ea6\u5b9a\u4f4d\u6a21\u5f0f\uff1a\u540c\u65f6\u4f7f\u7528\u7f51\u7edc\u5b9a\u4f4d\u548cGPS\u5b9a\u4f4d,\u4f18\u5148\u8fd4\u56de\u7cbe\u5ea6\u9ad8\u7684\u5b9a\u4f4d\n  \/\/2 \u4ec5\u8bbe\u5907\u5b9a\u4f4d\u6a21\u5f0f\uff1a\u53ea\u4f7f\u7528GPS\u5b9a\u4f4d\n  \/\/3 \u4f4e\u529f\u8017\u5b9a\u4f4d\u6a21\u5f0f\uff1a\u53ea\u4f7f\u7528\u7f51\u7edc\u5b9a\u4f4d\n  locationMode: 1,\n  \/\/\u53ef\u9009, \u8fde\u7eed\u5b9a\u4f4d, \u9ed8\u8ba4 false\n  \/\/\u8c03\u7528 jsBridge.amapLoc.stop() \u505c\u6b62\u5b9a\u4f4d\n  watch : false,\n  \/\/\u53ef\u9009\uff0c\u8fde\u7eed\u5b9a\u4f4d\u65f6\u95f4\u95f4\u9694(\u79d2)\uff0c\u6700\u4f4e1\u79d2\uff0c\u9ed8\u8ba41\n  watchInterval: 1,\n  \/\/\u53ef\u9009\uff0c\u5e03\u5c14\u7c7b\u578b\uff0c true = \u4e0d\u9700\u8981\u5730\u5740\u4fe1\u606f\uff0c\u9ed8\u8ba4 false (\u9700\u8981)\n  \/\/\u4e0d\u9700\u8981\u5730\u5740\u4fe1\u606f\u65f6\u7684\u5b9a\u4f4d\u901f\u5ea6\u66f4\u5feb\uff0c\u6d88\u8017\u66f4\u5c11\u7684\u6d41\u91cf\n  notAddress   : false,\n  \/\/\u53ef\u9009\uff0c\u8fde\u7eed\u5b9a\u4f4d\u901a\u77e5\u680f\u6807\u9898\uff0c\u9ed8\u8ba4\u4e3a\u5e94\u7528\u540d\u79f0\n  notifyTitle  : &quot;&quot;,\n  \/\/\u53ef\u9009\uff0c\u8fde\u7eed\u5b9a\u4f4d\u901a\u77e5\u680f\u5185\u5bb9\n  notifyContent: &quot;\u6301\u7eed\u5b9a\u4f4d\u4e2d...&quot;\n}, function(succ, data) {\n  result.JSONView({\n    succ: succ,\n    data: data\n  });\n});\n\n\/\/\u793a\u4f8b\u5b9a\u4f4d\u7ed3\u679c\uff08\u6a21\u62df\u6570\u636e\uff09\uff1a\nvar sample = \n{\n  success: true,\n  \/\/\u7ecf\u5ea6\n  longitude: 104.04725,\n  \/\/\u7eac\u5ea6\n  latitude: 30.542618,\n  \/\/\u6d77\u62d4\u9ad8\u5ea6\n  altitude: 0,\n  \/\/\u901f\u5ea6\n  speed: 0,\n  \/\/\u65b9\u5411\u89d2\n  bearing: 0,\n  \/\/\u5b9a\u4f4d\u7cbe\u5ea6\uff08\u7c73\uff09\n  accuracy: 29,\n  \/\/\u5ba4\u5185\u5b9a\u4f4d\u65f6\u7684\u5efa\u7b51\u7269\u7f16\u53f7\n  buildingId: &quot;B0G21Y6JXO&quot;,\n  \/\/\u5ba4\u5185\u5b9a\u4f4d\u65f6\u7684\u697c\u5c42\n  floor: &quot;&quot;,\n  \/\/\u5730\u5740\n  address: &quot;\u56db\u5ddd\u7701\u6210\u90fd\u5e02\u6b66\u4faf\u533a\u5929\u5e9c\u56db\u8857962\u53f7\u9760\u8fd1\u4f73\u5e74\u534e\u00b7\u65f6\u4ee3\u6676\u5ea7&quot;,\n  \/\/\u8857\u9053\n  street: &quot;\u5929\u5e9c\u56db\u8857&quot;,\n  \/\/\u95e8\u724c\u53f7\n  streetNumber: &quot;962\u53f7&quot;,\n  \/\/\u533a\u53bf\n  district: &quot;\u6b66\u4faf\u533a&quot;,\n  \/\/\u5e02\n  city: &quot;\u6210\u90fd\u5e02&quot;,\n  \/\/\u7701\n  province: &quot;\u56db\u5ddd\u7701&quot;,\n  \/\/\u56fd\u5bb6\n  country: &quot;\u4e2d\u56fd&quot;,\n  \/\/\u57ce\u5e02\u7f16\u7801\n  cityCode: &quot;028&quot;,\n  \/\/\u5730\u533a\u7f16\u7801\n  adCode: &quot;510107&quot;,\n  \/\/\u5b9a\u4f4d\u7c7b\u578b\uff0c\u53c2\u89c1 https:\/\/lbs.amap.com\/api\/android-location-sdk\/guide\/utilities\/location-type\/\n  locationType: 5,\n  \/\/poi\u540d\u79f0\n  poiName: &quot;\u4f73\u5e74\u534e\u00b7\u65f6\u4ee3\u6676\u5ea7&quot;,\n  \/\/aoi\u540d\u79f0\n  aoiName: &quot;\u4f73\u5e74\u534e\u00b7\u65f6\u4ee3\u6676\u5ea7&quot;,\n  \/\/GPS\u4fe1\u53f7\u72b6\u6001\n  gpsAccuracyStatus: &quot;GPS_ACCURACY_UNKNOWN&quot;,\n  locationDetail: &quot;#id:ELA==#csid:901652def094468ab9852bf21112d2fb&quot;\n}<\/code><\/pre><\/div>\n\n\n\n<p>A\u6807\u7b7e\u6267\u884cJS\u793a\u4f8b\u4ee3\u7801<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;zhixing()&quot;&gt;\u6267\u884c&lt;\/a&gt; \n&lt;!-- \u5199\u5165\u4e00\u4e2aA\u6807\u7b7ehref\u503c\u4e3a&quot;javascript:void(0)&quot;\uff0c\u5b9a\u4e49\u70b9\u51fb\u4e8b\u4ef6onclick\uff1b--&gt;\n&lt;script src=&quot;\u60a8\u7684\u670d\u52a1\u5668URL\/jsbridge-mini.js&quot;&gt;&lt;\/script&gt;\n&lt;!-- \u5728\u60a8\u7684\u670d\u52a1\u5668\u5f15\u5165\u4e00\u95e8JS\u5730\u5740\uff0c\u8bf7\u4e0b\u8f7djsbridge-mini.js\u4e0a\u4f20\u60a8\u81ea\u5df1\u7684\u670d\u52a1\u5668\u83b7\u53d6\u94fe\u63a5\uff1b--&gt;\n&lt;script type=&quot;text\/javascript&quot;&gt;\nfunction zhixing() {\n\n\n&lt;!--\u8fd9\u91cc\u53ef\u4ee5\u76f4\u63a5\u590d\u5236JS\u6838\u5fc3\u4ee3\u7801\u5230\u6b64{}\u62ec\u53f7\u5185--&gt;\n$(&quot;#cnt&quot;).hide();\nvar result = $(&quot;#result&quot;).text(&quot;\u5b9a\u4f4d\u4e2d...&quot;);    \n$(&#39;html,body&#39;).animate({scrollTop: $(&#39;#view&#39;).offset().top}, 1200);\n\n\/\/\u53d1\u8d77\u5b9a\u4f4d\u5355\u6b21\u5b9a\u4f4d(watch \u4e3a false)\njsBridge.amapLoc.getCurrentPosition({\n  \/\/\u53ef\u9009\uff0c\u5b9a\u4f4d\u8d85\u65f6\u65f6\u95f4(\u79d2)\uff0c\u9ed8\u8ba430\u79d2\uff0c\u5efa\u8bae\u8bbe\u7f6e\u4e3a 8 - 30 \u4e4b\u95f4\n  timeout: 30,\n  \/\/\u53ef\u9009\uff0c\u6570\u5b57\u7c7b\u578b\uff0c\u5b9a\u4f4d\u6a21\u5f0f\uff0c\u9ed8\u8ba4 1\n  \/\/1 \u9ad8\u7cbe\u5ea6\u5b9a\u4f4d\u6a21\u5f0f\uff1a\u540c\u65f6\u4f7f\u7528\u7f51\u7edc\u5b9a\u4f4d\u548cGPS\u5b9a\u4f4d,\u4f18\u5148\u8fd4\u56de\u7cbe\u5ea6\u9ad8\u7684\u5b9a\u4f4d\n  \/\/2 \u4ec5\u8bbe\u5907\u5b9a\u4f4d\u6a21\u5f0f\uff1a\u53ea\u4f7f\u7528GPS\u5b9a\u4f4d\n  \/\/3 \u4f4e\u529f\u8017\u5b9a\u4f4d\u6a21\u5f0f\uff1a\u53ea\u4f7f\u7528\u7f51\u7edc\u5b9a\u4f4d\n  locationMode: 1,\n  \/\/\u53ef\u9009, \u8fde\u7eed\u5b9a\u4f4d, \u9ed8\u8ba4 false\n  \/\/\u8c03\u7528 jsBridge.amapLoc.stop() \u505c\u6b62\u5b9a\u4f4d\n  watch : false,\n  \/\/\u53ef\u9009\uff0c\u8fde\u7eed\u5b9a\u4f4d\u65f6\u95f4\u95f4\u9694(\u79d2)\uff0c\u6700\u4f4e1\u79d2\uff0c\u9ed8\u8ba41\n  watchInterval: 1,\n  \/\/\u53ef\u9009\uff0c\u5e03\u5c14\u7c7b\u578b\uff0c true = \u4e0d\u9700\u8981\u5730\u5740\u4fe1\u606f\uff0c\u9ed8\u8ba4 false (\u9700\u8981)\n  \/\/\u4e0d\u9700\u8981\u5730\u5740\u4fe1\u606f\u65f6\u7684\u5b9a\u4f4d\u901f\u5ea6\u66f4\u5feb\uff0c\u6d88\u8017\u66f4\u5c11\u7684\u6d41\u91cf\n  notAddress   : false,\n  \/\/\u53ef\u9009\uff0c\u8fde\u7eed\u5b9a\u4f4d\u901a\u77e5\u680f\u6807\u9898\uff0c\u9ed8\u8ba4\u4e3a\u5e94\u7528\u540d\u79f0\n  notifyTitle  : &quot;&quot;,\n  \/\/\u53ef\u9009\uff0c\u8fde\u7eed\u5b9a\u4f4d\u901a\u77e5\u680f\u5185\u5bb9\n  notifyContent: &quot;\u6301\u7eed\u5b9a\u4f4d\u4e2d...&quot;\n}, function(succ, data) {\n  result.JSONView({\n    succ: succ,\n    data: data\n  });\n});\n\n\/\/\u793a\u4f8b\u5b9a\u4f4d\u7ed3\u679c\uff08\u6a21\u62df\u6570\u636e\uff09\uff1a\nvar sample = \n{\n  success: true,\n  \/\/\u7ecf\u5ea6\n  longitude: 104.04725,\n  \/\/\u7eac\u5ea6\n  latitude: 30.542618,\n  \/\/\u6d77\u62d4\u9ad8\u5ea6\n  altitude: 0,\n  \/\/\u901f\u5ea6\n  speed: 0,\n  \/\/\u65b9\u5411\u89d2\n  bearing: 0,\n  \/\/\u5b9a\u4f4d\u7cbe\u5ea6\uff08\u7c73\uff09\n  accuracy: 29,\n  \/\/\u5ba4\u5185\u5b9a\u4f4d\u65f6\u7684\u5efa\u7b51\u7269\u7f16\u53f7\n  buildingId: &quot;B0G21Y6JXO&quot;,\n  \/\/\u5ba4\u5185\u5b9a\u4f4d\u65f6\u7684\u697c\u5c42\n  floor: &quot;&quot;,\n  \/\/\u5730\u5740\n  address: &quot;\u56db\u5ddd\u7701\u6210\u90fd\u5e02\u6b66\u4faf\u533a\u5929\u5e9c\u56db\u8857962\u53f7\u9760\u8fd1\u4f73\u5e74\u534e\u00b7\u65f6\u4ee3\u6676\u5ea7&quot;,\n  \/\/\u8857\u9053\n  street: &quot;\u5929\u5e9c\u56db\u8857&quot;,\n  \/\/\u95e8\u724c\u53f7\n  streetNumber: &quot;962\u53f7&quot;,\n  \/\/\u533a\u53bf\n  district: &quot;\u6b66\u4faf\u533a&quot;,\n  \/\/\u5e02\n  city: &quot;\u6210\u90fd\u5e02&quot;,\n  \/\/\u7701\n  province: &quot;\u56db\u5ddd\u7701&quot;,\n  \/\/\u56fd\u5bb6\n  country: &quot;\u4e2d\u56fd&quot;,\n  \/\/\u57ce\u5e02\u7f16\u7801\n  cityCode: &quot;028&quot;,\n  \/\/\u5730\u533a\u7f16\u7801\n  adCode: &quot;510107&quot;,\n  \/\/\u5b9a\u4f4d\u7c7b\u578b\uff0c\u53c2\u89c1 https:\/\/lbs.amap.com\/api\/android-location-sdk\/guide\/utilities\/location-type\/\n  locationType: 5,\n  \/\/poi\u540d\u79f0\n  poiName: &quot;\u4f73\u5e74\u534e\u00b7\u65f6\u4ee3\u6676\u5ea7&quot;,\n  \/\/aoi\u540d\u79f0\n  aoiName: &quot;\u4f73\u5e74\u534e\u00b7\u65f6\u4ee3\u6676\u5ea7&quot;,\n  \/\/GPS\u4fe1\u53f7\u72b6\u6001\n  gpsAccuracyStatus: &quot;GPS_ACCURACY_UNKNOWN&quot;,\n  locationDetail: &quot;#id:ELA==#csid:901652def094468ab9852bf21112d2fb&quot;\n}\n\n}\n&lt;\/script&gt;\n&lt;!--\u6267\u884c\u6838\u5fc3\u4ee3\u7801\uff1b\n\/\/\u5982\u679c\u9700\u8981\u8fdb\u5165\u9875\u9762\u5c31\u6267\u884c\uff0c\u53bb\u6389\u70b9\u51fb\u4e8b\u4ef6\u5373\u53ef\uff1b--&gt;<\/code><\/pre><\/div>\n\n\n\n<p>\u6309\u94ae\u6267\u884cJS\u793a\u4f8b\u4ee3\u7801<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;button onclick=&quot;zhixing()&quot; &gt;\u6267\u884c&lt;\/button&gt;\n&lt;!-- \/\/\u5199\u4e00\u4e2a\u6309\u94ae\uff0c\u5b9a\u4e49\u70b9\u51fb\u6267\u884c\u4e8b\u4ef6\uff1b --&gt;\n&lt;script src=&quot;\u60a8\u7684\u670d\u52a1\u5668URL\/jsbridge-mini.js&quot;&gt;&lt;\/script&gt;\n&lt;!-- \/\/\u5728\u60a8\u7684\u670d\u52a1\u5668\u5f15\u5165\u4e00\u95e8JS\u5730\u5740\uff0c\u8bf7\u4e0b\u8f7djsbridge-mini.js\u4e0a\u4f20\u60a8\u81ea\u5df1\u7684\u670d\u52a1\u5668\u83b7\u53d6\u94fe\u63a5\uff1b --&gt;\n&lt;script type=&quot;text\/javascript&quot;&gt;\nfunction zhixing() {\n\n\n&lt;!--\u8fd9\u91cc\u53ef\u4ee5\u76f4\u63a5\u590d\u5236JS\u6838\u5fc3\u4ee3\u7801\u5230\u6b64{}\u62ec\u53f7\u5185--&gt;\n$(&quot;#cnt&quot;).hide();\nvar result = $(&quot;#result&quot;).text(&quot;\u5b9a\u4f4d\u4e2d...&quot;);    \n$(&#39;html,body&#39;).animate({scrollTop: $(&#39;#view&#39;).offset().top}, 1200);\n\n\/\/\u53d1\u8d77\u5b9a\u4f4d\u5355\u6b21\u5b9a\u4f4d(watch \u4e3a false)\njsBridge.amapLoc.getCurrentPosition({\n  \/\/\u53ef\u9009\uff0c\u5b9a\u4f4d\u8d85\u65f6\u65f6\u95f4(\u79d2)\uff0c\u9ed8\u8ba430\u79d2\uff0c\u5efa\u8bae\u8bbe\u7f6e\u4e3a 8 - 30 \u4e4b\u95f4\n  timeout: 30,\n  \/\/\u53ef\u9009\uff0c\u6570\u5b57\u7c7b\u578b\uff0c\u5b9a\u4f4d\u6a21\u5f0f\uff0c\u9ed8\u8ba4 1\n  \/\/1 \u9ad8\u7cbe\u5ea6\u5b9a\u4f4d\u6a21\u5f0f\uff1a\u540c\u65f6\u4f7f\u7528\u7f51\u7edc\u5b9a\u4f4d\u548cGPS\u5b9a\u4f4d,\u4f18\u5148\u8fd4\u56de\u7cbe\u5ea6\u9ad8\u7684\u5b9a\u4f4d\n  \/\/2 \u4ec5\u8bbe\u5907\u5b9a\u4f4d\u6a21\u5f0f\uff1a\u53ea\u4f7f\u7528GPS\u5b9a\u4f4d\n  \/\/3 \u4f4e\u529f\u8017\u5b9a\u4f4d\u6a21\u5f0f\uff1a\u53ea\u4f7f\u7528\u7f51\u7edc\u5b9a\u4f4d\n  locationMode: 1,\n  \/\/\u53ef\u9009, \u8fde\u7eed\u5b9a\u4f4d, \u9ed8\u8ba4 false\n  \/\/\u8c03\u7528 jsBridge.amapLoc.stop() \u505c\u6b62\u5b9a\u4f4d\n  watch : false,\n  \/\/\u53ef\u9009\uff0c\u8fde\u7eed\u5b9a\u4f4d\u65f6\u95f4\u95f4\u9694(\u79d2)\uff0c\u6700\u4f4e1\u79d2\uff0c\u9ed8\u8ba41\n  watchInterval: 1,\n  \/\/\u53ef\u9009\uff0c\u5e03\u5c14\u7c7b\u578b\uff0c true = \u4e0d\u9700\u8981\u5730\u5740\u4fe1\u606f\uff0c\u9ed8\u8ba4 false (\u9700\u8981)\n  \/\/\u4e0d\u9700\u8981\u5730\u5740\u4fe1\u606f\u65f6\u7684\u5b9a\u4f4d\u901f\u5ea6\u66f4\u5feb\uff0c\u6d88\u8017\u66f4\u5c11\u7684\u6d41\u91cf\n  notAddress   : false,\n  \/\/\u53ef\u9009\uff0c\u8fde\u7eed\u5b9a\u4f4d\u901a\u77e5\u680f\u6807\u9898\uff0c\u9ed8\u8ba4\u4e3a\u5e94\u7528\u540d\u79f0\n  notifyTitle  : &quot;&quot;,\n  \/\/\u53ef\u9009\uff0c\u8fde\u7eed\u5b9a\u4f4d\u901a\u77e5\u680f\u5185\u5bb9\n  notifyContent: &quot;\u6301\u7eed\u5b9a\u4f4d\u4e2d...&quot;\n}, function(succ, data) {\n  result.JSONView({\n    succ: succ,\n    data: data\n  });\n});\n\n\/\/\u793a\u4f8b\u5b9a\u4f4d\u7ed3\u679c\uff08\u6a21\u62df\u6570\u636e\uff09\uff1a\nvar sample = \n{\n  success: true,\n  \/\/\u7ecf\u5ea6\n  longitude: 104.04725,\n  \/\/\u7eac\u5ea6\n  latitude: 30.542618,\n  \/\/\u6d77\u62d4\u9ad8\u5ea6\n  altitude: 0,\n  \/\/\u901f\u5ea6\n  speed: 0,\n  \/\/\u65b9\u5411\u89d2\n  bearing: 0,\n  \/\/\u5b9a\u4f4d\u7cbe\u5ea6\uff08\u7c73\uff09\n  accuracy: 29,\n  \/\/\u5ba4\u5185\u5b9a\u4f4d\u65f6\u7684\u5efa\u7b51\u7269\u7f16\u53f7\n  buildingId: &quot;B0G21Y6JXO&quot;,\n  \/\/\u5ba4\u5185\u5b9a\u4f4d\u65f6\u7684\u697c\u5c42\n  floor: &quot;&quot;,\n  \/\/\u5730\u5740\n  address: &quot;\u56db\u5ddd\u7701\u6210\u90fd\u5e02\u6b66\u4faf\u533a\u5929\u5e9c\u56db\u8857962\u53f7\u9760\u8fd1\u4f73\u5e74\u534e\u00b7\u65f6\u4ee3\u6676\u5ea7&quot;,\n  \/\/\u8857\u9053\n  street: &quot;\u5929\u5e9c\u56db\u8857&quot;,\n  \/\/\u95e8\u724c\u53f7\n  streetNumber: &quot;962\u53f7&quot;,\n  \/\/\u533a\u53bf\n  district: &quot;\u6b66\u4faf\u533a&quot;,\n  \/\/\u5e02\n  city: &quot;\u6210\u90fd\u5e02&quot;,\n  \/\/\u7701\n  province: &quot;\u56db\u5ddd\u7701&quot;,\n  \/\/\u56fd\u5bb6\n  country: &quot;\u4e2d\u56fd&quot;,\n  \/\/\u57ce\u5e02\u7f16\u7801\n  cityCode: &quot;028&quot;,\n  \/\/\u5730\u533a\u7f16\u7801\n  adCode: &quot;510107&quot;,\n  \/\/\u5b9a\u4f4d\u7c7b\u578b\uff0c\u53c2\u89c1 https:\/\/lbs.amap.com\/api\/android-location-sdk\/guide\/utilities\/location-type\/\n  locationType: 5,\n  \/\/poi\u540d\u79f0\n  poiName: &quot;\u4f73\u5e74\u534e\u00b7\u65f6\u4ee3\u6676\u5ea7&quot;,\n  \/\/aoi\u540d\u79f0\n  aoiName: &quot;\u4f73\u5e74\u534e\u00b7\u65f6\u4ee3\u6676\u5ea7&quot;,\n  \/\/GPS\u4fe1\u53f7\u72b6\u6001\n  gpsAccuracyStatus: &quot;GPS_ACCURACY_UNKNOWN&quot;,\n  locationDetail: &quot;#id:ELA==#csid:901652def094468ab9852bf21112d2fb&quot;\n}\n\n}\n&lt;\/script&gt;\n&lt;!-- \/\/\u6267\u884c\u6838\u5fc3\u4ee3\u7801\uff1b\n\/\/\u5982\u679c\u9700\u8981\u8fdb\u5165\u9875\u9762\u5c31\u6267\u884c\uff0c\u53bb\u6389\u70b9\u51fb\u4e8b\u4ef6\u5373\u53ef\uff1b --&gt;<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>getCurrentPosition\u00a0\u83b7\u53d6\u5f53\u524d\u4f4d\u7f6e APP\u63a5\u5165\u9ad8\u5fb7\u5b9a\u4f4d APP\u5f00\u53d1\u5b9a\u4f4d\u80fd\u529b<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[742],"tags":[3006,3376,3011,3377,3374,3004,3375,542],"special":[],"attr":[],"class_list":{"0":"post-9445","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-app130","7":"tag-app","11":"tag-getcurrentposition","12":"tag-3004","13":"tag-3375","14":"tag-gaodedingwei","15":"entry"},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/9445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/comments?post=9445"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/9445\/revisions"}],"predecessor-version":[{"id":9446,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/9445\/revisions\/9446"}],"wp:attachment":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/media?parent=9445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/categories?post=9445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/tags?post=9445"},{"taxonomy":"special","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/special?post=9445"},{"taxonomy":"attr","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/attr?post=9445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}