Files
supplier-dispatch-h5/node_modules/.cache/babel-loader/ebb9310f3b7dfb479cb81c39c3bacb7b81179146d4ba5cfa003f0ae7a14e5320.json
2023-08-11 10:45:20 +08:00

1 line
4.8 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"ast":null,"code":"// 获取定位, 返回 经纬度\nexport function getLocal(mapContext) {\n return new Promise((resolve, reject) => {\n mapContext.plugin('AMap.Geolocation', function () {\n let geolocation = new AMap.Geolocation({\n enableHighAccuracy: true,\n // 是否使用高精度定位默认true\n timeout: 10000,\n // 设置定位超时时间,默认:无穷大\n offset: [10, 20],\n // 定位按钮的停靠位置的偏移量\n zoomToAccuracy: true,\n // 定位成功后调整地图视野范围使定位位置及精度范围视野内可见默认false\n position: 'RB' // 定位按钮的排放位置, RB表示右下\n });\n\n geolocation.getCurrentPosition(function (status, result) {\n if (status == 'complete') {\n resolve(result.position);\n } else {\n alert(JSON.stringify(result));\n reject(result);\n }\n });\n });\n });\n}\n\n// 逆地址解析,根据经纬度获取详细地址\nexport function getAddress(mapContext) {\n var geocoder = new AMap.Geocoder({\n city: \"010\" //城市设为北京,默认:“全国”\n });\n\n AMap.plugin('AMap.Geocoder', function () {\n var geocoder = new AMap.Geocoder({\n city: '010' // city 指定进行编码查询的城市支持传入城市名、adcode 和 citycode\n });\n\n var lnglat = [116.396574, 39.992706];\n geocoder.getAddress(lnglat, function (status, result) {\n if (status === 'complete' && result.info === 'OK') {\n // result为对应的地理位置详细信息\n }\n });\n });\n}","map":{"version":3,"names":["getLocal","mapContext","Promise","resolve","reject","plugin","geolocation","AMap","Geolocation","enableHighAccuracy","timeout","offset","zoomToAccuracy","position","getCurrentPosition","status","result","alert","JSON","stringify","getAddress","geocoder","Geocoder","city","lnglat","info"],"sources":["E:/work/sino/sino-h5/src/utils/map.js"],"sourcesContent":["// 获取定位, 返回 经纬度\r\nexport function getLocal(mapContext) {\r\n return new Promise((resolve, reject) => {\r\n mapContext.plugin('AMap.Geolocation', function () {\r\n let geolocation = new AMap.Geolocation({\r\n enableHighAccuracy: true, // 是否使用高精度定位默认true\r\n timeout: 10000, // 设置定位超时时间,默认:无穷大\r\n offset: [10, 20], // 定位按钮的停靠位置的偏移量\r\n zoomToAccuracy: true, // 定位成功后调整地图视野范围使定位位置及精度范围视野内可见默认false\r\n position: 'RB' // 定位按钮的排放位置, RB表示右下\r\n })\r\n\r\n geolocation.getCurrentPosition(function(status, result){\r\n if(status == 'complete'){\r\n resolve(result.position)\r\n }else{\r\n alert(JSON.stringify(result))\r\n reject(result)\r\n }\r\n });\r\n })\r\n })\r\n}\r\n\r\n// 逆地址解析,根据经纬度获取详细地址\r\nexport function getAddress(mapContext) {\r\n\r\n var geocoder = new AMap.Geocoder({\r\n city: \"010\", //城市设为北京,默认:“全国”\r\n });\r\n\r\n\r\n AMap.plugin('AMap.Geocoder', function() {\r\n var geocoder = new AMap.Geocoder({\r\n city: '010' // city 指定进行编码查询的城市支持传入城市名、adcode 和 citycode\r\n })\r\n\r\n var lnglat = [116.396574, 39.992706]\r\n\r\n geocoder.getAddress(lnglat, function(status, result) {\r\n if (status === 'complete' && result.info === 'OK') {\r\n // result为对应的地理位置详细信息\r\n }\r\n })\r\n })\r\n\r\n}\r\n"],"mappings":"AAAA;AACA,OAAO,SAASA,QAAQA,CAACC,UAAU,EAAE;EACnC,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACtCH,UAAU,CAACI,MAAM,CAAC,kBAAkB,EAAE,YAAY;MAChD,IAAIC,WAAW,GAAG,IAAIC,IAAI,CAACC,WAAW,CAAC;QACrCC,kBAAkB,EAAE,IAAI;QAAE;QAC1BC,OAAO,EAAE,KAAK;QAAE;QAChBC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QAAG;QACnBC,cAAc,EAAE,IAAI;QAAG;QACvBC,QAAQ,EAAE,IAAI,CA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