{"remainingRequest":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\src\\utils\\AmapSearch.js","dependencies":[{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\src\\utils\\AmapSearch.js","mtime":1663828782931},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\babel.config.js","mtime":1663828782900},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\100zone\\Desktop\\baizong\\community\\SmartCommunity\\videoSurveillance\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.search\";\nvar url = 'https://webapi.amap.com/maps?v=1.4.15&key=c2df9f4026e98b41962148c1703d8f33&plugin=AMap.Autocomplete,AMap.PlaceSearch&callback=onLoad';\nvar jsapi = document.createElement('script');\njsapi.type = \"text/javascript\";\njsapi.src = url;\ndocument.head.appendChild(jsapi);\nvar times = setInterval(function () {\n try {\n if (!!AMap) {\n var s = document.createElement('script');\n s.type = \"text/javascript\";\n s.src = 'https://webapi.amap.com/ui/1.1/main.js';\n document.head.appendChild(s);\n clearInterval(times);\n }\n } catch (_unused) {}\n}, 1000);\n\nwindow.onLoad = function () {// var map = new AMap.Map('container');\n};\n/**\r\n * 调用高德地图执行模糊查询\r\n * @param {Number} page 当前页\r\n * @param {String} inputval 关键字\r\n * @param {Function} cb 回调函数\r\n * @param {Boolean} isMark 是否在地图上标记点\r\n */\n\n\nfunction AmapSearch(page, inputval, cb, isMark) {\n var keywords = inputval;\n AMap.plugin('AMap.PlaceSearch', function () {\n var autoOptions = {\n city: VagueQueryUrl,\n citylimit: true,\n pageIndex: page\n };\n var placeSearch = new AMap.PlaceSearch(autoOptions);\n placeSearch.search(keywords, function (status, result) {\n if (status != \"complete\") {\n return;\n }\n\n var datas = result.poiList;\n var count = datas.count;\n var crupage = datas.pageIndex;\n var arr = datas.pois;\n var pointData = [];\n var returnObjectList = [];\n\n for (var i = 0; i < arr.length; i++) {\n var element = arr[i];\n var xy = [];\n var x = element.location.lng; //经度\n\n var y = element.location.lat; // 纬度\n\n x = handle_x(x);\n y = handle_y(y);\n xy.push(x);\n xy.push(y);\n var returnObject = new Object();\n returnObject.id = element.id;\n returnObject.text = element.name;\n returnObject.address = element.address;\n returnObject.XY = xy;\n var marksData = {\n \"json\": xy\n };\n pointData = pointData.concat(marksData);\n returnObjectList.push(returnObject);\n }\n\n var symbol = new PictureMarkSymbolArgs();\n symbol.url = \"images/amap_l_gray.png\";\n symbol.height = 36;\n symbol.width = 36;\n symbol.yoffset = 15;\n symbol.xoffset = 3;\n\n if (isMark) {\n createMarkLayer(pointData, \"vagueQueryLyr\", symbol);\n }\n\n var resDatasObj = {\n keywords: keywords,\n page: crupage,\n count: count,\n list: returnObjectList\n };\n cb(resDatasObj);\n });\n });\n} // RoadInfoSearch()\n\n\nfunction RoadInfoSearch() {\n AMap.plugin('AMap.RoadInfoSearch', function () {\n var autoOptions = {\n city: VagueQueryUrl,\n pageSize: 100,\n pageIndex: 1\n };\n var roadInfoSearch = new AMap.RoadInfoSearch(autoOptions);\n roadInfoSearch.crossInfoSearchByCrossId(\"\", function (status, result) {\n console.log(status, result);\n });\n });\n} //经度转墨卡托\n\n\nfunction handle_x(x) {\n return x / 180.0 * 20037508.34;\n} //纬度度转墨卡托\n\n\nfunction handle_y(y) {\n if (y > 85.05112) {\n y = 85.05112;\n }\n\n if (y < -85.05112) {\n y = -85.05112;\n }\n\n y = Math.PI / 180.0 * y;\n var tmp = Math.PI / 4.0 + y / 2.0;\n return 20037508.34 * Math.log(Math.tan(tmp)) / Math.PI;\n}\n/**\r\n * 获取行政区域;\r\n * @param {String} val 行政区域名\r\n * @param {Function} cb 回调函数\r\n */\n\n\nfunction getExtent(val, cb) {\n if (!val) return;\n var AmapCityBoundaries = {};\n AMap.plugin('AMap.DistrictSearch', function () {\n var districtSearch = new AMap.DistrictSearch({\n // 关键字对应的行政区级别,country表示国家\n level: 'city',\n // 显示下级行政区级数,1表示返回下一级行政区\n subdistrict: 1,\n extensions: \"all\"\n }); // 搜索所有省/直辖市信息\n\n districtSearch.search(val, function (status, result) {\n var initWkid = 2360; // 默认xian80坐标系\n //巴里坤的lessid 巴里坤的层级和坐标系\n\n var blklessid = \"912588c2a65543dca846\";\n var getblklessid = JSON.parse(sessionStorage.getItem(\"account\")).lesseeId;\n\n if (blklessid === getblklessid) {\n initWkid = 102100;\n } // 查询成功时,result即为对应的行政区信息\n\n\n if (status == \"complete\") {\n var cruExtent = result.districtList[0].center;\n AmapCityBoundaries.type = \"point\";\n AmapCityBoundaries.x = handle_x(cruExtent.lng);\n AmapCityBoundaries.y = handle_y(cruExtent.lat);\n AmapCityBoundaries.spatialReference = {\n \"wkid\": initWkid\n };\n cb(AmapCityBoundaries);\n } else {}\n });\n });\n} // 高德测量面积接口\n\n\nfunction AmapGetArea(paths, callback) {\n var area = AMap.GeometryUtil.ringArea(paths);\n callback(area);\n}",{"version":3,"sources":["C:/Users/100zone/Desktop/baizong/community/SmartCommunity/videoSurveillance/src/utils/AmapSearch.js"],"names":["url","jsapi","document","createElement","type","src","head","appendChild","times","setInterval","AMap","s","clearInterval","window","onLoad","AmapSearch","page","inputval","cb","isMark","keywords","plugin","autoOptions","city","VagueQueryUrl","citylimit","pageIndex","placeSearch","PlaceSearch","search","status","result","datas","poiList","count","crupage","arr","pois","pointData","returnObjectList","i","length","element","xy","x","location","lng","y","lat","handle_x","handle_y","push","returnObject","Object","id","text","name","address","XY","marksData","concat","symbol","PictureMarkSymbolArgs","height","width","yoffset","xoffset","createMarkLayer","resDatasObj","list","RoadInfoSearch","pageSize","roadInfoSearch","crossInfoSearchByCrossId","console","log","Math","PI","tmp","tan","getExtent","val","AmapCityBoundaries","districtSearch","DistrictSearch","level","subdistrict","extensions","initWkid","blklessid","getblklessid","JSON","parse","sessionStorage","getItem","lesseeId","cruExtent","districtList","center","spatialReference","AmapGetArea","paths","callback","area","GeometryUtil","ringArea"],"mappings":";;AAAA,IAAIA,GAAG,GAAG,sIAAV;AACA,IAAIC,KAAK,GAAGC,QAAQ,CAACC,aAAT,CAAuB,QAAvB,CAAZ;AACAF,KAAK,CAACG,IAAN,GAAa,iBAAb;AACAH,KAAK,CAACI,GAAN,GAAYL,GAAZ;AACAE,QAAQ,CAACI,IAAT,CAAcC,WAAd,CAA0BN,KAA1B;AAEA,IAAIO,KAAK,GAAGC,WAAW,CAAC,YAAM;AAC7B,MAAI;AACH,QAAI,CAAC,CAACC,IAAN,EAAY;AACX,UAAMC,CAAC,GAAGT,QAAQ,CAACC,aAAT,CAAuB,QAAvB,CAAV;AACAQ,MAAAA,CAAC,CAACP,IAAF,GAAS,iBAAT;AACAO,MAAAA,CAAC,CAACN,GAAF,GAAQ,wCAAR;AACAH,MAAAA,QAAQ,CAACI,IAAT,CAAcC,WAAd,CAA0BI,CAA1B;AACAC,MAAAA,aAAa,CAACJ,KAAD,CAAb;AACA;AACD,GARD,CAQE,gBAAM,CAAG;AAEX,CAXsB,EAWpB,IAXoB,CAAvB;;AAaAK,MAAM,CAACC,MAAP,GAAgB,YAAY,CAC3B;AACA,CAFD;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,UAAT,CAAoBC,IAApB,EAA0BC,QAA1B,EAAoCC,EAApC,EAAwCC,MAAxC,EAAgD;AAC/C,MAAIC,QAAQ,GAAGH,QAAf;AACAP,EAAAA,IAAI,CAACW,MAAL,CAAY,kBAAZ,EAAgC,YAAY;AAC3C,QAAIC,WAAW,GAAG;AACjBC,MAAAA,IAAI,EAAEC,aADW;AAEjBC,MAAAA,SAAS,EAAE,IAFM;AAGjBC,MAAAA,SAAS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EAA0B;AACpD,UAAIyD,QAAQ,GAAG,IAAf,CADoD,CAC/B;AACrB;;AACA,UAAIC,SAAS,GAAG,sBAAhB;AACA,UAAIC,YAAY,GAAGC,IAAI,CAACC,KAAL,CAAWC,cAAc,CAACC,OAAf,CAAuB,SAAvB,CAAX,EAA8CC,QAAjE;;AACA,UAAIN,SAAS,KAAKC,YAAlB,EAAgC;AAC/BF,QAAAA,QAAQ,GAAG,MAAX;AACA,OAPmD,CAQpD;;;AACA,UAAI1D,MAAM,IAAI,UAAd,EAA0B;AACzB,YAAIkE,SAAS,GAAGjE,MAAM,CAACkE,YAAP,CAAoB,CAApB,EAAuBC,MAAvC;AACAhB,QAAAA,kBAAkB,CAAC9E,IAAnB,GAA0B,OAA1B;AACA8E,QAAAA,kBAAkB,CAACtC,CAAnB,GAAuBK,QAAQ,CAAC+C,SAAS,CAAClD,GAAX,CAA/B;AACAoC,QAAAA,kBAAkB,CAACnC,CAAnB,GAAuBG,QAAQ,CAAC8C,SAAS,CAAChD,GAAX,CAA/B;AACAkC,QAAAA,kBAAkB,CAACiB,gBAAnB,GAAsC;AAAE,kBAAQX;AAAV,SAAtC;AACAtE,QAAAA,EAAE,CAACgE,kBAAD,CAAF;AACA,OAPD,MAOO,CAEN;AACD,KAnBD;AAoBA,GA9BD;AA+BA,C,CAID;;;AACA,SAASkB,WAAT,CAAqBC,KAArB,EAA4BC,QAA5B,EAAsC;AACrC,MAAIC,IAAI,GAAG7F,IAAI,CAAC8F,YAAL,CAAkBC,QAAlB,CAA2BJ,KAA3B,CAAX;AACAC,EAAAA,QAAQ,CAACC,IAAD,CAAR;AACA","sourcesContent":["var url = 'https://webapi.amap.com/maps?v=1.4.15&key=c2df9f4026e98b41962148c1703d8f33&plugin=AMap.Autocomplete,AMap.PlaceSearch&callback=onLoad';\r\nvar jsapi = document.createElement('script');\r\njsapi.type = \"text/javascript\";\r\njsapi.src = url;\r\ndocument.head.appendChild(jsapi);\r\n\r\nlet times = setInterval(() => {\r\n\ttry {\r\n\t\tif (!!AMap) {\r\n\t\t\tconst s = document.createElement('script');\r\n\t\t\ts.type = \"text/javascript\";\r\n\t\t\ts.src = 'https://webapi.amap.com/ui/1.1/main.js';\r\n\t\t\tdocument.head.appendChild(s);\r\n\t\t\tclearInterval(times)\r\n\t\t}\r\n\t} catch { }\r\n\r\n}, 1000)\r\n\r\nwindow.onLoad = function () {\r\n\t// var map = new AMap.Map('container');\r\n}\r\n\r\n/**\r\n * 调用高德地图执行模糊查询\r\n * @param {Number} page 当前页\r\n * @param {String} inputval 关键字\r\n * @param {Function} cb 回调函数\r\n * @param {Boolean} isMark 是否在地图上标记点\r\n */\r\nfunction AmapSearch(page, inputval, cb, isMark) {\r\n\tvar keywords = inputval;\r\n\tAMap.plugin('AMap.PlaceSearch', function () {\r\n\t\tvar autoOptions = {\r\n\t\t\tcity: VagueQueryUrl,\r\n\t\t\tcitylimit: true,\r\n\t\t\tpageIndex: page\r\n\t\t}\r\n\t\tvar placeSearch = new AMap.PlaceSearch(autoOptions);\r\n\t\tplaceSearch.search(keywords, function (status, result) {\r\n\t\t\tif (status != \"complete\") {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\tvar datas = result.poiList;\r\n\t\t\tlet count = datas.count;\r\n\t\t\tlet crupage = datas.pageIndex;\r\n\t\t\tlet arr = datas.pois;\r\n\t\t\tvar pointData = [];\r\n\t\t\tvar returnObjectList = [];\r\n\t\t\tfor (let i = 0; i < arr.length; i++) {\r\n\t\t\t\tconst element = arr[i];\r\n\t\t\t\tvar xy = [];\r\n\t\t\t\tvar x = element.location.lng; //经度\r\n\t\t\t\tvar y = element.location.lat; // 纬度\r\n\t\t\t\tx = handle_x(x);\r\n\t\t\t\ty = handle_y(y);\r\n\t\t\t\txy.push(x);\r\n\t\t\t\txy.push(y);\r\n\r\n\t\t\t\tvar returnObject = new Object();\r\n\t\t\t\treturnObject.id = element.id;\r\n\t\t\t\treturnObject.text = element.name;\r\n\t\t\t\treturnObject.address = element.address;\r\n\t\t\t\treturnObject.XY = xy;\r\n\t\t\t\tvar marksData = {\r\n\t\t\t\t\t\"json\": xy\r\n\t\t\t\t};\r\n\t\t\t\tpointData = pointData.concat(marksData);\r\n\t\t\t\treturnObjectList.push(returnObject);\r\n\t\t\t}\r\n\t\t\tvar symbol = new PictureMarkSymbolArgs();\r\n\t\t\tsymbol.url = \"images/amap_l_gray.png\";\r\n\t\t\tsymbol.height = 36;\r\n\t\t\tsymbol.width = 36;\r\n\t\t\tsymbol.yoffset = 15;\r\n\t\t\tsymbol.xoffset = 3;\r\n\t\t\tif (isMark) {\r\n\t\t\t\tcreateMarkLayer(pointData, \"vagueQueryLyr\", symbol);\r\n\t\t\t}\r\n\t\t\tvar resDatasObj = {\r\n\t\t\t\tkeywords: keywords,\r\n\t\t\t\tpage: crupage,\r\n\t\t\t\tcount: count,\r\n\t\t\t\tlist: returnObjectList\r\n\t\t\t}\r\n\t\t\tcb(resDatasObj);\r\n\t\t})\r\n\t})\r\n}\r\n// RoadInfoSearch()\r\nfunction RoadInfoSearch() {\r\n\tAMap.plugin('AMap.RoadInfoSearch', function () {\r\n\t\tvar autoOptions = {\r\n\t\t\tcity: VagueQueryUrl,\r\n\t\t\tpageSize: 100,\r\n\t\t\tpageIndex: 1\r\n\t\t}\r\n\t\tvar roadInfoSearch = new AMap.RoadInfoSearch(autoOptions);\r\n\t\troadInfoSearch.crossInfoSearchByCrossId(\"\", function (status, result) {\r\n\t\t\tconsole.log(status, result);\r\n\r\n\t\t})\r\n\t})\r\n}\r\n\r\n//经度转墨卡托\r\nfunction handle_x(x) {\r\n\treturn (x / 180.0) * 20037508.34;\r\n}\r\n\r\n//纬度度转墨卡托\r\nfunction handle_y(y) {\r\n\tif (y > 85.05112) {\r\n\t\ty = 85.05112;\r\n\t}\r\n\r\n\tif (y < -85.05112) {\r\n\t\ty = -85.05112;\r\n\t}\r\n\r\n\ty = (Math.PI / 180.0) * y;\r\n\tvar tmp = Math.PI / 4.0 + y / 2.0;\r\n\treturn 20037508.34 * Math.log(Math.tan(tmp)) / Math.PI;\r\n}\r\n\r\n/**\r\n * 获取行政区域;\r\n * @param {String} val 行政区域名\r\n * @param {Function} cb 回调函数\r\n */\r\nfunction getExtent(val, cb) {\r\n\tif (!val) return;\r\n\tvar AmapCityBoundaries = {};\r\n\tAMap.plugin('AMap.DistrictSearch', function () {\r\n\t\tvar districtSearch = new AMap.DistrictSearch({\r\n\t\t\t// 关键字对应的行政区级别,country表示国家\r\n\t\t\tlevel: 'city',\r\n\t\t\t// 显示下级行政区级数,1表示返回下一级行政区\r\n\t\t\tsubdistrict: 1,\r\n\t\t\textensions: \"all\"\r\n\t\t})\r\n\r\n\t\t// 搜索所有省/直辖市信息\r\n\t\tdistrictSearch.search(val, function (status, result) {\r\n\t\t\tlet initWkid = 2360; // 默认xian80坐标系\r\n\t\t\t//巴里坤的lessid 巴里坤的层级和坐标系\r\n\t\t\tlet blklessid = \"912588c2a65543dca846\";\r\n\t\t\tlet getblklessid = JSON.parse(sessionStorage.getItem(\"account\")).lesseeId;\r\n\t\t\tif (blklessid === getblklessid) {\r\n\t\t\t\tinitWkid = 102100;\r\n\t\t\t}\r\n\t\t\t// 查询成功时,result即为对应的行政区信息\r\n\t\t\tif (status == \"complete\") {\r\n\t\t\t\tlet cruExtent = result.districtList[0].center;\r\n\t\t\t\tAmapCityBoundaries.type = \"point\";\r\n\t\t\t\tAmapCityBoundaries.x = handle_x(cruExtent.lng);\r\n\t\t\t\tAmapCityBoundaries.y = handle_y(cruExtent.lat);\r\n\t\t\t\tAmapCityBoundaries.spatialReference = { \"wkid\": initWkid };\r\n\t\t\t\tcb(AmapCityBoundaries);\r\n\t\t\t} else {\r\n\r\n\t\t\t}\r\n\t\t})\r\n\t})\r\n}\r\n\r\n\r\n\r\n// 高德测量面积接口\r\nfunction AmapGetArea(paths, callback) {\r\n\tvar area = AMap.GeometryUtil.ringArea(paths);\r\n\tcallback(area);\r\n}\r\n"]}]}