1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442 |
- import axios from "axios";
- import data from "@c/mixins/anbao";
- export default {
- data() {
- return {
- stores: this.$useStore(),
- map: null,
- oldPopup: null,
- oldPopupId: null,
- };
- },
- mounted() {
- window.vue = this;
- window.jMap = null;
- window.jmapQuery = null;
- },
- methods: {
- streetTownMap(name) {
- return name
- },
- /**
- *地图初始化
- *
- */
- async initMap(type) {
- window.vue = this;
- window.jMap = null;
- window.jmapQuery = null;
- window.jMap = new JMap();
- var map_params = {
- camera: {
- x: 121.4175597,
- y: 31.119248,
- radius: 18000.0,
- offset: { heading: -4, pitch: -70, range: 0 },
- },
- map_complete_callback: () => {
- window.jmapQuery = new JMapQuery(window.jMap);
- // ToDo...
- },
- map_left_click_callback: (obj, type, movement, event) => {
- this.stores.$state.tankuangXY = { x: movement.position.x, y: movement.position.y };
- },
- map_right_click_callback: (obj) => {},
- };
- let res = await this.$axios.get(this.$api.dt);
- // 加载地图
- window.jMap.createMap("mapF", res.data, window.location.origin, map_params, {});
- // 地图背景样式
- window.jMap.switchBaseLayer("blue");
- /**
- * 获取街镇信息
- */
- var options = {
- click: addLayerCallBack,
- isZoom: false,
- style: {
- outline: true,
- outlineColor: "rgb(255,0,0,0.8)",
- // material: "rgb(154,255,154,0)",
- perPositionHeight: true,
- height: 200,
- width: "10px",
- size: "10px",
- label: {
- show: true,
- text: "name",
- font: "16px Helvetica",
- fillColor: "rgb(0,255,0,0.9)",
- pixelOffset: [0, -40],
- backgroundColor: "rgb(0,0,0,0)",
- showBackground: false,
- },
- },
- // where:"name = '莘庄镇'"
- };
- window.jMap.addLayer("mh_dyn_district", [1], options);
- // 街镇标题绘制
- // var qp = new JMapQueryParam({
- // queryMapService: "mh_dyn_district",
- // queryMapLayers: [1],
- // outFields: ["code", "name", "center_x", "center_y"],
- // // queryWhere: "name like '%莘庄镇%' ",
- // callBack: (res) => {
- // res.features.forEach(async(val) => {
- // await window.jMap.FlagInfo.show({
- // id: val.attributes.code,
- // position: { x: Number(val.attributes.center_x), y: Number(val.attributes.center_y), z: 0 },
- // element: `<div class='ysc-dynamic-layer ys-css3-box' onclick="vue.clickFlag(${val.attributes.code})">
- // <div class='biaozhu' style="font-size:18px !important">${val.attributes.name} ${val.attributes.code}</div>
- // </div>`,
- // }, { isZoom: false });
- // });
- // },
- // });
- // new JMapQuery(window.jMap).execQuery(qp)
- },
- /**
- * 疏导区网格
- */
- anbaoSDUWG() {
- // arr["疏导区","核心区","新虹","虹桥","七宝","疏导区","疏导区","疏导区","疏导区","疏导区","疏导区"]
- let arr = [
- [
- { x: 121.36194587932806, y: 31.16013705465239, z: 0 },
- { x: 121.34727553811794, y: 31.15828077299882, z: 0 },
- { x: 121.32700411033827, y: 31.148247489434965, z: 0 },
- { x: 121.31514606604391, y: 31.139440444833916, z: 0 },
- { x: 121.30048786370499, y: 31.134903156770502, z: 0 },
- { x: 121.29284839062778, y: 31.12773298212305, z: 0 },
- { x: 121.28484794201171, y: 31.12306873887283, z: 0 },
- { x: 121.2434981967536, y: 31.119911283997425, z: 0 },
- { x: 121.22295978253271, y: 31.11453182095247, z: 0 },
- { x: 121.22093534994545, y: 31.128184924119704, z: 0 },
- { x: 121.22476714240756, y: 31.137743873822444, z: 0 },
- { x: 121.22284789103668, y: 31.151848705517672, z: 0 },
- { x: 121.2192245740552, y: 31.185051824029983, z: 0 },
- { x: 121.21634530262463, y: 31.19305254070648, z: 0 },
- { x: 121.21666410880577, y: 31.199965150511076, z: 0 },
- { x: 121.20802887999594, y: 31.252419358825662, z: 0 },
- { x: 121.2510308379889, y: 31.25199056924825, z: 0 },
- { x: 121.26975280768023, y: 31.256161713215423, z: 0 },
- { x: 121.29758483246128, y: 31.25239812402721, z: 0 },
- { x: 121.34774474510056, y: 31.253635862387053, z: 0 },
- { x: 121.34278143296902, y: 31.239737181776324, z: 0 },
- { x: 121.34412376809345, y: 31.224709084528335, z: 0 },
- { x: 121.35105449522602, y: 31.20248989001769, z: 0 },
- { x: 121.35374042236845, y: 31.182090361752536, z: 0 },
- { x: 121.36194587932806, y: 31.16013705465239, z: 0 },
- ],
- [{
- "x": 121.29577137421792,
- "y": 31.186824696355163,
- "z": 0
- },
- {
- "x": 121.29418329761764,
- "y": 31.18872030124066,
- "z": 0
- },
- {
- "x": 121.29280475525546,
- "y": 31.190723474492756,
- "z": 0
- },
- {
- "x": 121.29005251449192,
- "y": 31.194744686426272,
- "z": 0
- },
- {
- "x": 121.29837921625169,
- "y": 31.198135776426472,
- "z": 0
- },
- {
- "x": 121.29990431690115,
- "y": 31.195743378525012,
- "z": 0
- },
- {
- "x": 121.3017996230984,
- "y": 31.19308143590054,
- "z": 0
- },
- {
- "x": 121.30362101641953,
- "y": 31.190462548748194,
- "z": 0
- },
- {
- "x": 121.30470085312731,
- "y": 31.188890418122178,
- "z": 0
- },
- {
- "x": 121.30488549898331,
- "y": 31.18841532634147,
- "z": 0
- },
- {
- "x": 121.30489353090678,
- "y": 31.187841598865855,
- "z": 0
- },
- {
- "x": 121.30487462397232,
- "y": 31.187226940195103,
- "z": 0
- },
- {
- "x": 121.30467806077046,
- "y": 31.187033387433935,
- "z": 0
- },
- {
- "x": 121.30391173448861,
- "y": 31.18654998998803,
- "z": 0
- },
- {
- "x": 121.3031354194004,
- "y": 31.186067600959273,
- "z": 0
- },
- {
- "x": 121.30162566409005,
- "y": 31.18515069662575,
- "z": 0
- },
- {
- "x": 121.29858007896227,
- "y": 31.183287832294678,
- "z": 0
- },
- {
- "x": 121.29577137421792,
- "y": 31.186824696355163,
- "z": 0
- },
- ],
- ]
- //高德转84
- // let sz = [
- // [121.30025, 31.184825],
- // [121.298659, 31.186719],
- // [121.297278, 31.188721],
- // [121.294521, 31.19274],
- // [121.302864, 31.196146],
- // [121.304392, 31.193755],
- // [121.306291, 31.191095],
- // [121.308116, 31.188478],
- // [121.309198, 31.186907],
- // [121.309383, 31.186432],
- // [121.309391, 31.185858],
- // [121.309372, 31.185243],
- // [121.309175, 31.185049],
- // [121.308407, 31.184564],
- // [121.307629, 31.18408],
- // [121.306116, 31.18316],
- // [121.303064, 31.181291]
- // ]
- // let result = {}
- // for (let i = 0; i < sz.length; i++) {
- // result = CoordUtil.gcj02towgs84(sz[i][0], sz[i][1]);
- // arr[1].push({ x: result[0], y: result[1], z: 0 })
- // }
- // console.log(111, arr)
- for (let i = 0; i < arr.length; i++) {
- let target = {
- id: i,
- attributes: {
- name: i,
- },
- position: arr[i],
- label: {
- text: i,
- font: "16px Helvetica",
- color: i == 0 ? "red" : "orange",
- pixelOffset: [0, -50],
- backgroundColor: "red"
- }
- }
- let options = {
- isZoom: false,
- style: {
- color: i == 0 ? "red" : i == 1 ? "orange" : "",
- transparency: 1,
- outline: true,
- outlineColor: 'transparent',
- perPositionHeight: true
- },
- // click: regionLocateCallBack111
- };
- setTimeout(() => {
- window.jMap.Locate.trackLocate(target, options);
- }, 1000)
- }
- },
- /**
- * 疏导区网格
- */
- anbaoSDUWG2() {
- // arr["疏导区","核心区","新虹","虹桥","七宝","疏导区","疏导区","疏导区","疏导区","疏导区","疏导区"]
- let arr = [
- [
- { x: 121.36194587932806, y: 31.16013705465239, z: 0 },
- { x: 121.34727553811794, y: 31.15828077299882, z: 0 },
- { x: 121.32700411033827, y: 31.148247489434965, z: 0 },
- { x: 121.31514606604391, y: 31.139440444833916, z: 0 },
- { x: 121.30048786370499, y: 31.134903156770502, z: 0 },
- { x: 121.29284839062778, y: 31.12773298212305, z: 0 },
- { x: 121.28484794201171, y: 31.12306873887283, z: 0 },
- { x: 121.2434981967536, y: 31.119911283997425, z: 0 },
- { x: 121.22295978253271, y: 31.11453182095247, z: 0 },
- { x: 121.22093534994545, y: 31.128184924119704, z: 0 },
- { x: 121.22476714240756, y: 31.137743873822444, z: 0 },
- { x: 121.22284789103668, y: 31.151848705517672, z: 0 },
- { x: 121.2192245740552, y: 31.185051824029983, z: 0 },
- { x: 121.21634530262463, y: 31.19305254070648, z: 0 },
- { x: 121.21666410880577, y: 31.199965150511076, z: 0 },
- { x: 121.20802887999594, y: 31.252419358825662, z: 0 },
- { x: 121.2510308379889, y: 31.25199056924825, z: 0 },
- { x: 121.26975280768023, y: 31.256161713215423, z: 0 },
- { x: 121.29758483246128, y: 31.25239812402721, z: 0 },
- { x: 121.34774474510056, y: 31.253635862387053, z: 0 },
- { x: 121.34278143296902, y: 31.239737181776324, z: 0 },
- { x: 121.34412376809345, y: 31.224709084528335, z: 0 },
- { x: 121.35105449522602, y: 31.20248989001769, z: 0 },
- { x: 121.35374042236845, y: 31.182090361752536, z: 0 },
- { x: 121.36194587932806, y: 31.16013705465239, z: 0 },
- ],
- [{
- "x": 121.29577137421792,
- "y": 31.186824696355163,
- "z": 0
- },
- {
- "x": 121.29418329761764,
- "y": 31.18872030124066,
- "z": 0
- },
- {
- "x": 121.29280475525546,
- "y": 31.190723474492756,
- "z": 0
- },
- {
- "x": 121.29005251449192,
- "y": 31.194744686426272,
- "z": 0
- },
- {
- "x": 121.29837921625169,
- "y": 31.198135776426472,
- "z": 0
- },
- {
- "x": 121.29990431690115,
- "y": 31.195743378525012,
- "z": 0
- },
- {
- "x": 121.3017996230984,
- "y": 31.19308143590054,
- "z": 0
- },
- {
- "x": 121.30362101641953,
- "y": 31.190462548748194,
- "z": 0
- },
- {
- "x": 121.30470085312731,
- "y": 31.188890418122178,
- "z": 0
- },
- {
- "x": 121.30488549898331,
- "y": 31.18841532634147,
- "z": 0
- },
- {
- "x": 121.30489353090678,
- "y": 31.187841598865855,
- "z": 0
- },
- {
- "x": 121.30487462397232,
- "y": 31.187226940195103,
- "z": 0
- },
- {
- "x": 121.30467806077046,
- "y": 31.187033387433935,
- "z": 0
- },
- {
- "x": 121.30391173448861,
- "y": 31.18654998998803,
- "z": 0
- },
- {
- "x": 121.3031354194004,
- "y": 31.186067600959273,
- "z": 0
- },
- {
- "x": 121.30162566409005,
- "y": 31.18515069662575,
- "z": 0
- },
- {
- "x": 121.29858007896227,
- "y": 31.183287832294678,
- "z": 0
- },
- {
- "x": 121.29577137421792,
- "y": 31.186824696355163,
- "z": 0
- },
- {
- "x": 121.29577137421792,
- "y": 31.186824696355163,
- "z": 0
- },
- ],
- [{
- "x": 121.30273636473034,
- "y": 31.2198977980581,
- "z": 0
- },
- {
- "x": 121.29858295212301,
- "y": 31.21979797448395,
- "z": 0
- },
- {
- "x": 121.29956982474825,
- "y": 31.209507227504808,
- "z": 0
- },
- {
- "x": 121.29920600370836,
- "y": 31.204402317941,
- "z": 0
- },
- {
- "x": 121.30115745085595,
- "y": 31.199027612153586,
- "z": 0
- },
- {
- "x": 121.29693509877501,
- "y": 31.198268111287387,
- "z": 0
- },
- {
- "x": 121.2998305936312,
- "y": 31.194274230550622,
- "z": 0
- },
- {
- "x": 121.30403211938238,
- "y": 31.19074867933738,
- "z": 0
- },
- {
- "x": 121.31253766412574,
- "y": 31.177473826775493,
- "z": 0
- },
- {
- "x": 121.315349691171,
- "y": 31.173434590837402,
- "z": 0
- },
- {
- "x": 121.31925691122792,
- "y": 31.17245465391409,
- "z": 0
- },
- {
- "x": 121.32390048093693,
- "y": 31.170568716589433,
- "z": 0
- },
- {
- "x": 121.32616056996633,
- "y": 31.167764822098988,
- "z": 0
- },
- {
- "x": 121.33127182948746,
- "y": 31.169693074849317,
- "z": 0
- },
- {
- "x": 121.3354384069199,
- "y": 31.17126742825148,
- "z": 0
- },
- {
- "x": 121.33714887246975,
- "y": 31.168692577494745,
- "z": 0
- },
- {
- "x": 121.3403344015155,
- "y": 31.163862248714743,
- "z": 0
- },
- {
- "x": 121.34528486521597,
- "y": 31.16583845246894,
- "z": 0
- },
- {
- "x": 121.35120094247694,
- "y": 31.16826127346991,
- "z": 0
- },
- {
- "x": 121.35749722559409,
- "y": 31.17110007381761,
- "z": 0
- },
- {
- "x": 121.35512965416443,
- "y": 31.179768207777574,
- "z": 0
- },
- {
- "x": 121.35410500715878,
- "y": 31.185618837915666,
- "z": 0
- },
- {
- "x": 121.34837311330138,
- "y": 31.183574136266312,
- "z": 0
- },
- {
- "x": 121.3469467923959,
- "y": 31.18549258283246,
- "z": 0
- },
- {
- "x": 121.33742914963742,
- "y": 31.181555501135435,
- "z": 0
- },
- {
- "x": 121.33725368441635,
- "y": 31.179798713266624,
- "z": 0
- },
- {
- "x": 121.33674866036101,
- "y": 31.181289892310865,
- "z": 0
- },
- {
- "x": 121.332501016653,
- "y": 31.181933513222692,
- "z": 0
- },
- {
- "x": 121.32672712369686,
- "y": 31.192809064312954,
- "z": 0
- },
- {
- "x": 121.33390476125636,
- "y": 31.194946367619707,
- "z": 0
- },
- {
- "x": 121.33439003374988,
- "y": 31.214038166797163,
- "z": 0
- },
- {
- "x": 121.33549657393999,
- "y": 31.21415804204388,
- "z": 0
- },
- {
- "x": 121.3354385349542,
- "y": 31.21609122683711,
- "z": 0
- },
- {
- "x": 121.33450141290005,
- "y": 31.21836189705601,
- "z": 0
- },
- {
- "x": 121.33784500531124,
- "y": 31.219012381734945,
- "z": 0
- },
- {
- "x": 121.3384451733604,
- "y": 31.225114402730796,
- "z": 0
- },
- {
- "x": 121.33590564782995,
- "y": 31.226002674540123,
- "z": 0
- },
- {
- "x": 121.32937128911844,
- "y": 31.225656158547864,
- "z": 0
- },
- {
- "x": 121.32315754421998,
- "y": 31.224375662366445,
- "z": 0
- },
- {
- "x": 121.31760625340529,
- "y": 31.22378157061199,
- "z": 0
- },
- {
- "x": 121.31268346643918,
- "y": 31.222581443941348,
- "z": 0
- },
- {
- "x": 121.30781741345972,
- "y": 31.220468440291086,
- "z": 0
- },
- {
- "x": 121.30502250919344,
- "y": 31.219897754208514,
- "z": 0
- }
- ],
- [{
- "x": 121.35379785226752,
- "y": 31.159300786342637,
- "z": 0
- },
- {
- "x": 121.35868617827254,
- "y": 31.159720227812123,
- "z": 0
- },
- {
- "x": 121.36215949997082,
- "y": 31.15969540722189,
- "z": 0
- },
- {
- "x": 121.3614223065673,
- "y": 31.163905217450328,
- "z": 0
- },
- {
- "x": 121.35761905377441,
- "y": 31.17065412368764,
- "z": 0
- },
- {
- "x": 121.3515233621259,
- "y": 31.16787295256606,
- "z": 0
- },
- {
- "x": 121.35190868564712,
- "y": 31.167252652709518,
- "z": 0
- },
- {
- "x": 121.35248467261219,
- "y": 31.16643115648518,
- "z": 0
- },
- {
- "x": 121.35260055257123,
- "y": 31.165311550786598,
- "z": 0
- },
- {
- "x": 121.35264451648362,
- "y": 31.164778756595926,
- "z": 0
- },
- {
- "x": 121.35257069903504,
- "y": 31.164266139223166,
- "z": 0
- },
- {
- "x": 121.3527395933964,
- "y": 31.161840129615992,
- "z": 0
- },
- {
- "x": 121.35261594211822,
- "y": 31.160483031631124,
- "z": 0
- },
- {
- "x": 121.35303028598638,
- "y": 31.15913507784978,
- "z": 0
- }
- ],
- [{
- "x": 121.31381416174536,
- "y": 31.173294561163896,
- "z": 0
- },
- {
- "x": 121.31893528098777,
- "y": 31.16503208910045,
- "z": 0
- },
- {
- "x": 121.31698881664984,
- "y": 31.16371048577948,
- "z": 0
- },
- {
- "x": 121.31739504671911,
- "y": 31.16194462885501,
- "z": 0
- },
- {
- "x": 121.31615092409753,
- "y": 31.16126834601621,
- "z": 0
- },
- {
- "x": 121.31462430632025,
- "y": 31.16201984561443,
- "z": 0
- },
- {
- "x": 121.31316274059677,
- "y": 31.160264510387556,
- "z": 0
- },
- {
- "x": 121.31416659944752,
- "y": 31.15895330555726,
- "z": 0
- },
- {
- "x": 121.31628077339099,
- "y": 31.15959996815232,
- "z": 0
- },
- {
- "x": 121.31707708415921,
- "y": 31.1582611528663,
- "z": 0
- },
- {
- "x": 121.32182512562508,
- "y": 31.160003164501763,
- "z": 0
- },
- {
- "x": 121.3229785983771,
- "y": 31.15878058813032,
- "z": 0
- },
- {
- "x": 121.32507392067637,
- "y": 31.15759418545812,
- "z": 0
- },
- {
- "x": 121.32703374847145,
- "y": 31.154227191490985,
- "z": 0
- },
- {
- "x": 121.32685538778749,
- "y": 31.15150996204829,
- "z": 0
- },
- {
- "x": 121.3293947025788,
- "y": 31.150651560754508,
- "z": 0
- },
- {
- "x": 121.3289787715014,
- "y": 31.149165138732467,
- "z": 0
- },
- {
- "x": 121.33233212135764,
- "y": 31.15030816527726,
- "z": 0
- },
- {
- "x": 121.3358401685583,
- "y": 31.152175601747718,
- "z": 0
- },
- {
- "x": 121.3392884840699,
- "y": 31.154160207841365,
- "z": 0
- },
- {
- "x": 121.34272004027888,
- "y": 31.15587413621922,
- "z": 0
- },
- {
- "x": 121.34550413532479,
- "y": 31.15753438865423,
- "z": 0
- },
- {
- "x": 121.34689129783092,
- "y": 31.15783684854342,
- "z": 0
- },
- {
- "x": 121.349876341794,
- "y": 31.158456520738092,
- "z": 0
- },
- {
- "x": 121.35269990799088,
- "y": 31.159064637430497,
- "z": 0
- },
- {
- "x": 121.35239139069755,
- "y": 31.16016255568717,
- "z": 0
- },
- {
- "x": 121.35251902666961,
- "y": 31.161601603806915,
- "z": 0
- },
- {
- "x": 121.35243288542387,
- "y": 31.165095928962824,
- "z": 0
- },
- {
- "x": 121.35237092238553,
- "y": 31.166011554330634,
- "z": 0
- },
- {
- "x": 121.3519037161686,
- "y": 31.167008786470195,
- "z": 0
- },
- {
- "x": 121.3478587161376,
- "y": 31.165302327392354,
- "z": 0
- },
- {
- "x": 121.34094326123495,
- "y": 31.162030100817073,
- "z": 0
- },
- {
- "x": 121.33697029395886,
- "y": 31.16833309250413,
- "z": 0
- },
- {
- "x": 121.33526482912758,
- "y": 31.170815983506582,
- "z": 0
- },
- {
- "x": 121.3300506385267,
- "y": 31.169020740661125,
- "z": 0
- },
- {
- "x": 121.32544322389143,
- "y": 31.16753331721317,
- "z": 0
- },
- {
- "x": 121.32384068400313,
- "y": 31.16979422919267,
- "z": 0
- },
- {
- "x": 121.31831508397927,
- "y": 31.172109630126858,
- "z": 0
- }
- ],
- [{
- "x": 121.23756418907722,
- "y": 31.25204958351479,
- "z": 0
- },
- {
- "x": 121.2359335663678,
- "y": 31.242651276616975,
- "z": 0
- },
- {
- "x": 121.24327950842967,
- "y": 31.243111618844317,
- "z": 0
- },
- {
- "x": 121.24439277635044,
- "y": 31.23929340943388,
- "z": 0
- },
- {
- "x": 121.24520576391103,
- "y": 31.23855875639746,
- "z": 0
- },
- {
- "x": 121.24666341933748,
- "y": 31.240193969445425,
- "z": 0
- },
- {
- "x": 121.248574120126,
- "y": 31.238883389654468,
- "z": 0
- },
- {
- "x": 121.24957316552148,
- "y": 31.235069988504467,
- "z": 0
- },
- {
- "x": 121.2530350806222,
- "y": 31.232562340356846,
- "z": 0
- },
- {
- "x": 121.25364709748692,
- "y": 31.229021792865762,
- "z": 0
- },
- {
- "x": 121.2520588543979,
- "y": 31.228368558627455,
- "z": 0
- },
- {
- "x": 121.25390540252931,
- "y": 31.223955077752723,
- "z": 0
- },
- {
- "x": 121.2530789424986,
- "y": 31.222159182988158,
- "z": 0
- },
- {
- "x": 121.25679839926686,
- "y": 31.217054229105234,
- "z": 0
- },
- {
- "x": 121.25500962092444,
- "y": 31.214723065123064,
- "z": 0
- },
- {
- "x": 121.25944017551635,
- "y": 31.210717975244496,
- "z": 0
- },
- {
- "x": 121.26056153588941,
- "y": 31.20840046946333,
- "z": 0
- },
- {
- "x": 121.25850711197234,
- "y": 31.207403059344745,
- "z": 0
- },
- {
- "x": 121.2603719359508,
- "y": 31.205392035994464,
- "z": 0
- },
- {
- "x": 121.26227042625798,
- "y": 31.205273946466036,
- "z": 0
- },
- {
- "x": 121.27289706598678,
- "y": 31.19557693648754,
- "z": 0
- },
- {
- "x": 121.28154768028995,
- "y": 31.19749512451051,
- "z": 0
- },
- {
- "x": 121.28651620321617,
- "y": 31.201339578297116,
- "z": 0
- },
- {
- "x": 121.2880073420067,
- "y": 31.204493911516277,
- "z": 0
- },
- {
- "x": 121.29022431931928,
- "y": 31.20509335336672,
- "z": 0
- },
- {
- "x": 121.29390965201385,
- "y": 31.20244095781758,
- "z": 0
- },
- {
- "x": 121.29693509877501,
- "y": 31.198268111287387,
- "z": 0
- },
- {
- "x": 121.30002185627976,
- "y": 31.1983099132369,
- "z": 0
- },
- {
- "x": 121.29855690752807,
- "y": 31.209243065234233,
- "z": 0
- },
- {
- "x": 121.29796316119037,
- "y": 31.220282782349148,
- "z": 0
- },
- {
- "x": 121.30273636473034,
- "y": 31.2198977980581,
- "z": 0
- },
- {
- "x": 121.30650431740165,
- "y": 31.219898092718612,
- "z": 0
- },
- {
- "x": 121.31466693662834,
- "y": 31.223442307803612,
- "z": 0
- },
- {
- "x": 121.32017338272325,
- "y": 31.22407752612719,
- "z": 0
- },
- {
- "x": 121.32170385876948,
- "y": 31.22443642374149,
- "z": 0
- },
- {
- "x": 121.32315754421998,
- "y": 31.224375662366445,
- "z": 0
- },
- {
- "x": 121.32575953681125,
- "y": 31.22518129048498,
- "z": 0
- },
- {
- "x": 121.33105147728227,
- "y": 31.225876859171215,
- "z": 0
- },
- {
- "x": 121.33363568072438,
- "y": 31.225963936912688,
- "z": 0
- },
- {
- "x": 121.33634667702704,
- "y": 31.226009852146642,
- "z": 0
- },
- {
- "x": 121.33730442954683,
- "y": 31.22773427459837,
- "z": 0
- },
- {
- "x": 121.3404264021786,
- "y": 31.23094507911442,
- "z": 0
- },
- {
- "x": 121.33896208217749,
- "y": 31.23634524864817,
- "z": 0
- },
- {
- "x": 121.33577568582193,
- "y": 31.240433256180633,
- "z": 0
- },
- {
- "x": 121.33312567151678,
- "y": 31.23923076590377,
- "z": 0
- },
- {
- "x": 121.32994797524155,
- "y": 31.237349644608877,
- "z": 0
- },
- {
- "x": 121.32976168220047,
- "y": 31.234039519625362,
- "z": 0
- },
- {
- "x": 121.32024159770803,
- "y": 31.231386985365518,
- "z": 0
- },
- {
- "x": 121.31122215716051,
- "y": 31.229214066244523,
- "z": 0
- },
- {
- "x": 121.29264943919313,
- "y": 31.232998413933927,
- "z": 0
- },
- {
- "x": 121.28796282539214,
- "y": 31.23491756870379,
- "z": 0
- },
- {
- "x": 121.28363864609534,
- "y": 31.24090783276285,
- "z": 0
- },
- {
- "x": 121.28257094917196,
- "y": 31.2458180167782,
- "z": 0
- },
- {
- "x": 121.27689311211255,
- "y": 31.250055030813865,
- "z": 0
- },
- {
- "x": 121.27985448004428,
- "y": 31.253831868309994,
- "z": 0
- },
- {
- "x": 121.2709103980883,
- "y": 31.255509815537213,
- "z": 0
- },
- {
- "x": 121.26665218405257,
- "y": 31.254393999505126,
- "z": 0
- },
- {
- "x": 121.26532839900652,
- "y": 31.255543512788588,
- "z": 0
- },
- {
- "x": 121.25351513097648,
- "y": 31.25294996585441,
- "z": 0
- },
- {
- "x": 121.24481469452851,
- "y": 31.251644860116766,
- "z": 0
- }
- ]
- ]
- //高德转84
- // let sz = [
- // [121.30025, 31.184825],
- // [121.298659, 31.186719],
- // [121.297278, 31.188721],
- // [121.294521, 31.19274],
- // [121.302864, 31.196146],
- // [121.304392, 31.193755],
- // [121.306291, 31.191095],
- // [121.308116, 31.188478],
- // [121.309198, 31.186907],
- // [121.309383, 31.186432],
- // [121.309391, 31.185858],
- // [121.309372, 31.185243],
- // [121.309175, 31.185049],
- // [121.308407, 31.184564],
- // [121.307629, 31.18408],
- // [121.306116, 31.18316],
- // [121.303064, 31.181291]
- // ]
- // let result = {}
- // for (let i = 0; i < sz.length; i++) {
- // result = CoordUtil.gcj02towgs84(sz[i][0], sz[i][1]);
- // arr[1].push({ x: result[0], y: result[1], z: 0 })
- // }
- // console.log(111, arr)
- for (let i = 0; i < arr.length; i++) {
- let target = {
- id: i,
- attributes: {
- name: i,
- },
- position: arr[i],
- label: {
- text: i,
- font: "16px Helvetica",
- color: i == 0 ? "red" : "orange",
- pixelOffset: [0, -50],
- backgroundColor: "red"
- }
- }
- let options = {
- isZoom: false,
- style: {
- color: i == 0 ? "red" : i == 1 ? "orange" : "",
- transparency: 1,
- outline: true,
- outlineColor: 'transparent',
- perPositionHeight: true
- },
- // click: regionLocateCallBack111
- };
- setTimeout(() => {
- window.jMap.Locate.trackLocate(target, options);
- }, 1000)
- }
- },
- /**
- * 安保区域
- * @param {*} status 是否有图层
- * @param {*} id 1大网格 2小网格
- * @param {*} query 搜索内容
- */
- anbao(status, id, query) {
- var that = this
- var color = [
- "#2c6395",
- "#1b6cb6",
- "#40a4ff",
- "#8ac7ff",
- "#b1cce5",
- "#a03523",
- "#d7le00",
- "#ffa192",
- "#dba197",
- "#009081",
- "#00ae9c",
- "#50fed",
- "#4d6700",
- "#729900",
- // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
- // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
- // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
- // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
- // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
- // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
- // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
- // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
- // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
- // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
- // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
- // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
- // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
- // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
- // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
- // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
- ];
- var JmapQuery = new JMapQuery(window.jMap); // JMap为初始化地图时,实例化的JMap对象
- if (status) {
- window.jMap.Locate.clearLocate(); //清楚分布
- // window.jMap.removeLayer(); // 空值清除所有已添加图层
- }
- //中网格
- if (id == 1) {
- setTimeout(() => {
- // 例: 8.1 2 查询图层列表
- var qp2 = new JMapQueryParam({
- queryMapService: "mh_dyn_cywg",
- queryMapLayers: [0],
- // queryGeometry: result[0], // 默认进行属性查询,放开该段注释将在选定的几何空间内进行空间查询
- // queryWhere: "name like '%莘庄镇%' ", // 可自定义查询条件,也可不传该参数
- outFields: ["*"], // 返回字段信息
- callBack: testQueryCallBack2
- });
- JmapQuery.execQuery(qp2);
- // 图层查询完毕的回调函数
- function testQueryCallBack2(obj) {
- var bigNewArr = [];
- var name = [];
- //画线--------------
- var bigArr = obj.features.filter(function(el) {
- // return el.attributes.name.indexOf('新虹街道') > -1
- return el.attributes.name.indexOf('新虹街道') > -1 ||
- el.attributes.name.indexOf('华漕') > -1 ||
- el.attributes.name.indexOf('七宝中片') > -1 ||
- el.attributes.name.indexOf('航华网格') > -1 ||
- el.attributes.name.indexOf('七宝北片网格') > -1 ||
- el.attributes.name.indexOf('紫藤、红松') > -1 ||
- el.attributes.name.indexOf('虹梅区域') > -1
- })
- let arr = []
- for (let i = 0; i < bigArr.length; i++) {
- arr.push([])
- for (let ii = 0; ii < bigArr[i].geometry.rings[0].length; ii++) {
- arr[i].push({
- x: bigArr[i].geometry.rings[0][ii][0],
- y: bigArr[i].geometry.rings[0][ii][1],
- z: 0,
- })
- }
- }
- for (let i = 0; i < arr.length; i++) {
- let target = {
- id: 1000 + i,
- attributes: {
- name: i,
- },
- position: arr[i],
- label: {
- text: i,
- font: "16px Helvetica",
- color: "red",
- pixelOffset: [0, -50],
- backgroundColor: "red"
- }
- }
- var options = {
- isZoom: false,
- style: {
- color: 'rgb(79, 226, 97)',
- transparency: 1,
- outline: true,
- outlineColor: 'transparent',
- perPositionHeight: true
- },
- click: regionLocateCallBack111
- };
- setTimeout(() => {
- window.jMap.Locate.trackLocate(target, options);
- }, 100)
- }
- function regionLocateCallBack111(obj) {
- // console.log(obj); // obj为返回值
- }
- //画线----------------------------------
- //区域----------------------------------
- var bigArr = obj.features.filter(function(el) {
- return el.attributes.name.indexOf('新虹街道') > -1 ||
- el.attributes.name.indexOf('华漕') > -1 ||
- el.attributes.name.indexOf('七宝中片') > -1 ||
- el.attributes.name.indexOf('航华网格') > -1 ||
- el.attributes.name.indexOf('七宝北片网格') > -1 ||
- el.attributes.name.indexOf('紫藤、红松') > -1 ||
- el.attributes.name.indexOf('虹梅区域') > -1
- })
- // console.log(111, bigArr)
- bigArr.forEach(function(item, index) {
- var aaa = item.geometry.rings[0];
- var newArr = aaa.map(function(value, index) {
- var obj = {
- x: value[0],
- y: value[1],
- z: 0.1
- }
- return obj
- })
- bigNewArr.push(newArr);
- name.push(item.attributes.name)
- })
- bigNewArr.forEach(function(item, index) {
- var idx = index;
- setTimeout(() => {
- // 2区域分布
- var target = {
- id: idx,
- attributes: {
- position: item[0],
- name: name[index] == "华漕镇处置网格二(纪王西片区)" ? "闵S1-1(纪王西网格)" : name[index] == "华漕镇处置网格一(纪王东片区)" ? "闵S1-2(纪王东网格)" : name[index] == "华漕镇处置网格四(诸翟北片区)" ? "闵S1-3(诸翟北网格)" : name[index] == "华漕镇处置网格五(诸翟南片区)" ? "闵S1-4(诸翟南网格)" : name[index] == "华漕镇处置网格三(老华漕片区)" ? "闵S1-5(老华漕网格)" : name[index] == "新虹街道处置网格二(爱博)" ? "闵S2-1(爱博网格)" : name[index] == "新虹街道处置网格三(华美)" ? "闵S2-2(华美网格)" : name[index] == "新虹街道处置网格一(枢纽)" ? "闵S2-3(枢纽网格)" : name[index] == "新虹街道处置网格四(航华)" ? "闵S2-4(航华网格)" : name[index] == "七宝镇处置网格一(七宝北片网格)" ? "闵S3-1(七宝北片网格)" : name[index] == "七宝镇处置网格二(七宝中片网格)" ? "闵S3-2(七宝吴宝路网格)" : name[index] == "七宝镇处置网格五(航华网格)" ? "闵S3-3(七宝航华网格)" : name[index] == "虹桥镇处置网格四(紫藤、红松区域)" ? "闵S4-1(紫藤红松网格)" : name[index] == "虹桥镇处置网格二(虹梅区域)" ? "闵S4-2(虹梅网格)" : name[index]
- },
- position: item,
- label: {
- text: name[index] == "华漕镇处置网格二(纪王西片区)" ? "闵S1-1(纪王西网格)" : name[index] == "华漕镇处置网格一(纪王东片区)" ? "闵S1-2(纪王东网格)" : name[index] == "华漕镇处置网格四(诸翟北片区)" ? "闵S1-3(诸翟北网格)" : name[index] == "华漕镇处置网格五(诸翟南片区)" ? "闵S1-4(诸翟南网格)" : name[index] == "华漕镇处置网格三(老华漕片区)" ? "闵S1-5(老华漕网格)" : name[index] == "新虹街道处置网格二(爱博)" ? "闵S2-1(爱博网格)" : name[index] == "新虹街道处置网格三(华美)" ? "闵S2-2(华美网格)" : name[index] == "新虹街道处置网格一(枢纽)" ? "闵S2-3(枢纽网格)" : name[index] == "新虹街道处置网格四(航华)" ? "闵S2-4(航华网格)" : name[index] == "七宝镇处置网格一(七宝北片网格)" ? "闵S3-1(七宝北片网格)" : name[index] == "七宝镇处置网格二(七宝中片网格)" ? "闵S3-2(七宝吴宝路网格)" : name[index] == "七宝镇处置网格五(航华网格)" ? "闵S3-3(七宝航华网格)" : name[index] == "虹桥镇处置网格四(紫藤、红松区域)" ? "闵S4-1(紫藤红松网格)" : name[index] == "虹桥镇处置网格二(虹梅区域)" ? "闵S4-2(虹梅网格)" : name[index],
- font: "14px Helvetica",
- color: "#fff",
- pixelOffset: [0, -40]
- }
- };
- var options = {
- isZoom: false,
- camera: {
- x: 121.4175597,
- y: 31.119248,
- radius: 18000.0,
- offset: { heading: -4, pitch: -70, range: 0 },
- },
- click: regionLocateCallBack,
- style: {
- // color: name[index] == "华漕镇处置网格二(纪王西片区)" ? "#2c6395" : name[index] == "华漕镇处置网格一(纪王东片区)" ? "#1b6cb6" : name[index] == "华漕镇处置网格四(诸翟北片区)" ? "#40a4ff" : name[index] == "华漕镇处置网格五(诸翟南片区)" ? "#8ac7ff" : name[index] == "华漕镇处置网格三(老华漕片区)" ? "#b1cce5" : name[index] == "新虹街道处置网格二(爱博)" ? "#a03523" : name[index] == "新虹街道处置网格三(华美)" ? "#d71e00" : name[index] == "新虹街道处置网格一(枢纽)" ? "#ffa192" : name[index] == "新虹街道处置网格四(航华)" ? "#dba197" : name[index] == "七宝镇处置网格一(七宝北片网格)" ? "#009081" : name[index] == "七宝镇处置网格二(七宝中片网格)" ? "#00ae9c" : name[index] == "七宝镇处置网格五(航华网格)" ? "#50ffed" : name[index] == "虹桥镇处置网格四(紫藤、红松区域)" ? "#b2ec0a" : name[index] == "虹桥镇处置网格二(虹梅区域)" ? "#b2ec4a" : "#729900",
- color: "transparent",
- transparency: 0,
- outline: true,
- outlineColor: 'blue',
- // "#4d6700",
- // "#729900",
- }
- };
- setTimeout(() => {
- jMap.Locate.regionLocate(target, options);
- }, 500)
- // 分布点点击事件的回调函数
- function regionLocateCallBack(obj) {
- console.log(obj)
- that.stores.gridDataChange(obj._attributes);
- }
- }, idx * 1)
- })
- }
- }, 1000)
- }
- //小网格(居委会)
- if (id == 2 && query) {
- let dataddd = []
- // console.log(query)
- let queryName = ""
- for (let i = 0; i < query.length; i++) {
- // console.log(query[i].mapGridName)
- queryName = queryName ? `${queryName},'${query[i].mapGridName}'` : `'${query[i].mapGridName}'`
- }
- // queryName = queryName + ",'涞港星苑筹备组','爱博四村居委','爱博五村居委','爱博二村居委','爱博一村居委','爱博三村居委','万科润园居委','华美路一居委','华美路二居委','沙茂居委','航华一村2居委','航华一村5居委','航华一村7居委','航华一村6居委'"
- console.log(queryName)
- setTimeout(() => {
- var name2 = [];
- var qp3 = new JMapQueryParam({
- queryMapService: "mh_dyn_district",
- queryMapLayers: [2],
- // queryGeometry: result[0], // 默认进行属性查询,放开该段注释将在选定的几何空间内进行空间查询
- // queryWhere: "name like '%纪东村村委会%' ", // 可自定义查询条件,也可不传该参数
- // queryWhere: "grid_type in ('居委网格','村委网格') and subdistrict like '%华漕镇%' ", // 可自定义查询条件,也可不传该参数
- // queryWhere: `name in ('沪星村村委会','九星村村委会','新龙村经济合作社','中春路第二居委会',
- // ) and subdistrict in ('华漕镇','新虹街道','虹桥镇','七宝镇')`, // 可自定义查询条件,也可不传该参数
- // queryWhere: `name in (${queryName}) and subdistrict in ('华漕镇','新虹街道','虹桥镇','七宝镇')`, // 可自定义查询条件,也可不传该参数
- // queryWhere: `subdistrict in ('华漕镇','新虹街道','虹桥镇','七宝镇')`, // 可自定义查询条件,也可不传该参数
- queryWhere: `grid_type in ('居委网格','村委网格') and subdistrict in ('华漕镇','新虹街道','虹桥镇','七宝镇')`, // 可自定义查询条件,也可不传该参数
- outFields: ["*"], // 返回字段信息
- callBack: testQueryCallBack3
- });
- JmapQuery.execQuery(qp3);
- function testQueryCallBack3(obj) {
- console.log(obj)
- let a = []
- for (let i = 0; i < obj.features.length; i++) {
- a[i] = {
- name: obj.features[i].attributes.name,
- subdistrict: obj.features[i].attributes.subdistrict,
- }
- }
- var big2Arr = []
- obj.features.forEach(function(item, index) {
- var b2 = item.geometry.rings;
- b2.forEach(function(item2, index2) {
- var newArr2 = b2[index2].map(function(value, index3) {
- var obj = {
- x: value[0],
- y: value[1],
- z: 0.1
- }
- return obj
- })
- big2Arr.push(newArr2);
- name2.push(item.attributes.name)
- })
- })
- //画线---------------------------------
- let huaxian = []
- for (let i = 0; i < big2Arr.length; i++) {
- huaxian.push([])
- for (let ii = 0; ii < big2Arr[i].length; ii++) {
- huaxian[i].push(
- big2Arr[i][ii]
- )
- }
- }
- for (let i = 0; i < huaxian.length; i++) {
- let target = {
- id: 10000 + i,
- attributes: {
- name: i,
- },
- position: huaxian[i],
- label: {
- text: i,
- font: "16px Helvetica",
- color: "rgba(255,255,255,0.1)",
- pixelOffset: [0, -50],
- backgroundColor: "red"
- }
- }
- var options = {
- isZoom: false,
- style: {
- color: 'rgb(1, 224, 255)',
- transparency: 1,
- outline: true,
- outlineColor: 'transparent',
- perPositionHeight: true
- },
- click: regionLocateCallBack111
- };
- setTimeout(() => {
- window.jMap.Locate.trackLocate(target, options);
- }, 1000)
- }
- function regionLocateCallBack111(obj) {
- // console.log(obj); // obj为返回值
- }
- //画线---------------------------------
- //画区域-----------------------------
- big2Arr.forEach(function(item, index) {
- var idx = index + 1;
- setTimeout(() => {
- // 2区域分布
- var target = {
- id: idx,
- attributes: {
- position: item[0],
- name: name2[index]
- },
- position: item,
- label: {
- text: name2[index],
- font: "12px Helvetica",
- color: "transparent",
- // color: "red",
- pixelOffset: [0, -40]
- }
- };
- var options = {
- isZoom: false,
- click: regionLocateCallBack2,
- style: {
- color: "#68afc1",
- transparency: 0.6,
- outline: true,
- outlineColor: 'blue',
- }
- };
- setTimeout(() => {
- jMap.Locate.regionLocate(target, options);
- }, 500)
- // 分布点点击事件的回调函数
- function regionLocateCallBack2(obj) {
- that.stores.gridDataChange(obj._attributes);
- }
- }, idx * 1)
- })
- //画区域-----------------------------
- }
- }, 2000);
- }
- //大网格
- if (id == 3) {
- setTimeout(() => {
- // 例: 8.1 2 查询图层列表
- var qp2 = new JMapQueryParam({
- queryMapService: "mh_dyn_cywg",
- queryMapLayers: [0],
- // queryGeometry: result[0], // 默认进行属性查询,放开该段注释将在选定的几何空间内进行空间查询
- // queryWhere: "name like '%莘庄镇%' ", // 可自定义查询条件,也可不传该参数
- outFields: ["*"], // 返回字段信息
- callBack: testQueryCallBack2
- });
- JmapQuery.execQuery(qp2);
- // 图层查询完毕的回调函数
- function testQueryCallBack2(obj) {
- var bigNewArr = [];
- var name = [];
- var bigArr = obj.features.filter(function(el) {
- // return el.attributes.name.indexOf('新虹街道') > -1
- return el.attributes.name.indexOf('新虹街道') > -1 ||
- el.attributes.name.indexOf('华漕') > -1 ||
- el.attributes.name.indexOf('七宝中片') > -1 ||
- el.attributes.name.indexOf('航华网格') > -1 ||
- el.attributes.name.indexOf('七宝北片网格') > -1 ||
- el.attributes.name.indexOf('紫藤、红松') > -1 ||
- el.attributes.name.indexOf('虹梅区域') > -1
- })
- //画区域
- // bigArr.forEach(function(item, index) {
- // var aaa = item.geometry.rings[0];
- // var newArr = aaa.map(function(value, index) {
- // var obj = {
- // x: value[0],
- // y: value[1],
- // z: 0.1
- // }
- // return obj
- // })
- // bigNewArr.push(newArr);
- // name.push(item.attributes.name)
- // })
- // bigNewArr.forEach(function(item, index) {
- // var idx = index + 1;
- // setTimeout(() => {
- // // 2区域分布
- // var target = {
- // id: idx,
- // attributes: {
- // position: item[0],
- // name: name[index] == "华漕镇处置网格二(纪王西片区)" ? "闵S1-1(纪王西网格)" : name[index] == "华漕镇处置网格一(纪王东片区)" ? "闵S1-2(纪王东网格)" : name[index] == "华漕镇处置网格四(诸翟北片区)" ? "闵S1-3(诸翟北网格)" : name[index] == "华漕镇处置网格五(诸翟南片区)" ? "闵S1-4(诸翟南网格)" : name[index] == "华漕镇处置网格三(老华漕片区)" ? "闵S1-5(老华漕网格)" : name[index] == "新虹街道处置网格二(爱博)" ? "闵S2-1(爱博网格)" : name[index] == "新虹街道处置网格三(华美)" ? "闵S2-2(华美网格)" : name[index] == "新虹街道处置网格一(枢纽)" ? "闵S2-3(枢纽网格)" : name[index] == "新虹街道处置网格四(航华)" ? "闵S2-4(航华网格)" : name[index] == "七宝镇处置网格一(七宝北片网格)" ? "闵S3-1(七宝北片网格)" : name[index] == "七宝镇处置网格二(七宝中片网格)" ? "闵S3-2(七宝吴宝路网格)" : name[index] == "七宝镇处置网格五(航华网格)" ? "闵S3-3(七宝航华网格)" : name[index] == "虹桥镇处置网格四(紫藤、红松区域)" ? "闵S4-1(紫藤红松网格)" : name[index] == "虹桥镇处置网格二(虹梅区域)" ? "闵S4-2(虹梅网格)" : name[index]
- // },
- // position: item,
- // label: {
- // // text: name[index] == "华漕镇处置网格二(纪王西片区)" ? "闵S1-1(纪王西网格)" : name[index] == "华漕镇处置网格一(纪王东片区)" ? "闵S1-2(纪王东网格)" : name[index] == "华漕镇处置网格四(诸翟北片区)" ? "闵S1-3(诸翟北网格)" : name[index] == "华漕镇处置网格五(诸翟南片区)" ? "闵S1-4(诸翟南网格)" : name[index] == "华漕镇处置网格三(老华漕片区)" ? "闵S1-5(老华漕网格)" : name[index] == "新虹街道处置网格二(爱博)" ? "闵S2-1(爱博网格)" : name[index] == "新虹街道处置网格三(华美)" ? "闵S2-2(华美网格)" : name[index] == "新虹街道处置网格一(枢纽)" ? "闵S2-3(枢纽网格)" : name[index] == "新虹街道处置网格四(航华)" ? "闵S2-4(航华网格)" : name[index] == "七宝镇处置网格一(七宝北片网格)" ? "闵S3-1(七宝北片网格)" : name[index] == "七宝镇处置网格二(七宝中片网格)" ? "闵S3-2(七宝吴宝路网格)" : name[index] == "七宝镇处置网格五(航华网格)" ? "闵S3-3(七宝航华网格)" : name[index] == "虹桥镇处置网格四(紫藤、红松区域)" ? "闵S4-1(紫藤红松网格)" : name[index] == "虹桥镇处置网格二(虹梅区域)" ? "闵S4-2(虹梅网格)" : name[index],
- // font: "14px Helvetica",
- // color: "#fff",
- // pixelOffset: [0, -40]
- // }
- // };
- // var options = {
- // isZoom: false,
- // camera: {
- // x: 121.4175597,
- // y: 31.119248,
- // radius: 9000.0,
- // offset: { heading: -4, pitch: -70, range: 0 },
- // },
- // click: regionLocateCallBack,
- // style: {
- // color: "#5b9bd5",
- // transparency: 0.6,
- // // name[index] == "华漕镇处置网格二(纪王西片区)" ? "#5b9bd5" :
- // // name[index] == "华漕镇处置网格一(纪王东片区)" ? "#5b9bd5" :
- // // name[index] == "华漕镇处置网格四(诸翟北片区)" ? "#5b9bd5" :
- // // name[index] == "华漕镇处置网格五(诸翟南片区)" ? "#5b9bd5" :
- // // name[index] == "华漕镇处置网格三(老华漕片区)" ? "#5b9bd5" :
- // // name[index] == "新虹街道处置网格二(爱博)" ? "#17cfbc" :
- // // name[index] == "新虹街道处置网格三(华美)" ? "#17cfbc" :
- // // name[index] == "新虹街道处置网格一(枢纽)" ? "#17cfbc" :
- // // name[index] == "新虹街道处置网格四(航华)" ? "#17cfbc" :
- // // name[index] == "七宝镇处置网格一(七宝北片网格)" ? "#fca091" :
- // // name[index] == "七宝镇处置网格二(七宝中片网格)" ? "#fca091" :
- // // name[index] == "七宝镇处置网格五(航华网格)" ? "#fca091" :
- // // name[index] == "虹桥镇处置网格四(紫藤、红松区域)" ? "rgb(37, 95, 37)" :
- // // name[index] == "虹桥镇处置网格二(虹梅区域)" ? "rgb(37, 95, 37)" : "rgb(37, 95, 37)",
- // outline: true,
- // outlineColor: 'blue',
- // // "#4d6700",
- // // "#729900",
- // }
- // };
- // setTimeout(() => {
- // jMap.Locate.regionLocate(target, options);
- // }, 500)
- // // 分布点点击事件的回调函数
- // function regionLocateCallBack(obj) {
- // // that.stores.gridDataChange(obj._attributes);
- // }
- // }, idx * 1)
- // })
- }
- }, 1000)
- }
- },
- /**
- * 安保气泡窗
- * @param {*} data
- */
- anbaoPopup(data) {
- var children = []
- if (data.type == 15) {
- children = [
- ["街道:", data.content.streetTown, 12],
- ["安监所人员:", data.content[0].type1, 12],
- ["城运中心人员:", data.content[0].type2, 12],
- ["消防助理员:", data.content[0].type3, 12],
- ]
- }
- if (data.type == 16) {
- children = [
- ["街道:", data.content[0].streetTown, 12],
- ["小网格人员:", data.content[0].type1, 12],
- ["小网格长:", data.content[0].type2, 12],
- ]
- }
- let arrayList = [{
- title: [data.name, true],
- children: []
- }]
- arrayList[0].children = children
- data.gisX = data.position.x
- data.gisY = data.position.y
- this.popup(data, arrayList, true, null, 1)
- },
- /**
- *添加动态图层
- *
- */
- addLayer() {
- var wheres = [];
- wheres[1] = "subdistrict='七宝镇'"; // 1:图层序号 subdistrict='七宝镇' 筛选条件
- var options = {
- click: windowGxLayer,
- wheres: wheres
- };
- setTimeout(() => {
- jMap.addImageryLayer("mh_dyn_cywg", [1], options);
- }, 3000);
- },
- // 点击事件回调函数
- addLayerCallBack(obj) {
- },
- /**
- *安保区域划分
- *
- */
- anbaoMap() {
- let target = {
- id: '100001',
- attributes: {
- name: '大型安保范围',
- },
- position: data[0],
- label: {
- text: "大型安保范围",
- font: "16px Helvetica",
- color: "rgba(255,255,255,0.1)",
- pixelOffset: [0, -50],
- backgroundColor: "red"
- }
- }
- var options = {
- isZoom: true,
- style: {
- color: 'rgb(255,255,0,0.9)',
- transparency: 1,
- outline: true,
- outlineColor: 'transparent',
- perPositionHeight: true
- },
- // click: regionLocateCallBack
- };
- setTimeout(() => {
- window.jMap.Locate.trackLocate(target, options);
- }, 1000)
- },
- // 安保分布点点击事件的回调函数
- regionLocateCallBack(obj) {},
- /**
- * @聚合撒点
- * @param {数据list} data
- * @param {页面类型} pageType
- * @param {类型} type
- */
- initMarkers(data, pageType, type) {
- var _this = this;
- var tag = 1; //1.自定义图标 2.完全自定义 3.默认
- var style = ""; //地图最大化小图标
- var points = []; //地图撒点处理数据存储
- var options = {
- style: { pixelRange: 10 },
- isZoom: true,
- click: clusterMapCallBack,
- };
- jMap.ClusterMap.show(data, options);
- },
- clickFlag(val) {},
- randomColor() {
- var color = "#";
- //for循环中,如果后面仅有一条语句,{}可省略不写
- //随机生成6位0-15之间的数字,再用toString(16)将数字转成16进制
- for (var i = 0; i < 6; i++) color += parseInt(Math.random() * 16).toString(16);
- return color;
- },
- removeMarkers(lnglats) {
- this.map.remove(lnglats);
- },
- /**
- *街镇切换
- */
- streetTownSwitch(data) {
- let sf = 2800.0;
- if (data.id == 12) {
- //区缩放比例调整
- sf = 18000.0;
- }
- var options = {
- area: data.id,
- base_layer_name: "dark",
- model_data_name: "dark",
- isShowDistrictLabel: true,
- camera: {
- x: data.x,
- y: data.y,
- radius: sf,
- offset: { heading: 4, pitch: -89, range: 0 },
- },
- };
- jMap.switchStreet(options);
- },
- /**
- * 点分布(撒点)
- * @param {坐标信息} lnglats
- * @param {页面类型} type
- */
- addMarker(lnglats, pageType, type) {
- window.jMap.Locate.clearLocate();
- let that = this
- let icon = "";
- let arr = []
- let arr1 = []
- let arr2 = []
- let arr3 = []
- let arr4 = []
- let arr5 = []
- var target = lnglats.map((val, ind) => {
- var wgs84 = CoordUtil.gcj02towgs84(Number(val.gisX) || Number(val.longitude), Number(val.gisY) || Number(val.latitude))
- var x = wgs84[0]
- var y = wgs84[1]
- if (pageType == "enforcement-dynamic" ||
- pageType == "self-management" ||
- pageType == "comprehensive-disposal" ||
- pageType == "rescue-station" ||
- pageType == "security-plan" ||
- pageType == "fire-signs" ||
- pageType == "fire-data-analysis" ||
- pageType == "water-sources") {
- let marker = {
- id: ind + 1,
- attrbutes: val,
- position: {
- x: x,
- y: y,
- // x: Number(val.gisX) || Number(val.longitude),
- // y: Number(val.gisY) || Number(val.latitude),
- z: 0
- },
- image: {
- url: type == "双随机执法单位" ? this.stores.sadianIcon.ssjzf : type == "安全检查单位" ? this.stores.sadianIcon.aqjcdw : type == "举报投诉" ? this.stores.sadianIcon.jbts : type == "执法记录仪" && val.type == "执法记录仪" ? this.stores.sadianIcon.zfjly :
- type == "执法记录仪" && val.type == "国家会展中心" ? this.stores.sadianIcon.hzzx :
- type == "重点单位" ? this.stores.sadianIcon.zddw : type == "龙湖天街(试点)" ? this.stores.sadianIcon.lhtj : type == "一般单位" ? this.stores.sadianIcon.ybdw : type == "九小场所" ? this.stores.sadianIcon.jxcs : type == "其他单位" ? this.stores.sadianIcon.qtdw :
- type == "厂房" ? this.stores.sadianIcon.cf : type == "仓库" ? this.stores.sadianIcon.ck :
- type == "车辆" && val.type != "国家会展中心" ? this.stores.sadianIcon.xfc : type == "历史警情" && val.type != "国家会展中心" ? this.stores.sadianIcon.lsjq :
- type == "历史火灾" && val.type != "国家会展中心" ? this.stores.sadianIcon.lshz : val.type == "国家会展中心" ? this.stores.sadianIcon.hzzx :
- type == "亡人火灾" ? this.stores.sadianIcon.wrhz : type == "伤人火灾" ? this.stores.sadianIcon.srhz :
- type == "消火栓可用" ? this.stores.sadianIcon.xhs : type == "消火栓不可用" ? this.stores.sadianIcon.xhsH :
- type == "天然水源" ? this.stores.sadianIcon.trsy : type == "科普教育基地" ? this.stores.sadianIcon.kpjyjd :
- type == "消防站" ? this.stores.sadianIcon.xfz : type == "高层建筑覆盖" && val.stationType == 1 ? this.stores.sadianIcon.xfdjl :
- type == "高层建筑覆盖" && val.stationType == 2 ? this.stores.sadianIcon.xfdj2 : type == "高层建筑覆盖" && val.stationType == 3 ? this.stores.sadianIcon.xfdj3 :
- type == "高层建筑覆盖" && val.stationType == 4 ? this.stores.sadianIcon.zzd : type == "高层建筑覆盖" && val.stationType == 5 ? this.stores.sadianIcon.jzwxxfz :
- type == "高层建筑覆盖" && val.stationType == 111 ? this.stores.sadianIcon.dian : type == "高层建筑" ? this.stores.sadianIcon.gcggjz :
- type == "专职队" ? this.stores.sadianIcon.zzd : type == "微型消防站" ? this.stores.sadianIcon.jzwxxfz : type == "大型综合体" && val.facilityType == "lhtj" ? this.stores.sadianIcon.lhtj :
- type == "大型综合体" && (val.facilityType == 2 || val.facilityType == 3) ? this.stores.sadianIcon.dxzht : type == "重大火灾隐患" ? this.stores.sadianIcon.lsjq :
- type == "企业消防" && val.facilityType == 13 ? this.stores.sadianIcon.zddw : type == "企业消防" && val.facilityType == 14 ? this.stores.sadianIcon.ybdw :
- type == "社区消防" && val.facilityType == 15 ? this.stores.sadianIcon.zddw : type == "社区消防" && val.facilityType == 16 ? this.stores.sadianIcon.ybdw :
- type == "一级微型消防站" ? this.stores.sadianIcon.yjxfz : type == "街镇专职消防队" ? this.stores.sadianIcon.jzzzxfd : type == "中小学" ? this.stores.sadianIcon.zs : type == "幼儿园" ? this.stores.sadianIcon.yey : type == "其他学校" ? this.stores.sadianIcon.qtxx :
- type == "三合一" ? this.stores.sadianIcon.shy : type == "实时警情" ? this.stores.sadianIcon.ssjq :
- type == "本年度重点事项推进情况" && val.status == 1 ? this.stores.sadianIcon.ywc : type == "本年度重点事项推进情况" && val.status == 2 ? this.stores.sadianIcon.jxz : type == "本年度重点事项推进情况" && val.status == 3 ? this.stores.sadianIcon.zbz :
- type == "高风险" ? this.stores.sadianIcon.gfx : type == "较高风险" ? this.stores.sadianIcon.jgfx : type == "一般风险" ? this.stores.sadianIcon.ybfx : type == "低风险" ? this.stores.sadianIcon.dfx :
- type == "单位巡检" ? this.stores.sadianIcon.dwxj : type == "物联网设备" ? this.stores.sadianIcon.dwxj : type == "监控视频" ? this.stores.sadianIcon.ssjq : type == "监督检查" ? this.stores.sadianIcon.jdjc : type == "养老机构" ? this.stores.sadianIcon.xfdjl : type == "医疗机构" ? this.stores.sadianIcon.zzd : type == "流动消防站(一级)" ? this.stores.sadianIcon.ldxfzyj : type == "流动消防站(二级)" ? this.stores.sadianIcon.ldxfzej : type == "重点微型消防站" ? this.stores.sadianIcon.zdwxxfz :
- this.stores.sadianIcon.trsy,
- // this.jqzhczIcon3 : val.type == "4" ?
- // this.jqzhczIcon4 : val.type == "5" ?
- // this.jqzhczIcon5 : val.type == "消火栓" && val.status == "1" ?
- // this.jqzhczIcon5 : val.type == "消火栓" && val.status == "2" ?
- // this.jqzhczIcon51 : val.type == "天然水源" ?
- // this.jqzhczIcon7 : this.xfzfdtIcon4,
- width: val.type == "国家会展中心" ? 83 : type == "高层建筑覆盖" && val.stationType == 111 ? 7 : type == 111 ? 74 : 19.5,
- height: val.type == "国家会展中心" ? 59 : type == "高层建筑覆盖" && val.stationType == 111 ? 7 : type == 111 ? 66 : 25,
- },
- };
- if (type == "高层建筑覆盖" && val.stationType == 1) {
- arr1.push(val)
- }
- if (type == "高层建筑覆盖" && val.stationType == 2) {
- arr2.push(val)
- }
- if (type == "高层建筑覆盖" && val.stationType == 3) {
- arr3.push(val)
- }
- if (type == "高层建筑覆盖" && val.stationType == 4) {
- arr4.push(val)
- }
- if (type == "高层建筑覆盖" && val.stationType == 5) {
- arr5.push(val)
- }
- return marker;
- } else {
- let marker = {
- id: ind + 1,
- attrbutes: val,
- position: { x: val.gisBaiDuX, y: val.gisBaiDuY, z: 0 },
- image: { url: icon, width: 300, height: 300 },
- };
- return marker;
- }
- });
- if (type == "高层建筑覆盖") {
- if (arr1.length > 0) {
- this.bufferL1(arr1)
- }
- if (arr2.length > 0) {
- this.bufferL2(arr2)
- }
- if (arr3.length > 0) {
- this.bufferL3(arr3)
- }
- if (arr4.length > 0) {
- this.bufferL4(arr4)
- }
- if (arr5.length > 0) {
- this.bufferL5(arr5)
- }
- // this.bufferL(arr)
- }
- //消防水源
- if (pageType == "water-sources") {
- var array = {
- clusterId: 100001,
- clusterData: []
- }
- var target1 = lnglats.map((val, ind) => {
- var wgs84 = CoordUtil.gcj02towgs84(Number(val.gisX) || Number(val.longitude), Number(val.gisY) || Number(val.latitude))
- var x = wgs84[0]
- var y = wgs84[1]
- val.type2 = type
- var array1 = {
- attributes: val,
- position: {
- x: x,
- y: y,
- z: 0,
- },
- image: {
- url: type == "消火栓可用" ? this.stores.sadianIcon.xhs : type == "消火栓不可用" ? this.stores.sadianIcon.xhsH : type == "天然水源" ? this.stores.sadianIcon.trsy : this.stores.sadianIcon.trsy,
- width: 19.5,
- height: 25,
- }
- }
- array.clusterData.push(array1)
- })
- var options = {
- style: { pixelRange: 60 },
- isZoom: true,
- click: this.clusterMapCallBack
- };
- window.jMap.ClusterMap.show(array, options)
- } else {
- //撒点类型
- window.jMap.Locate.pointLocate(target, {
- //撒点
- isZoom: false,
- //animate: { "show": true },
- scaleByDistance: {
- minScaling: 1,
- maxScaling: 1,
- minDistance: 50, //最小距离
- maxDistance: 120000 //最大距离
- },
- click: (val) => {
- //消防执法
- if (pageType == "enforcement-dynamic") {
- if (type == "安全检查单位" || type == "双随机执法单位") {
- this.$axios
- .get(
- this.$api.siaeall.one +
- "?" +
- this.$qs.stringify({
- companyId: val.attrbutes.number,
- companyName: val.attrbutes.name,
- })
- )
- .then((res) => {
- res.data[0].company = val._attrbutes.name;
- res.data[0].streetTown = val._attrbutes.streetTown;
- let arrayList = [{
- title: [res.data[0].company, res.data[0].company ? true : false],
- children: [
- ["单位地址:", res.data[0].companyAddress, 24],
- ["负责人:", res.data[0].linkPerson, 10],
- ["联系电话:", res.data[0].linkPhone, 14],
- ["历史火灾次数:", res.data[0].fireCount, 12],
- ],
- },
- {
- title: ["行政许可情况", res.data[0].processDate && res.data[0].carefullyCheckDate && res.data[0].securityCheckDates],
- children: [
- ["审核时间:", res.data[0].processDate, 12],
- ["验收时间:", res.data[0].carefullyCheckDate, 12],
- ["安检时间:", res.data[0].securityCheckDates, 12],
- ],
- },
- {
- title: ["历史检查情况", res.data[0].inspectCompany && res.data[0].fireHazard && res.data[0].rectificateFireHazard && res.data[0].punishmentDecision && res.data[0].orderThreeStops && res.data[0].correctionNotice && res.data[0].temporarySeizure && res.data[0].penaltyAmount],
- children: [
- ["检查:", res.data[0].inspectCompany + "(家)", 8],
- ["隐患:", res.data[0].fireHazard + "(起)", 8],
- ["整改:", res.data[0].rectificateFireHazard + "(起)", 8],
- ["行罚:", res.data[0].punishmentDecision + "(份)", 8],
- ["三停:", res.data[0].orderThreeStops + "(家)", 8],
- ["责改:", res.data[0].correctionNotice + "(份)", 8],
- ["临封:", res.data[0].temporarySeizure + "(份)", 8],
- ["罚金:", res.data[0].penaltyAmount + "(万元)", 8],
- ],
- },
- {
- title: ["相关火灾情况", res.data[0].fireTime && res.data[0].disposalDuration && res.data[0].burnedArea && res.data[0].fireGrade && res.data[0].mobilizeVehicles && res.data[0].squadron && res.data[0].status && res.data[0].initialFuelType1],
- children: [
- ["报警时间:", res.data[0].fireTime, 12],
- ["处置时长:", res.data[0].disposalDuration, 12],
- ["过火面积:", res.data[0].burnedArea, 12],
- ["火灾等级:", res.data[0].fireGrade, 12],
- ["调动车辆:", res.data[0].mobilizeVehicles + "(辆)", 12],
- ["所属中队:", res.data[0].squadron, 12],
- ["状况:", res.data[0].status, 12],
- ["起火物:", res.data[0].initialFuelType1, 12],
- ],
- },
- ];
- this.popup(val._attrbutes, arrayList, true)
- });
- } else if (type == "举报投诉") {
- let arrayList = [{
- title: [val._attrbutes.name, true],
- children: [
- ],
- }]
- this.popup(val._attrbutes, arrayList, true)
- } else if (type == "执法记录仪") {
- let arrayList = [{
- title: [val._attrbutes.groupName, true],
- children: [
- ["执法人:", val._attrbutes.name, 12],
- ],
- type: type,
- url: val._attrbutes.url,
- },
- ]
- this.popup(val._attrbutes, arrayList, true)
- } else if (type == "重大火灾隐患") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [val.attrbutes.facilityName, true],
- children: [
- ["地址:", val.attrbutes.address, 24],
- ["分类等级:", val.attrbutes.address, 24],
- ["基础信息:", msgParse.test1, 24],
- ["消防安全隐患情况:", msgParse.test2, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- } else if (type == "三合一") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [val.attrbutes.facilityName, true],
- children: [
- ["单位地址:", val.attrbutes.address.replace("\t", ""), 24],
- ["单位类别:", "三合一九小场所", 24],
- ["单位法人:", val.attrbutes.facilityName.replace("\t", ""), 24],
- ["检查人员姓名:", msgParse.test1, 24],
- ["检查时间:", msgParse.test3, 24],
- ["单位使用性质:", msgParse.test4, 24],
- ["单位所属街道:", msgParse.test8, 24],
- ["消消防安全责任人:", msgParse.test10, 24],
- ["消防安全管理人(联系人):", msgParse.test11, 24],
- ["联系电话(手机):", msgParse.test12, 24],
- ["单位(场所)面积(m²):", msgParse.test17, 24],
- ["地上:", msgParse.test18, 24],
- ["地下:", msgParse.test19, 24],
- ["建筑性质:", msgParse.test21, 24],
- ["建筑结构:", msgParse.test22, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- } else if (type == "本年度重点事项推进情况") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [val.attrbutes.facilityName, true],
- children: [
- ["街道名称:", val.attrbutes.streetTown, 24],
- ["地址:", val.attrbutes.address, 24],
- ["状态:", val.attrbutes.status == 1 ? "已完成" : val.attrbutes.status == 2 ? "施工中" : val.attrbutes.status == 3 ? "招标中" : "", 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- }
- //企业自主
- if (pageType == "self-management") {
- if (val.attrbutes.type == "重点单位") {
- console.log(111111111111111111)
- // this.elementInfo(val.attrbutes, "重点单位")
- that.stores.zddwIdSD(val.attrbutes.companyId);
- } else if (val.attrbutes.type == "大型综合体") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [val.attrbutes.facilityName, true],
- children: [
- ["地址:", val.attrbutes.address, 24],
- ["类型:", val.attrbutes.facilityType == 2 ? "5W平大型商业综合体" : val.attrbutes.facilityType == 3 ? "3-5万平大型商业综合体" : "", 24],
- ["平面布局:", msgParse.planeLayout, 24],
- ["用火用电用气管理:", msgParse.fireGasManage, 24],
- ["油烟管道管理:", msgParse.oilFumeManage, 24],
- ["消防设施:", msgParse.fireFacility, 24],
- ["其他安全管理:", msgParse.otherSecurityManage, 24],
- ["合计汇总:", msgParse.totalSummary, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- } else if (val.attrbutes.type == "中小学" || val.attrbutes.type == "幼儿园" || val.attrbutes.type == "其他学校") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let phone = val.attrbutes.contactPhone
- let arrayList = [{
- title: [val.attrbutes.facilityName, true],
- children: [
- ["机构简称:", msgParse.test1, 24],
- // ["学校办别:", val.attrbutes.facilityType, 24],
- ["学校类型:", val.attrbutes.type, 24],
- ["所在街镇:", val.attrbutes.streetTown, 24],
- ["地址:", msgParse.address, 24],
- ["法人代表:", val.attrbutes.contact, 24],
- ["手机:", phone.length > 8 ? phone.substring(0, 3) + '****' + phone.substring(phone.length - 3, phone.length) : phone.substring(0, 2) + '***' + phone.substring(phone.length - 3, phone.length), 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- } else if (val.attrbutes.facilityType == "22") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [val.attrbutes.facilityName, true],
- children: [
- ["单位地址:", msgParse.address, 24],
- ["单位负责人:", val.attrbutes.contact, 24],
- ["负责人电话:", val.attrbutes.contactPhone, 24],
- ["巡检部位:", msgParse.test1, 24],
- ["巡检人员:", msgParse.test2, 24],
- ["巡检情况:", msgParse.test3, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- } else if (type == "物联网设备") {
- let arrayList = [{
- title: [val.attrbutes.buildName, true],
- children: [
- ["建筑地址:", val.address, 24],
- ["建筑面积:", val.attrbutes.buildArea, 24],
- ["建筑高度:", val.attrbutes.buildHigh, 24],
- ["地上(层):", val.attrbutes.aboveFloor, 24],
- ["地下(层):", val.attrbutes.underFloor, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- } else {
- let arrayList = [{
- title: ["单位详情", val.attrbutes.companyName ? true : false],
- children: [
- ["单位名称:", val.attrbutes.companyName, 24],
- ["单位类型:", val.attrbutes.companyTypeName, 24],
- ["联系电话:", val.attrbutes.linkPhone, 24],
- ["地址:", val.attrbutes.address, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- }
- //大型安保 、火灾数据分析
- if (pageType == "security-plan") {
- if (type == "监控视频") {
- let arrayList = [{
- title: ["监控视频", true],
- children: [
- ["监控名称:", val.attrbutes.name, 24],
- ["监控地址:", val.attrbutes.installPlace, 24],
- ],
- url: val.attrbutes.viewUrl,
- id: val.attrbutes.id
- }, ];
- that.stores.jkspChange(arrayList);
- }
- if (type == "监督检查") {
- let arrayList = [{
- title: ["监督检查", true],
- children: [
- ["检查员名称:", val.attrbutes.checkName, 24],
- ["检查人员所属单位:", val.attrbutes.subordinateCompany, 24],
- ["检查时间:", val.attrbutes.checkTime, 24],
- ["单位类型:", val.attrbutes.companyType, 24],
- ["单位使用性质:", val.attrbutes.companyUseNature, 24],
- ["单位法人:", val.attrbutes.companyName, 24],
- ["单位(场所)实际名称:", val.attrbutes.companyActualName, 24],
- ["网格号:", val.attrbutes.gridNum, 24],
- ["所辖派出所:", val.attrbutes.subordinatePoliceStation, 24],
- ["街镇:", val.attrbutes.street, 24],
- ["单位地址:", val.attrbutes.companyAddress, 24],
- ["消防安全责任人姓名:", val.attrbutes.fireDutyName, 24],
- ["消防安全管理人姓名:", val.attrbutes.fireManageName, 24],
- ["联系电话:", val.attrbutes.phone, 24],
- // ["隐患图片:", val.attrbutes.hiddImage ? JSON.parse(val.attrbutes.hiddImage) : NULL, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- //疏导区单位情况----------------------
- if (type == "养老机构") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [type, true],
- children: [
- ["单位名称:", val.attrbutes.facilityName, 24],
- ["地址:", val.attrbutes.address, 24],
- ["所属街镇:", val.attrbutes.streetTown, 24],
- ["隐患问题:", msgParse.test1, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (type == "医疗机构") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [type, true],
- children: [
- ["单位名称:", val.attrbutes.facilityName, 24],
- ["地址:", val.attrbutes.address, 24],
- ["所属街镇:", val.attrbutes.streetTown, 24],
- ["描述:", msgParse.test1, 24],
- ["隐患问题:", msgParse.test2, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (type == "流动消防站(一级)") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [val.attrbutes.facilityName, true],
- children: [
- ["街镇:", val.attrbutes.streetTown, 24],
- ["驻防位置:", val.attrbutes.address, 24],
- ["保卫区域:", val.attrbutes.facilityName, 24],
- ["负责人:", val.attrbutes.contact, 24],
- ["联系电话:", val.attrbutes.contactPhone, 24],
- ["支队:", msgParse.test1, 24],
- ["辖区中队:", msgParse.test2, 24],
- ["驻防车辆:", msgParse.test3, 24],
- ["车型/跟车人数:", `${msgParse.test4}/ ${msgParse.test5}`, 24],
- ["设立原因:", msgParse.test6, 24],
- ["驻防时间:", msgParse.test7, 24],
- ["视频设备编号:", msgParse.test8, 24],
- ["跟车人员姓名及岗位1:", `${msgParse.test10} ${msgParse.test9}`, 24],
- ["跟车人员姓名及岗位2:", `${msgParse.test12} ${msgParse.test11}`, 24],
- ["跟车人员姓名及岗位3:", `${msgParse.test14} ${msgParse.test14}`, 24],
- ["跟车人员姓名及岗位4:", `${msgParse.test16} ${msgParse.test15}`, 24],
- ["跟车人员姓名及岗位5:", `${msgParse.test18} ${msgParse.test17}`, 24],
- ["跟车人员姓名及岗位6:", `${msgParse.test20} ${msgParse.test19}`, 24],
- ["跟车人员姓名及岗位7:", `${msgParse.test22} ${msgParse.test21}`, 24],
- ["户号:", msgParse.test23, 24],
- ["车型:", msgParse.test24, 24],
- ["车辆号牌:", msgParse.test25, 24],
- ["所属单位:", msgParse.test26, 24],
- ["电台呼号:", msgParse.test27, 24],
- ["车辆类型:", `${msgParse.test28} ${msgParse.test29} ${msgParse.test30} ${msgParse.test31} ${msgParse.test32}`, 24],
- ["总质量:", msgParse.test33, 24],
- ["乘员数:", msgParse.test34, 24],
- ["云梯高度(米)、油箱容量(升):", `${msgParse.test35} 、${msgParse.test36}`, 24],
- ["发动机功率(千瓦):", msgParse.test37, 24],
- ["水泵流量(升/分钟):", msgParse.test38, 24],
- ["泡沫流量(升/分钟):", msgParse.test39, 24],
- ["水箱容量(吨):", msgParse.test40, 24],
- ["名称修改为(载水量):", msgParse.test41, 24],
- ["泡沫容量(吨):", msgParse.test42, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (type == "流动消防站(二级)") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [val.attrbutes.facilityName, true],
- children: [
- ["街镇:", val.attrbutes.streetTown, 24],
- ["驻防位置:", val.attrbutes.address, 24],
- ["保卫区域:", val.attrbutes.facilityName, 24],
- ["负责人:", val.attrbutes.contact, 24],
- ["联系电话:", val.attrbutes.contactPhone, 24],
- ["人数:", msgParse.test1, 24],
- ["设立原因:", msgParse.test2, 24],
- ["驻防时间:", msgParse.test3, 24],
- ["定位设备编号:", msgParse.test4, 24],
- ["对讲设备编号:", msgParse.test5, 24],
- ["跟车人员姓名及岗位:", `${msgParse.test7} ${msgParse.test6}`, 24],
- ["跟车人员姓名及岗位:", `${msgParse.test9} ${msgParse.test8}`, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (type == "重点微型消防站") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [val.attrbutes.facilityName, true],
- children: [
- ["街镇:", val.attrbutes.streetTown, 24],
- ["地址:", val.attrbutes.address, 24],
- ["名称:", val.attrbutes.facilityName, 24],
- ["负责人:", val.attrbutes.contact, 24],
- ["联系电话:", val.attrbutes.contactPhone, 24],
- ["支队:", msgParse.test1, 24],
- ["性质:", msgParse.test2, 24],
- ["固定电话:", msgParse.test3, 24],
- ["是否配备电动车:", msgParse.test5, 24],
- ["备注:", msgParse.test6, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (type == "宾馆酒店" || type == "酒店/宾馆") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [type, true],
- children: [
- ["宾馆酒店名称:", val.attrbutes.facilityName, 24],
- ["街镇:", val.attrbutes.streetTown, 24],
- ["地址:", val.attrbutes.address, 24],
- ["房间数:", msgParse.test1, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (type == "大型商业综合体") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [type, true],
- children: [
- ["单位名称:", val.attrbutes.facilityName, 24],
- ["街镇:", val.attrbutes.streetTown, 24],
- ["地址:", val.attrbutes.address, 24],
- ["管理人:", msgParse.test1, 24],
- ["电话:", msgParse.test2, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (type == "厂房仓库" || type == "厂房/仓库") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [type, true],
- children: [
- ["单位名称:", val.attrbutes.facilityName, 24],
- ["街镇:", val.attrbutes.streetTown, 24],
- ["地址:", val.attrbutes.address, 24],
- // ["所属单位:",msgParse.test1, 24],
- // ["公司名称:",msgParse.test2, 24],
- ["公司负责人及联系方式:", `${msgParse.test3} ${msgParse.test4}`, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (type == "批发市场") {
- // let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [type, true],
- children: [
- ["单位名称:", val.attrbutes.facilityName, 24],
- ["街镇:", val.attrbutes.streetTown, 24],
- ["地址:", val.attrbutes.address, 24],
- ["联系人:", val.attrbutes.contact, 24],
- ["联系电话:", val.attrbutes.contactPhone, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (type == "规模租赁公寓") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [type, true],
- children: [
- ["单位名称:", val.attrbutes.facilityName, 24],
- ["街镇:", val.attrbutes.streetTown, 24],
- ["地址:", val.attrbutes.address, 24],
- ["联系人:", val.attrbutes.contact, 24],
- ["联系电话:", val.attrbutes.contactPhone, 24],
- ["建筑面积 ( 平方米 ):", msgParse.test1, 24],
- ["房间数量(间):", msgParse.test2, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (type == "三合一场所") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [type, true],
- children: [
- ["单位名称:", val.attrbutes.facilityName, 24],
- ["街镇:", val.attrbutes.streetTown, 24],
- ["地址:", val.attrbutes.address, 24],
- ["联系人:", val.attrbutes.contact, 24],
- ["联系电话:", val.attrbutes.contactPhone, 24],
- ["住宿人员数量:", msgParse.test1, 24],
- ["是否整改:", msgParse.test2, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- // if (type == "重点微型消防站") {
- // let msgParse = JSON.parse(val.attrbutes.extendData)
- // console.log(msgParse)
- // let arrayList = [{
- // title: [type, true],
- // children: [
- // ["单位名称:", val.attrbutes.facilityName, 24],
- // ["街镇:", val.attrbutes.streetTown, 24],
- // ["地址:", val.attrbutes.address, 24],
- // ["联系人:", val.attrbutes.contact, 24],
- // ["联系电话:", val.attrbutes.contactPhone, 24],
- // ["支队:", msgParse.test1, 24],
- // ["性质:", msgParse.test2, 24],
- // ["固定电话:", msgParse.test3, 24],
- // ["是否配备电动车:", msgParse.test5, 24],
- // ["备注:", msgParse.test6, 24],
- // ],
- // }, ];
- // console.log(arrayList)
- // this.popup(val._attrbutes, arrayList, true)
- // }
- //疏导区单位情况----------------------
- //四色分级
- if (type == "高风险" || type == "较高风险" || type == "一般风险" || type == "低风险") {
- if (val.attrbutes.extendData) {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- //九小场所
- if (val.attrbutes.facilityType == 39) {
- let arrayList = [{
- title: [val.attrbutes.facilityName, true],
- children: [
- ["所属街镇:", val.attrbutes.streetTown, 12],
- ["网格号:", msgParse.facilityNum, 12],
- ["位置:", val.attrbutes.address, 24],
- ["统一社会代码:", msgParse.test5, 24],
- ["场所面积:", msgParse.test7, 12],
- ["安全责任人:", val.attrbutes.contact, 12],
- ["安全管理人:", msgParse.test6, 12],
- ["单位类型:", msgParse.test3, 12],
- ["单位使用性质:", msgParse.test4, 12],
- ["建筑性质:", msgParse.test8, 12],
- ["建筑结构:", msgParse.test9, 12],
- ["隐患扣分:", msgParse.test111, 12],
- // ["隐患等级:", val.attrbutes.address, 24],
- ["风险等级:", msgParse.test112, 12],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- //消防安全重点单位
- if (val.attrbutes.facilityType == 1000) {
- let arrayList = [{
- title: [val.attrbutes.facilityName, true],
- children: [
- ["所属街镇:", val.attrbutes.streetTown, 12],
- ["网格号:", msgParse.facilityNum, 12],
- ["位置:", val.attrbutes.address, 24],
- ["统一社会代码:", msgParse.test5, 24],
- ["场所面积:", msgParse.test7, 12],
- ["安全责任人:", val.attrbutes.contact, 12],
- ["安全管理人:", msgParse.test6, 12],
- ["单位类型:", msgParse.test3, 12],
- ["单位使用性质:", msgParse.test4, 12],
- ["建筑性质:", msgParse.test8, 12],
- ["建筑结构:", msgParse.test9, 12],
- ["隐患扣分:", msgParse.test111, 12],
- // ["隐患等级:", val.attrbutes.address, 24],
- ["风险等级:", msgParse.test112, 12],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- }
- }
- //疏导区基本情况----------------------
- if (type == "学校") {
- let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [type, true],
- children: [
- ["单位名称:", val.attrbutes.facilityName, 24],
- ["街镇:", val.attrbutes.streetTown, 24],
- ["地址:", val.attrbutes.address, 24],
- ["联系人:", val.attrbutes.contact, 24],
- ["联系电话:", val.attrbutes.contactPhone, 24],
- ["场所名称:", msgParse.test1, 24],
- ["法定代表人:", msgParse.test2, 24],
- ["主标签:", msgParse.test3, 24],
- ["次标签:", msgParse.test4, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (type == "居民小区") {
- // let msgParse = JSON.parse(val.attrbutes.extendData)
- let arrayList = [{
- title: [type, true],
- children: [
- ["单位名称:", val.attrbutes.facilityName, 24],
- ["街镇:", val.attrbutes.streetTown, 24],
- ["地址:", val.attrbutes.address, 24],
- ["联系人:", val.attrbutes.contact, 24],
- ["联系电话:", val.attrbutes.contactPhone, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- }
- //火灾数据分析
- if (pageType == "fire-data-analysis") {
- if (type == "历史火灾") {
- let arrayList = [{
- title: ["案件详情", true],
- children: [
- ["案件编号:", val.attrbutes.ajbh, 24],
- ["案件描述:", val.attrbutes.bcxx, 24],
- ["报警时间:", val.attrbutes.tzsj, 24],
- ["案件类型:", val.attrbutes.ajlx, 24],
- ["警情类别:", type, 24],
- ["警情等级:", val.attrbutes.ajdj, 24],
- ["调动车辆:", val.attrbutes.cdcl, 24],
- ["处置对象:", val.attrbutes.czdx, 24],
- ["主责中队:", val.attrbutes.zhongdui, 24],
- ["案件状态:", val.attrbutes.ajzt, 24],
- ["到场时间:", val.attrbutes.cssj, 24],
- ["控制时间:", val.attrbutes.kzsj, 24],
- ["熄灭时间:", val.attrbutes.xmsj, 24],
- ["返队时间:", val.attrbutes.fdsj, 24],
- ["所属街道:", val.attrbutes.streettown, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (type == "伤人火灾" || type == "亡人火灾") {
- let arrayList = [{
- title: ["案件详情", true],
- children: [
- ["火灾序号:", val.attrbutes.fireNumber, 24],
- ["所属街道:", val.attrbutes.street, 24],
- ["起火地点:", val.attrbutes.fireAddress, 24],
- ["起火时间:", val.attrbutes.fireTime, 24],
- ["直接财产损失:", val.attrbutes.directPropertyLoss + "万", 24],
- ["过火面积:", val.attrbutes.burnedArea + "㎡", , 24],
- ["受灾户数:", val.attrbutes.affectedHouse + "户", 24],
- ["受灾人数:", val.attrbutes.victimNumber + "人", 24],
- ["死亡人数:", val.attrbutes.deathToll + "人", 24],
- ["受伤人数:", val.attrbutes.injuredNumber + "人", 24],
- ["起火经过:", val.attrbutes.fireProcess, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- }
- //消防救援站点
- if (pageType == "rescue-station") {
- if (type == "科普教育基地") {
- let arrayList = [{
- title: [val.attrbutes.type, true],
- children: [
- ["成立时间/联系人:", val.attrbutes.policeTime, 24],
- ["站点地址:", val.attrbutes.alertLevel, 24],
- ["预约电话:", val.attrbutes.address, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (type == "消防站" || type == "专职队" || type == "高层建筑覆盖" || type == "高层建筑" || type == "微型消防站" || type == "一级微型消防站" || type == "街镇专职消防队") {
- if (val.attrbutes.stationType == 1 || val.attrbutes.stationType == 2 || val.attrbutes.stationType == 3 || val.attrbutes.stationType == 4) {
- let arrayList = [{
- title: [val.attrbutes.stationName, true],
- children: [
- ["消防站地址:", val.attrbutes.stationAddress, 24],
- ["消防站类型:", val.attrbutes.stationType == 1 ? "一级消防站" : val.attrbutes.stationType == 2 ? "二级消防站" : val.attrbutes.stationType == 3 ? "三级消防站" : val.attrbutes.stationType == 4 ? "专职队" : "", 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (val.attrbutes.stationType == 5) {
- let arrayList = [{
- title: [val.attrbutes.streetTown + "微型消防站(" + val.attrbutes.stationCode + '号)', true],
- children: [
- ["地址:", val.attrbutes.stationAddress, 24],
- ["编号:", val.attrbutes.stationCode, 24],
- ["距消防站直线距离:", val.attrbutes.stationAddress, 24],
- ["距消防站行驶距离:", val.attrbutes.driveDistance, 24],
- ["交通拥堵行驶时间:", val.attrbutes.jamDrive, 24],
- ["交通畅通行驶时间:", val.attrbutes.unimpededDrive, 24],
- // ["点位情况:", val.attrbutes.pointSituation, 24],
- ["建筑情况:", val.attrbutes.buildSituation, 24],
- ["车辆停放:", val.attrbutes.vehiclePark, 24],
- ["是否有产证:", val.attrbutes.birthCert, 24],
- ["产证情况:", val.attrbutes.birthCertSituation, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (val.attrbutes.stationType == 111 || val.attrbutes.stationType == 112) {
- let arrayList = [{
- title: [val.attrbutes.buildName, true],
- children: [
- ["建筑地址:", val.attrbutes.address, 24],
- ["主要产权人:", val.attrbutes.principalPropertyOwner, 24],
- ["统一社会信用代码:", val.attrbutes.creditCode, 24],
- ["物业服务企业名称:", val.attrbutes.propertyServiceName, 24],
- ["建成年份:", val.attrbutes.completeYear, 24],
- ["建筑高度:", val.attrbutes.buildHigh, 24],
- ["地上建筑层数:", val.attrbutes.aboveFloor, 24],
- ["地下建筑层数:", val.attrbutes.underFloor, 24],
- ["建筑类型:", val.attrbutes.buildType, 24],
- ["功能用途:", val.attrbutes.functionalPurpose, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- if (val.attrbutes.stationType == 17 || val.attrbutes.stationType == 18) {
- let bianhao = JSON.parse(val.attrbutes.extendData).test1
- let arrayList = [{
- title: [val.attrbutes.facilityName, true],
- children: [
- ["编号:", bianhao, 24],
- ["消防站地址:", val.attrbutes.address, 24],
- ["消防站类型:", val.attrbutes.stationType == 17 ? "一级微型消防站" : val.attrbutes.stationType == 18 ? "街镇专职消防队" : "", 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- }
- if (type == "企业消防" || type == "社区消防") {
- let arrayList = [{
- title: [val.attrbutes.facilityName, true],
- children: [
- ["站点地址:", val.attrbutes.address, 24],
- ["站点类型:", val.attrbutes.facilityType == 13 ? "重点单位微站" :
- val.attrbutes.facilityType == 14 ? "一般单位微站" : val.attrbutes.facilityType == 15 ? "居委会微站" : val.attrbutes.facilityType == 16 ? "村委会微站" : "", 24
- ],
- ["街镇:", val.attrbutes.streetTown, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- }
- //警情综合处置
- if (pageType == "comprehensive-disposal") {
- if (type == "实时警情") {
- let arrayList = [{
- title: ["案件详情", true],
- children: [
- ["案件编号:", val.attrbutes.ajbh, 24],
- ["案件描述:", val.attrbutes.bcxx, 24],
- ["报警时间:", val.attrbutes.tzsj, 24],
- ["案件类型:", val.attrbutes.ajlx, 24],
- ["警情类别:", val.attrbutes.type, 24],
- ["警情等级:", val.attrbutes.ajdj, 24],
- ["案发地址:", val.attrbutes.afdz, 24],
- ["调动车辆:", val.attrbutes.cdcl, 24],
- ["处置对象:", val.attrbutes.czdx, 24],
- ["主责中队:", val.attrbutes.zhongdui, 24],
- ["案件状态:", val.attrbutes.cssj, 24],
- ["到场时间:", val.attrbutes.dcsj, 24],
- ["出水时间:", val.attrbutes.cssj, 24],
- ["控制时间:", val.attrbutes.kzsj, 24],
- ["熄灭时间:", val.attrbutes.xmsj, 24],
- ["所属街道:", val.attrbutes.streettown, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- }
- //城市消防体征
- if (pageType == "fire-signs") {
- if (type == "仓库") {
- let arrayList = [{
- title: [val.attrbutes.companyName, true],
- children: [
- ["单位地址:", val.attrbutes.address, 24],
- ["单位类别:", val.attrbutes.companyType, 24],
- ["单位使用性质:", val.attrbutes.companyNature, 24],
- ["单位(法人)名称:", val.attrbutes.delegateName, 24],
- ["统一社会信用代码:", val.attrbutes.socialCode, 24],
- ["所辖派出所:", val.attrbutes.policeStation, 24],
- ["消防安全责任人:", val.attrbutes.fireDutyName, 24],
- ["消防安全管理人:", val.attrbutes.fireManageName, 24],
- ["联系电话(手机):", val.attrbutes.linkPhone, 24],
- ["是否自主消防安全管理:", val.attrbutes.fireSafetyManage, 24],
- ["单位(场所)面积(㎡):", val.attrbutes.companyArea, 24],
- ["行业类别:", val.attrbutes.industryType, 24],
- ["是否为洁净厂房:", val.attrbutes.cleanRoom, 24],
- ["生产经营组织形式:", val.attrbutes.organizationForm, 24],
- ["网格号:", val.attrbutes.gridNo, 24],
- ["年份:", val.attrbutes.particularYear, 24],
- ["提交时间:", val.attrbutes.submitTime, 24],
- ["经度:", val.attrbutes.longitude, 24],
- ["纬度:", val.attrbutes.latitude, 24],
- ],
- }, ];
- this.popup(val._attrbutes, arrayList, true)
- }
- }
- },
- });
- }
- },
- /**
- * 点分布(撒点四叶草 安保专用)
- * @param {坐标信息} lnglats
- * @param {页面类型} type
- */
- addMarkerSYC(lnglats, pageType, type) {
- let that = this
- let icon = "";
- var target = lnglats.map((val, ind) => {
- var wgs84 = CoordUtil.gcj02towgs84(Number(val.gisX) || Number(val.longitude), Number(val.gisY) || Number(val.latitude))
- var x = wgs84[0]
- var y = wgs84[1]
- if (
- pageType == "security-plan") {
- let marker = {
- id: ind + 1,
- attrbutes: val,
- position: {
- x: x,
- y: y,
- z: 0
- },
- image: {
- url: type == "国家会展中心" ? this.stores.sadianIcon.hzzx : this.stores.sadianIcon.zdwxxfz,
- width: val.type == "国家会展中心" ? 83 : 19.5,
- height: val.type == "国家会展中心" ? 59 : 25,
- },
- };
- return marker;
- } else {
- let marker = {
- id: ind + 1,
- attrbutes: val,
- position: { x: val.gisBaiDuX, y: val.gisBaiDuY, z: 0 },
- image: { url: icon, width: 300, height: 300 },
- };
- return marker;
- }
- });
- //撒点类型
- window.jMap.Locate.pointLocate(target, {
- //撒点
- isZoom: false,
- //animate: { "show": true },
- scaleByDistance: {
- minScaling: 1,
- maxScaling: 1,
- minDistance: 50, //最小距离
- maxDistance: 120000 //最大距离
- },
- click: (val) => {
- },
- });
- },
- /**
- * 点分布(网格名称 安保专用)
- * @param {坐标信息} lnglats
- * @param {页面类型} type
- */
- addMarkerWG(lnglats, pageType, type) {
- let that = this
- let icon = "";
- var target = lnglats.map((val, ind) => {
- var wgs84 = CoordUtil.gcj02towgs84(Number(val.gisX) || Number(val.longitude), Number(val.gisY) || Number(val.latitude))
- var x = wgs84[0]
- var y = wgs84[1]
- if (
- pageType == "security-plan") {
- let marker = {
- id: ind + 1,
- attrbutes: val,
- position: {
- x: x,
- y: y,
- z: 0
- },
- image: {
- url: val.type == "wgmc_hc" ? this.stores.sadianIcon.wgmc_hc : val.type == "wgmc_xh" ? this.stores.sadianIcon.wgmc_xh : val.type == "wgmc_qb" ? this.stores.sadianIcon.wgmc_qb : val.type == "wgmc_hq" ? this.stores.sadianIcon.wgmc_hq : val.type == "国家会展中心" ? this.stores.sadianIcon.hzzx : this.stores.sadianIcon.zdwxxfz,
- width: val.type == "wgmc_hc" ? 98 : val.type == "wgmc_xh" ? 98 : val.type == "wgmc_qb" ? 98 : val.type == "wgmc_hq" ? 98 : val.type == "国家会展中心" ? 83 : 19.5,
- height: val.type == "wgmc_hc" ? 33 : val.type == "wgmc_xh" ? 33 : val.type == "wgmc_qb" ? 33 : val.type == "wgmc_hq" ? 33 : val.type == "国家会展中心" ? 59 : 25,
- },
- };
- return marker;
- } else {
- let marker = {
- id: ind + 1,
- attrbutes: val,
- position: { x: val.gisBaiDuX, y: val.gisBaiDuY, z: 0 },
- image: { url: icon, width: 300, height: 300 },
- };
- return marker;
- }
- });
- //撒点类型
- window.jMap.Locate.pointLocate(target, {
- //撒点
- isZoom: false,
- //animate: { "show": true },
- scaleByDistance: {
- minScaling: 1,
- maxScaling: 1,
- minDistance: 50, //最小距离
- maxDistance: 120000 //最大距离
- },
- click: (val) => {
- },
- });
- },
- //聚合点击事件
- clusterMapCallBack(clusterPointArr, clickPoint) {
- let val = clusterPointArr.attributes
- if (val.type2 == "消火栓可用" || val.type2 == "消火栓不可用") {
- let arrayList = [{
- title: ["消火栓", true],
- children: [
- ["水源位置:", val.address, 24],
- ["电话:", val.phone, 12],
- ["责任人:", val.dutyPerson, 12],
- ["支队名称:", val.detachmentName, 24],
- ["管辖机构:", val.jurisdictionalAgency, 12],
- ["水源类型:", val.type, 12],
- ["取水形式:", val.getWaterType, 12],
- ["水源性质:", val.waterAdministrative, 12],
- ["供水单位:", val.waterUnit, 24],
- ["水压(Mpa):", val.waterGage, 24],
- ["状态:", val.status == 1 ? "可用" : "不可用", 12],
- ],
- }, ];
- this.popup(val, arrayList, true)
- } else if (type == "天然水源") {
- let arrayList = [{
- title: [val.facilityName, true],
- children: [
- ["水源位置:", val.address, 24],
- ],
- }, ];
- this.popup(val, arrayList, true)
- }
- },
- /**
- * 热力图
- * @param {} data
- */
- heatMap(data) {
- let target = []
- if (data.length > 0) {
- for (let i = 0; i < data.length; i++) {
- var wgs84 = CoordUtil.gcj02towgs84(Number(data[i].gisX) || Number(data[i].longitude), Number(data[i].gisY) || Number(data[i].latitude))
- var x = wgs84[0]
- var y = wgs84[1]
- target[i] = []
- target[i].x = x
- target[i].y = y
- }
- let options = {
- style: {
- minOpacity: 0.6,
- maxOpacity: 0.9,
- radius: 50,
- gradient: {
- '.10': 'green',
- '.45': 'yellow',
- '.65': 'orange',
- '.80': 'red'
- }
- },
- isZoom: false
- }
- jMap.HeatMap.show(target, options)
- } else {
- jMap.HeatMap.hide()
- }
- },
- // 无经纬度创建标点和点击事件
- addMarkerAddress(lnglats) {
- let target = lnglats.map((val, ind) => {
- if (!val.addressId) {
- let addressInfo = window.jMap.queryMphInfo(val.address)[val.address][0];
- return {
- ...val,
- addressId: addressInfo.address_id, // 地址id
- province: addressInfo.province, // 市
- district: addressInfo.district, // 区
- sub_district: addressInfo.sub_district, // 街镇
- streetname: addressInfo.streetname, // 路
- address: addressInfo.address, // 户
- committee: addressInfo.committee, // 居委会
- };
- }
- });
- target = target.reduce((item, next) => {
- !item.some((val) => val.addressId === next.addressId) && item.push(next);
- return item;
- }, []);
- for (let item = 0; item < Math.floor(target.length / 100); item++) {
- setTimeout(() => {
- window.jMap.locateMph(
- target
- .slice(item * 100, (item + 1) * 100)
- .map((val) => val.addressId)
- .join(), {
- isZoom: false,
- scaleByDistance: { minScaling: 0, maxScaling: 1, minDistance: 1000, maxDistance: 30000 },
- click: (value) => {
- this.elementInfo(value, "fire");
- },
- }
- );
- }, 0);
- }
- },
- elementInfo(value, type) {
- let element = "";
- if (type == "重点单位") {
- element = `<div class="ysc-dynamic-layer ys-css3-box" onclick="vue.removePopup">
- <div class="tableTooltip mapTab">
- <div class="tableTitle">
- <div>1212121</div>
- </div>
- </div>
- </div>`;
- }
- this.addMarkerInfo(element, value, type);
- },
- bufferL(val) {
- let target = {
- geometry: [{
- position: [],
- type: 'point'
- }],
- distance: 7000
- }
- for (let i = 0; i < val.length; i++) {
- // var wgs84 = CoordUtil.gcj02towgs84(Number(val.longitude + '0000000' ), Number(val.latitude + '0000000' ))
- // var x = wgs84[0]
- // var y = wgs84[1]
- target.geometry[i] = {
- position: [{ x: Number(val[i].longitude) + '0000000', y: Number(val[i].latitude) + '0000000' }],
- type: 'point'
- }
- // if(val[i].stationType ==7 ){
- // target
- // }
- }
- var options = { callBack: this.bufferCallback };
- jMap.Buffer.generate(target, options);
- },
- bufferL1(val) {
- let target = {
- geometry: [{
- position: [],
- type: 'point'
- }],
- distance: ((Math.sqrt(7 / 3.14) * 1000) / 2).toFixed(0)
- }
- for (let i = 0; i < val.length; i++) {
- var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
- var x = wgs84[0].toFixed(13)
- var y = wgs84[1].toFixed(13)
- target.geometry[i] = {
- position: [{ x: x, y: y }],
- type: 'point'
- }
- }
- var options = { callBack: bufferCallback };
- jMap.Buffer.generate(target, options);
- },
- bufferL2(val) {
- let target = {
- geometry: [{
- position: [],
- type: 'point'
- }],
- distance: ((Math.sqrt(4 / 3.14) * 1000) / 2).toFixed(0)
- }
- for (let i = 0; i < val.length; i++) {
- var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
- var x = wgs84[0].toFixed(13)
- var y = wgs84[1].toFixed(13)
- target.geometry[i] = {
- position: [{ x: x, y: y }],
- type: 'point'
- }
- }
- var options = { callBack: bufferCallback };
- jMap.Buffer.generate(target, options);
- },
- bufferL3(val) {
- let target = {
- geometry: [{
- position: [],
- type: 'point'
- }],
- distance: ((Math.sqrt(2 / 3.14) * 1000) / 2).toFixed(0)
- }
- for (let i = 0; i < val.length; i++) {
- var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
- var x = wgs84[0].toFixed(13)
- var y = wgs84[1].toFixed(13)
- target.geometry[i] = {
- position: [{ x: x, y: y }],
- type: 'point'
- }
- }
- var options = { callBack: bufferCallback };
- jMap.Buffer.generate(target, options);
- },
- bufferL4(val) {
- let target = {
- geometry: [{
- position: [],
- type: 'point'
- }],
- distance: ((Math.sqrt(2 / 3.14) * 1000) / 2).toFixed(0)
- }
- for (let i = 0; i < val.length; i++) {
- var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
- var x = wgs84[0].toFixed(13)
- var y = wgs84[1].toFixed(13)
- target.geometry[i] = {
- position: [{ x: x, y: y }],
- type: 'point'
- }
- }
- var options = { callBack: bufferCallback };
- jMap.Buffer.generate(target, options);
- },
- bufferL5(val) {
- let target = {
- geometry: [{
- position: [],
- type: 'point'
- }],
- distance: ((Math.sqrt(2 / 3.14) * 1000) / 2).toFixed(0)
- }
- for (let i = 0; i < val.length; i++) {
- var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
- var x = wgs84[0].toFixed(13)
- var y = wgs84[1].toFixed(13)
- target.geometry[i] = {
- position: [{ x: x, y: y }],
- type: 'point'
- }
- }
- var options = { callBack: bufferCallback };
- jMap.Buffer.generate(target, options);
- },
- bufferCallback(result) {
- for (var i in result) {
- var target = {
- id: i,
- position: CoordUtil.arrayToJson(result[i].rings[0]) // 二维坐标数组转JSON数组,详见三中
- };
- var options = {
- style: {
- color: 'red',
- transparency: 0.6,
- }
- }
- // if (result[i].stationType == 1) {
- // options.style.color = '#f80000',
- // options.style.transparency = 0.6
- // }
- // if (result[i].stationType == 2) {
- // options.style.color = '#f88c00',
- // options.style.transparency = 0.6
- // }
- // if (result[i].stationType == 3) {
- // options.style.color = '#0092f8',
- // options.style.transparency = 0.6
- // }
- jMap.Locate.regionLocate(target, options)
- }
- },
- bufferCallback1(result) {
- for (var i in result) {
- var target = {
- id: i,
- position: CoordUtil.arrayToJson(result[i].rings[0]) // 二维坐标数组转JSON数组,详见三中
- };
- jMap.Locate.regionLocate(target, {
- style: {
- color: '#f80000',
- transparency: 0.6,
- }
- })
- }
- },
- bufferCallback2(result2) {
- for (var i in result2) {
- var target = {
- id: i,
- position: CoordUtil.arrayToJson(result2[i].rings[0]) // 二维坐标数组转JSON数组,详见三中
- };
- jMap.Locate.regionLocate(target, {
- isZoom: true,
- style: {
- color: '#f88c00',
- transparency: 0.6,
- }
- })
- }
- },
- bufferCallback3(result3) {
- for (var i in result3) {
- var target = {
- id: i,
- position: CoordUtil.arrayToJson(result3[i].rings[0]) // 二维坐标数组转JSON数组,详见三中
- };
- jMap.Locate.regionLocate(target, {
- style: {
- color: '#0092f8',
- transparency: 0.6,
- }
- })
- }
- },
- addMarkerInfo(element, value, type, isBtn = false) {
- var wgs84 = CoordUtil.gcj02towgs84(Number(value.gisX) || Number(value.longitude), Number(value.gisY) || Number(value.latitude))
- var x = wgs84[0]
- var y = wgs84[1]
- let _this = this
- // window.jMap.Popup && window.jMap.Popup.hide([this.oldPopup && this.oldPopup.id]);
- if (this.oldPopup && value.id === this.oldPopup.id) {
- window.jMap.Popup.hide();
- return (this.oldPopup = null);
- }
- if (type == "selfManagement" || type == "water") {
- window.jMap.Popup.show({
- id: value.id,
- //position: value.wgs84position, //使用自定义窗体
- position: { x: x, y: y }, //使用自定义窗体
- element: element,
- }, { isZoom: false, offset: [0, -40] });
- }
- if (type == "重点单位") {
- _this.stores.zddwIdSD(value.companyId);
- // localStorage.setItem("zddw",)
- // window.jMap.Popup.show({
- // // position: { x: value.gisX, y: value.gisY }, //使用自定义窗体
- // position: { x: x, y: y }, //使用自定义窗体
- // element: element,
- // }, { isZoom: 100, offset: [0, -40] });
- }
- // if (!isBtn) {
- // window.jMap.goTo({
- // x: Number(value.wgs84position.x),
- // y: Number(value.wgs84position.y),
- // radius: 1000,
- // }, {
- // duration: 3,
- // offset: {
- // heading: -4,
- // pitch: -70,
- // range: 0,
- // },
- // });
- // window.jMap.Buffer.generate({
- // geometry: [{ position: [{ x: Number(value.wgs84position.x), y: Number(value.wgs84position.y) }], type: "point" }],
- // distance: 1000,
- // }, {
- // callBack: (el) => {
- // for (const i in el) {
- // var target = {
- // id: i,
- // position: CoordUtil.arrayToJson(el[i].rings[0]),
- // };
- // }
- // window.jMap.Locate.regionLocate(target, {
- // style: {
- // color: "rgba(235, 98, 98, .1)",
- // transparency: 0.3,
- // },
- // });
- // },
- // });
- // }
- this.oldPopup = value;
- },
- removePopup(e) {
- },
- /**
- * 气泡窗
- * @param {*} data
- * @param {*} arrayList 展示数据
- * @param {*} type
- * @param {*} other
- * @param {*} zb 坐标类型
- */
- popup(data, arrayList, type, other, zb) {
- if (type) {
- if (!other) {
- var html = document.createElement('div');
- html.className = 'ysc-dynamic-layer ys-css3-box';
- var line = document.createElement('div');
- line.className = 'line';
- var main = document.createElement('div');
- main.className = 'main';
- if (zb) {
- main.setAttribute('style', 'position: fixed;top:120px;left:39%;max-height:500px;overflow-y: scroll;background:none;width:400px;bottom:auto; padding:10px 10px 5px 0 !important; border-radius: 0.05rem;border:1px solid rgba(115, 251, 253, 1);box - shadow: inset 0 0 1px 0.0125rem rgba(115, 251, 253, 1); background:rgba(0, 0, 0, 0.6)');
- } else {
- main.setAttribute('style', 'position: absolute;top:50%;max-height:500px;overflow-y: scroll;background:none;width:400px;bottom:auto; padding:10px 10px 5px 0 !important; border-radius: 0.05rem;border:1px solid rgba(115, 251, 253, 1);box - shadow: inset 0 0 1px 0.0125rem rgba(115, 251, 253, 1); background:rgba(0, 0, 0, 0.6)');
- }
- var click = document.createElement('div');
- click.setAttribute('style', 'float: right;width: 13px;height: 13px;position: absolute;top:8px;right:16px;cursor: pointer');
- var img = document.createElement('img');
- img.className = 'click';
- img.setAttribute("src", this.stores.sadianIcon.close);
- img.setAttribute("style", 'width: 20px;height: 20px;')
- click.appendChild(img)
- var contain = document.createElement('div');
- contain.setAttribute('style', 'margin-left: 3%;right:50px;top:30px;padding: 0px 0 ');
- if (arrayList[0].title[1]) {
- var p = document.createElement('div');
- p.setAttribute('style', 'font-size:18px;color:#73fbfd;line-height:25px');
- p.innerHTML = arrayList[0].title[0]
- contain.appendChild(p)
- }
- for (let i = 0; i < arrayList[0].children.length; i++) {
- if (arrayList[0].children[i][1]) {
- let textWrap = document.createElement('div');
- textWrap.setAttribute('style', 'font-size:14px;color:#fff;line-height:25px;');
- let p1 = document.createElement('span');
- p1.setAttribute('style', 'color:#73fbfd;');
- p1.innerHTML = arrayList[0].children[i][0]
- // if()
- let p2 = document.createElement('span');
- p2.setAttribute('style', 'color:#fff;word-break:break-all !important');
- p2.innerHTML = arrayList[0].children[i][1]
- textWrap.appendChild(p1)
- textWrap.appendChild(p2)
- contain.appendChild(textWrap)
- }
- }
- setTimeout(() => {
- main.appendChild(click)
- main.appendChild(contain)
- if (zb) {
- } else {
- html.appendChild(line)
- }
- html.appendChild(main)
- let text = html.innerHTML.replace(/"click"/g, '"click" onclick="vue.popup(false, false, false)"')
- if (zb) {
- var wgs84 = [Number(data.gisX), Number(data.gisY)]
- } else {
- var wgs84 = CoordUtil.gcj02towgs84(Number(data.gisX) || Number(data.longitude), Number(data.gisY) || Number(data.latitude))
- }
- var x = wgs84[0]
- var y = wgs84[1]
- var target = {
- id: '100001',
- position: { x: x, y: y, z: 0 },
- element: `<div class="ysc-dynamic-layer ys-css3-box" style="">${text}</div>`
- };
- var options = {
- // isZoom: true,
- offset: [-6, -275]
- };
- jMap.Popup.show(target, options);
- }, 10)
- } else {
- }
- } else {
- jMap.Popup.hide();
- }
- },
- }
- }
|