{"version":3,"sources":["webpack:///./src/components/IndexMap.vue?e4be","webpack:///./src/components/IndexMap.vue","webpack:///./src/components/IndexMap.vue?2a86","webpack:///./src/components/IndexMap.vue?6ec3","webpack:///./src/components/IndexMap.vue?e7d2"],"names":["render","_vm","this","_c","_self","_setupProxy","staticClass","staticStyle","class","clickable","selectedGuid","attrs","mapControls","on","onPointerMove","onClick","ref","zoom","$event","basemap","type","key","set","url","attribution","_l","items","item","properties","guid","coordinates","mosaicFootprintSymbolizer","_t","_v","_s","$store","getters","mosaicByGuid","title","_e","staticRenderFns","Vue","use","VueLayers","IndexMap","constructor","feature","get","showUnauthorized","getCurrentHighlightedFootprint","defaultStyles","dulledOverlay","dulled","overlay","standard","e","filteredMosaics","mounted","initialZoom","baseUrl","state","apiUrls","mapvault","basemaps","defaultMapControls","extend","Attribution","collapsed","FullScreen","WatermarkControl","pointerMove","mosaics","mms","map","m","getProperties","extent","extentToCoordinates","undefined","sort","one","another","Polygon","getArea","filter","props","_","pickBy","v","k","details","find","d","authorized","w","xMax","xMin","h","yMax","yMin","evt","candidates","getFeaturesAtPixel","pixel_","checkWrapped","length","topCandidate","gOne","getGeometry","gAnother","TypeError","onHighlighted","current","previous","isEqual","$refs","mosaicFootprints","$layer","changed","commit","SET_CURRENT","__decorate","Prop","default","Watch","Component","component"],"mappings":"4GAAA,W,gECAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAUF,EAAIG,MAAMC,YAAY,OAAOF,EAAG,MAAM,CAACG,YAAY,eAAeC,YAAY,CAAC,aAAa,SAAS,CAACJ,EAAG,MAAM,CAACG,YAAY,gBAAgB,CAACH,EAAG,SAAS,CAACK,MAAM,CAACC,UAA8B,OAAnBR,EAAIS,cAAqBH,YAAY,CAAC,OAAS,QAAQI,MAAM,CAAC,8BAA6B,EAAK,gCAA+B,EAAK,kBAAkB,YAAY,gBAAkBV,EAAIW,aAAaC,GAAG,CAAC,YAAcZ,EAAIa,c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,QAAS,KACjB,kCAGAF,gBADCC,eAAK,CAAEC,QAAS,QACjB,8BAwIAF,gBADCG,eAAM,iBACP,kCAhJmBhF,EAAQ,gBAF5BiF,eAAU,KAEUjF,WCxB8W,I,wBCQ/XkF,EAAY,eACd,EACA9H,EACAwC,GACA,EACA,KACA,WACA,MAIa,aAAAsF,E","file":"js/IndexMap.111001eb.js","sourcesContent":["export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./IndexMap.vue?vue&type=style&index=0&id=3a3d786a&prod&lang=scss&scoped=true&\"","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"fullviewport\",staticStyle:{\"overflow-y\":\"auto\"}},[_c('div',{staticClass:\"fullviewport\"},[_c('vl-map',{class:{clickable: _vm.selectedGuid!==null},staticStyle:{\"height\":\"100%\"},attrs:{\"load-tiles-while-animating\":true,\"load-tiles-while-interacting\":true,\"data-projection\":\"EPSG:4326\",\"defaultControls\":_vm.mapControls},on:{\"pointermove\":_vm.onPointerMove,\"click\":_vm.onClick}},[_c('vl-view',{ref:\"view\",attrs:{\"zoom\":_vm.zoom,\"enable-rotation\":false},on:{\"update:zoom\":function($event){_vm.zoom=$event}}}),_c('vl-layer-tile',{attrs:{\"id\":\"basemap\",\"opacity\":1}},[(_vm.basemap.type===\"bingmaps\")?_c('vl-source-bingmaps',{attrs:{\"api-key\":_vm.basemap.key,\"imagery-set\":_vm.basemap.set}}):_c('vl-source-xyz',{attrs:{\"url\":_vm.basemap.url,\"attributions\":_vm.basemap.attribution}})],1),_c('vl-layer-vector',{ref:\"mosaicFootprints\",attrs:{\"attributions\":\"Footprints: © 2014-2021; East View Geospatial\"}},[_c('vl-source-vector',{attrs:{\"ident\":\"footprints\"}},_vm._l((_vm.items),function(item){return _c('vl-feature',{key:item.properties.guid,attrs:{\"properties\":item.properties}},[_c('vl-geom-polygon',{attrs:{\"coordinates\":item.coordinates}})],1)}),1),_c('vl-style-func',{attrs:{\"func\":_vm.mosaicFootprintSymbolizer}})],1),_vm._t(\"infobox\",function(){return [(!!_vm.selectedGuid)?_c('div',{staticClass:\"map-infobox\"},[_vm._v(\" \"+_vm._s(_vm.$store.getters.mosaicByGuid(_vm.selectedGuid).title)+\" \")]):_vm._e()]},{\"selected\":_vm.selectedGuid})],2)],1)])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\nimport _ from 'lodash';\nimport Vue from 'vue';\nimport { Feature, MapBrowserEvent } from 'ol';\nimport { defaults as defaultMapControls, FullScreen, Attribution } from 'ol/control';\nimport { FeatureLike } from 'ol/Feature';\nimport { Polygon } from 'ol/geom';\nimport { Style } from 'ol/style';\nimport { pointerMove } from 'ol/events/condition';\nimport { default as VueLayers } from 'vuelayers';\nimport { Component, Prop, Watch, Emit, Inject } from 'vue-property-decorator';\nimport { Mosaic, Bounds, ProductDetails } from '@/lib/mv-web';\nimport { extendCoordinates } from 'ol/extent';\nimport defaultStyles from '@/lib/ol-custom-ext/DefaultMapStyles';\nimport basemaps from '@/lib/ol-custom-ext/basemaps';\nimport WatermarkControl from '@/lib/ol-custom-ext/WatermarkControl';\nimport { SET_CURRENT } from '@/store/mutation-types';\n\nVue.use(VueLayers);\n\ntype SymbolizerFactory = () => (feature: any, resolution: number) => any;\n\n@Component({\n})\nexport default class IndexMap extends Vue {\n @Prop({default: true})\n public showUnauthorized!: boolean;\n\n @Prop({ default: 2 })\n public initialZoom!: number;\n\n @Prop({ default: null })\n public baseUrl!: string | null;\n\n public zoom: number = 2;\n\n protected selectedGuid: string | null = null;\n\n protected get mosaics(): Mosaic[] {\n return this.$store.getters.filteredMosaics;\n }\n\n public mounted() {\n this.zoom = this.initialZoom;\n }\n\n public get rootUrl(): string {\n let baseUrl = this.baseUrl;\n if (!baseUrl) {\n baseUrl = `${this.$store.state.apiUrls.mapvault}`;\n }\n return baseUrl;\n }\n\n protected get basemap() { return basemaps[this.$store.state.basemap]; }\n\n protected get mapControls() {\n return defaultMapControls().extend([\n new Attribution({collapsed: true}),\n new FullScreen(),\n new WatermarkControl({}),\n ]);\n }\n\n protected get selectCondition() { return pointerMove; }\n\n protected get items() {\n if (!this.mosaics) {\n return [];\n }\n const mms = this.mosaics\n .map( (m) => ({\n properties: this.getProperties(m),\n coordinates: m.extent ? this.extentToCoordinates(m.extent) : undefined,\n }),\n ).sort( (one, another) => {\n if (!one.coordinates) { return 1; }\n if (!another.coordinates) { return -1; }\n return -( (new Polygon(one.coordinates)).getArea() - (new Polygon(another.coordinates)).getArea());\n });\n return mms.filter( (m) => !!m.coordinates);\n }\n\n protected mosaicFootprintSymbolizer = ( feature: Feature) => {\n try {\n if (feature.get('authorized') !== true) {\n if (!this.showUnauthorized) {\n return null;\n }\n if (feature.get('guid') === this.getCurrentHighlightedFootprint()) {\n return defaultStyles.dulledOverlay;\n }\n return defaultStyles.dulled;\n }\n if (feature.get('guid') === this.getCurrentHighlightedFootprint()) {\n return defaultStyles.overlay;\n }\n return defaultStyles.standard;\n } catch (e) {\n // If there is any problem, fail over to returning null\n }\n return null;\n }\n protected getCurrentHighlightedFootprint() { return this.selectedGuid; }\n\n protected getProperties(item: Mosaic) {\n const props: any = _.pickBy(item, (v, k) => k !== 'extent');\n const details = this.$store.state.details.find( (d: ProductDetails) => d.guid === item.guid);\n if (!!details) {\n props.authorized = details.authorized;\n }\n return props;\n }\n\n protected extentToCoordinates(extent: Bounds) {\n const w = extent.xMax - extent.xMin;\n const h = extent.yMax - extent.yMin;\n if (w < 359 || h < 120) {\n const m = extent.xMax + extent.xMin;\n if (m > 360) {\n // midpoint past the anti-meridian; warp on earth westward\n extent.xMin -= 360;\n extent.xMax -= 360;\n }\n if (m < -360) {\n // midpoint past the anti-meridian; warp on earth eastward\n extent.xMin += 360;\n extent.xMax += 360;\n }\n return [[\n [extent.xMin, extent.yMin],\n [extent.xMax, extent.yMin],\n [extent.xMax, extent.yMax],\n [extent.xMin, extent.yMax],\n [extent.xMin, extent.yMin],\n ]];\n }\n return null;\n }\n\n private onPointerMove(evt: MapBrowserEvent) {\n try {\n // the \"pixel\" property does not work, but the \"pixel_\" does; there may be an error in the type registration\n const candidates = evt.map.getFeaturesAtPixel((evt as any).pixel_, { checkWrapped: true });\n if (candidates.length === 0) {\n this.selectedGuid = null;\n return;\n }\n const topCandidate = candidates.sort((one: FeatureLike, another: FeatureLike) => {\n const gOne = one.getGeometry() as Polygon;\n if (gOne === null) {\n return 1;\n }\n const gAnother = another.getGeometry() as Polygon;\n if (gAnother === null) {\n return -1;\n }\n return gOne.getArea() - gAnother.getArea();\n })[0];\n\n this.selectedGuid = topCandidate.get('guid');\n } catch (TypeError) {\n // These occur upon first entry into the window; just swallow them.\n }\n }\n\n // watch the property to keep the onPointerMove handler simple\n @Watch('selectedGuid')\n private onHighlighted( current: string|null, previous: string|null) {\n if (!_.isEqual(current, previous)) {\n // triggers a redraw of the layer; the symbolizer will provide new styles\n (this.$refs.mosaicFootprints as any).$layer.changed();\n }\n }\n\n private onClick(evt: MapBrowserEvent) {\n // if the user clicks, they must have moved to the feature of interest first,\n // so the pointer move will have acquired the guid of interest\n if (this.selectedGuid !== null) {\n this.$store.commit(SET_CURRENT, this.selectedGuid);\n }\n }\n}\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--14-3!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./IndexMap.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--14-3!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./IndexMap.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./IndexMap.vue?vue&type=template&id=3a3d786a&scoped=true&\"\nimport script from \"./IndexMap.vue?vue&type=script&lang=ts&\"\nexport * from \"./IndexMap.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./IndexMap.vue?vue&type=style&index=0&id=3a3d786a&prod&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"3a3d786a\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}