All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mware.web.product.map.dist.Map.js.map Maven / Gradle / Ivy

The newest version!
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 3e9f9da24d684a7ee6f7","webpack:///Map.js","webpack:///external {\"amd\":\"openlayers\",\"commonjs2\":false,\"commonjs\":false}","webpack:///external {\"amd\":\"prop-types\",\"commonjs2\":false,\"commonjs\":false}","webpack:///./util/layerHelpers.js","webpack:///external {\"amd\":\"create-react-class\",\"commonjs2\":false,\"commonjs\":false}","webpack:///./util/cache.js","webpack:///external {\"amd\":\"react-dom\",\"commonjs2\":false,\"commonjs\":false}","webpack:///./multiPointCluster.js","webpack:///external {\"amd\":\"util/withDataRequest\",\"commonjs2\":false,\"commonjs\":false}","webpack:///external {\"amd\":\"jscache\",\"commonjs2\":false,\"commonjs\":false}","webpack:///external {\"amd\":\"util/vertex/formatters\",\"commonjs2\":false,\"commonjs\":false}","webpack:///external {\"amd\":\"util/mapConfig\",\"commonjs2\":false,\"commonjs\":false}","webpack:///external {\"amd\":\"data/web-worker/store/ontology/selectors\",\"commonjs2\":false,\"commonjs\":false}","webpack:///external {\"amd\":\"react-redux\",\"commonjs2\":false,\"commonjs\":false}","webpack:///external {\"amd\":\"data/web-worker/store/selection/actions\",\"commonjs2\":false,\"commonjs\":false}","webpack:///external {\"amd\":\"data/web-worker/store/product/actions\",\"commonjs2\":false,\"commonjs\":false}","webpack:///external {\"amd\":\"data/web-worker/store/product/selectors\",\"commonjs2\":false,\"commonjs\":false}","webpack:///./worker/actions.js","webpack:///external {\"amd\":\"data/web-worker/store/actions\",\"commonjs2\":false,\"commonjs\":false}","webpack:///external {\"amd\":\"configuration/plugins/registry\",\"commonjs2\":false,\"commonjs\":false}","webpack:///./MapContainer.jsx","webpack:///external {\"amd\":\"util/dnd\",\"commonjs2\":false,\"commonjs\":false}","webpack:///external {\"amd\":\"components/DroppableHOC\",\"commonjs2\":false,\"commonjs\":false}","webpack:///./Map.jsx","webpack:///external {\"amd\":\"components/RegistryInjectorHOC\",\"commonjs2\":false,\"commonjs\":false}","webpack:///./OpenLayers.jsx","webpack:///external {\"amd\":\"product/toolbar/ProductToolbar\",\"commonjs2\":false,\"commonjs\":false}","webpack:///./clusterHover.js","webpack:///external {\"amd\":\"util/deepObjectCache\",\"commonjs2\":false,\"commonjs\":false}"],"names":["root","factory","exports","module","require","define","amd","undefined","self","this","__WEBPACK_EXTERNAL_MODULE_0__","__WEBPACK_EXTERNAL_MODULE_2__","__WEBPACK_EXTERNAL_MODULE_6__","__WEBPACK_EXTERNAL_MODULE_8__","__WEBPACK_EXTERNAL_MODULE_10__","__WEBPACK_EXTERNAL_MODULE_11__","__WEBPACK_EXTERNAL_MODULE_12__","__WEBPACK_EXTERNAL_MODULE_19__","__WEBPACK_EXTERNAL_MODULE_28__","__WEBPACK_EXTERNAL_MODULE_29__","__WEBPACK_EXTERNAL_MODULE_30__","__WEBPACK_EXTERNAL_MODULE_31__","__WEBPACK_EXTERNAL_MODULE_32__","__WEBPACK_EXTERNAL_MODULE_34__","__WEBPACK_EXTERNAL_MODULE_47__","__WEBPACK_EXTERNAL_MODULE_65__","__WEBPACK_EXTERNAL_MODULE_66__","__WEBPACK_EXTERNAL_MODULE_68__","__WEBPACK_EXTERNAL_MODULE_70__","__WEBPACK_EXTERNAL_MODULE_72__","__webpack_require__","moduleId","installedModules","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","_objectWithoutProperties","obj","keys","target","indexOf","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","_slicedToArray","sliceIterator","arr","_arr","_n","_d","_e","_s","_i","Symbol","iterator","next","done","push","value","length","err","Array","isArray","TypeError","_extends","assign","arguments","source","key","ol","MultiPointCluster","withDataRequest","cache","interpolate","v","x0","x1","y0","y1","setLayerConfig","config","layer","visible","opacity","zIndex","properties","_","mapObject","unset","set","setVisible","setOpacity","setZIndex","syncFeatures","focused","features","existingFeatures","indexBy","getFeatures","f","getId","newFeatures","changed","featureIndex","data","id","styles","geometryOverride","geometry","geoLocations","element","rest","getOrCreateGeometry","feature","featureValues","normal","selected","radius","getRadiusFromStyles","normalImage","isFunction","getImage","_nodeRadius","getStroke","newSelected","clone","prevStroke","newStroke","style","Stroke","color","width","getWidth","image_","stroke","isFocusing","type","focusedDim","existingFeature","any","getProperties","val","isEqual","setProperties","Feature","setId","fitFeatures","addFeatures","isEmpty","forEach","removeFeature","getFormatForMimeType","mimeType","format","GeoJSON","KML","getOverlayIdForLayer","VECTOR_FEATURE_SELECTION_OVERLAY","image","getRadius","nodeRadius","devicePixelRatio","DEFAULT_LAYER_CONFIG","sortable","toggleable","layers","tile","configure","options","sourceOptions","baseLayerSource","console","error","Error","crossOrigin","Tile","label","addEvents","map","handlers","on","event","_retryCount","warn","src_","defer","load","cluster","Vector","clusterSource","heatmap","Heatmap","clear","count","selectionState","isSelected","heatmapLayer","vectorLayer","addToElements","list","el","isPartiallySelected","filter","getClusterFromEvent","pixel","pixelFeatures","getFeaturesAtPixel","layerFilter","onHeatmapClick","elements","vertices","edges","forEachFeatureAtPixel","onSelectElements","onClusterClick","targetFeature","clusterIterator","onAddSelection","selectInteraction","interaction","Select","addCondition","originalEvent","shiftKey","condition","events","click","toggleCondition","platformModifierKeyOnly","addInteraction","clusters","includes","debounce","newSelection","innerFeatures","all","some","extend","update","ancillary","wrapX","getExtent","_superExtent","extent","apply","customExtent","createEmpty","renderBuffer","updateWhileInteracting","updateWhileAnimating","extensionStyles","vectorXhr","layerOptions","olSource","overlayId","e","featuresAtPixel","sourceFeatures","getFeatureById","every","selectionOverlay","forEachFeature","geom","getGeometry","featureExtent","Polygon","fromExtent","setGeometry","layerStatus","selectedOverlay","setStyle","Style","fill","Fill","addFeature","loadFeatures","then","propName","propKey","dataRequest","dataProjection","readProjection","proj","getCode","readFeatures","featureProjection","catch","message","i18n","featureSelected","needFocusStyle","styleList","normalStyle","selectedStyle","getOrCreateFeature","src","imgSize","scale","anchor","addFocus","reset","addDim","focusStats","selectionCount","countStats","min","max","Math","getOrCreateCluster","byType","_toConsumableArray","arr2","from","Cache","hash","join","geoCache","cacheOptions","expirationSliding","EXPIRATION_MINUTES","FocusFill","FocusStroke","geo","getItem","MultiPoint","fromLonLat","setItem","cached","Icon","splice","renderer","point","context","pixelRatio","resolution","rotation","setTransform","x","y","w","FocusPadding","h","save","globalAlpha","beginPath","moveTo","lineTo","quadraticCurveTo","closePath","fillStyle","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","restore","r","dim","Circle","lineWidth","textStroke","translate","arc","PI","strokeStyle","portion","font","textAlign","textBaseline","text","toString","strokeText","fillText","focusStyle","getOpacity","attributions","logo","projection","distance","geometryFunction","refresh","bind","inherits","getSource","updateResolution","setDistance","clustered","maxRadius","reduce","Number","MAX_VALUE","mapDistanceSearch","mapDistance","coordinates","getCoordinates","coordinate","coordinateIndex","extentSearch","boundingExtent","buffer","extent1","neighbors","getFeaturesInExtent","coords","featuresToCluster","neighbor","neighborGeometry","neighborCoordinates","neighborUid","coordsInCluster","uid","extent2","intersects","createCluster","centers","sums","average","Point","actions","protectFromWorker","createActions","workerImpl","dropElements","productId","undoable","removeElements","setLayerOrder","layerOrder","redux","ReactDom","registry","selectionActions","productActions","productSelectors","ontologySelectors","dnd","mapActions","DroppableHOC","Map","layerHelpers","registerExtension","identifier","itemComponentPath","placementHint","canHandle","product","kind","mimeTypes","BC_MIMETYPES","ELEMENTS","connect","state","props","getProduct","layerConfig","extendedData","workspaceId","workspace","currentId","configProperties","configuration","ontologyProperties","panelPadding","top","left","right","bottom","selection","getSelectedElementsInProduct","viewport","getViewport","productElementIds","getElementIdsInProduct","getElementsInProduct","getFocusedElementsInProduct","screen","height","dispatch","onClearSelection","add","onSelectAll","selectAll","onUpdatePreview","dataUrl","updatePreview","onUpdateViewport","pan","zoom","updateViewport","onDrop","getElementsFromDataTransfer","dataTransfer","preventDefault","stopPropagation","onDropElementIds","elementIds","onRemoveElementIds","onVertexMenu","vertexId","position","$","trigger","createReactClass","PropTypes","OpenLayers","clusterHover","RegistryInjectorHOC","F","DeepObjectCache","mapConfig","clusterCache","iconAnchor","getIconSize","memoize","ratio","documentExtensionPoint","markUndocumentedExtensionPoint","GEOSHAPE_MIMETYPES","propTypes","isRequired","func","shape","getInitialState","generatePreview","shouldComponentUpdate","nextProps","componentWillMount","caches","geometries","requestUpdateDebounce","clearCaches","componentDidMount","mounted","wrap","document","vertexIds","edgeIds","saveViewportDebounce","saveViewport","legacyListeners","fileImportSuccess","node","handler","componentWillUnmount","removeEvents","off","componentWillReceiveProps","setState","render","baseSource","baseSourceOptions","layerExtensions","className","marginTop","ref","_openlayers","sourcesByLayerId","mapElementsToSources","onTap","onPan","onViewport","onZoom","onContextTap","onMouseOver","onMouseOut","hasFeatureAtPixel","show","hide","productVertices","isValidVertex","isAncillary","clusteredFeatures","clusteredFeature","find","pageX","pageY","view","getZoom","getCenter","currentViewport","edgeInfo","ontology","calculatedGeometry","getOrUpdate","slice","getStyles","calculatedStyles","output","elementsSelectedById","values","concat","geoLocationProperties","groupBy","geoLocation","addOrUpdateSource","sources","extendedDataType","vertex","displayType","prop","ONTOLOGY_CONSTANTS","PROP_MIME_TYPE","rawProp","PROP_RAW","title","geoProp","latitude","longitude","isNaN","iconUrl","param","conceptType","iconUrlSelected","iconSize","each","k","forceUpdate","ProductToolbar","noop","ANIMATION_DURATION","string","bool","panning","getDefaultProps","prevSourcesByLayerId","prevProduct","nextSourcesByLayerId","nextProduct","layersWithSources","nextLayerIds","layerId","previous","newLayers","nextLayers","getLayerGroup","getLayers","getArray","existingLayersById","newLayersWithSources","addLayer","initializer","layerWithSource","initializeLayer","layerIndex","findIndex","setLayers","Collection","omit","componentDidUpdate","prevProps","prevState","fit","layerType","layerHelper","layerWithSources","nextSource","prevSource","shouldUpdate","newLayerOrder","prevLayerOrder","layersWithSource","applyLayerOrder","limitToFeatures","getView","setCenter","setResolution","applyLayerConfig","_updatePreview","base","doFit","animate","_canvasPreviewBuffer","once","captureTimer","loading","loaded","mapCanvas","canvas","capture","newCanvas","getContext","hRatio","vRatio","trunc","drawImage","Observable","unByKey","toDataURL","renderSync","tileLoadStart","clearTimeout","tileLoadEnd","createElement","olEvents","domEvents","PREVIEW_DEBOUNCE_SECONDS","configureMap","_handleMouseMoveTimeout","fn","moveWrapper","injectedProductProps","getInjectedToolProps","rightOffset","showNavigationControls","onFit","onControlsFit","onControlsZoom","zoomByDelta","delta","currentResolution","getResolution","constrainResolution","duration","_slowZoomIn","throttle","trailing","_slowZoomOut","onControlsPan","currentCenter","center","constrainCenter","extentFromFeatures","fExtent","changeZoom","getVisible","getDefaultViewParameters","extentWithPadding","clientBox","refs","getBoundingClientRect","viewportWidth","padding","viewportHeight","extentWithPaddingSize","getSize","currentExtent","calculateExtent","idealResolution","horizontalSync","verticalSync","containsExtent","newResolution","offsetX","offsetY","lon","lat","minZoom","layerExtension","loadTilesWhileInteracting","keyboardEventTarget","controls","extension","configureEvents","View","setView","pointerEvent","button","domEvent","ctrlKey","getEventPixel","hit","handleMouseMove","getTarget","cursor","layersById","nextLayerGroup","orderedLayers","reverse","ids","removeEventListener","addEventListener","_handleMouseMoveFeatures","setTimeout","requestUpdate","aspect","size","setupMap","overlay","innerMap","styleFn","removeOverlay","coord","getPixelFromCoordinate","flip","css","append","toggleClass","Overlay","offset","addOverlay","setPosition","setPositioning","_map","_layer","setSize","maxZoom"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,EAAQG,SAAQ,GAAQA,SAAQ,GAAQA,SAAQ,GAAQA,SAAQ,GAAQA,SAAQ,GAAQA,SAAQ,GAAQA,SAAQ,GAAQA,SAAQ,GAAQA,SAAQ,GAAQA,SAAQ,GAAQA,SAAQ,GAAQA,SAAQ,GAAQA,SAAQ,GAAQA,SAAQ,GAAQA,SAAQ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A,KAE/CjT,EAAM6L,SAAS4f,EAEf,IAAMvsB,GAASc,EAAM6S,WACrB3T,GAAO6H,QACP7H,EAAOgF,YAAYwC,EAAQ/J,IAAI,cAGnC0hB,KAxDG,SAwDEjf,EAAI6G,GACDslB,GACAtlB,EAAIylB,cAAcH,MAjElC,4B3B0sGM,SAAUxxB,EAAQD,G4B9uGxBC,EAAOD,QAAU2B","file":"Map.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"openlayers\", \"prop-types\", \"create-react-class\", \"react-dom\", \"util/withDataRequest\", \"jscache\", \"util/vertex/formatters\", \"util/mapConfig\", \"data/web-worker/store/ontology/selectors\", \"react-redux\", \"data/web-worker/store/selection/actions\", \"data/web-worker/store/product/actions\", \"data/web-worker/store/product/selectors\", \"data/web-worker/store/actions\", \"configuration/plugins/registry\", \"util/dnd\", \"components/DroppableHOC\", \"components/RegistryInjectorHOC\", \"product/toolbar/ProductToolbar\", \"util/deepObjectCache\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Map\"] = factory(require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false));\n\telse\n\t\troot[\"Map\"] = factory(root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_6__, __WEBPACK_EXTERNAL_MODULE_8__, __WEBPACK_EXTERNAL_MODULE_10__, __WEBPACK_EXTERNAL_MODULE_11__, __WEBPACK_EXTERNAL_MODULE_12__, __WEBPACK_EXTERNAL_MODULE_19__, __WEBPACK_EXTERNAL_MODULE_28__, __WEBPACK_EXTERNAL_MODULE_29__, __WEBPACK_EXTERNAL_MODULE_30__, __WEBPACK_EXTERNAL_MODULE_31__, __WEBPACK_EXTERNAL_MODULE_32__, __WEBPACK_EXTERNAL_MODULE_34__, __WEBPACK_EXTERNAL_MODULE_47__, __WEBPACK_EXTERNAL_MODULE_65__, __WEBPACK_EXTERNAL_MODULE_66__, __WEBPACK_EXTERNAL_MODULE_68__, __WEBPACK_EXTERNAL_MODULE_70__, __WEBPACK_EXTERNAL_MODULE_72__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 64);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 3e9f9da24d684a7ee6f7","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"openlayers\", \"prop-types\", \"create-react-class\", \"react-dom\", \"util/withDataRequest\", \"jscache\", \"util/vertex/formatters\", \"util/mapConfig\", \"data/web-worker/store/ontology/selectors\", \"react-redux\", \"data/web-worker/store/selection/actions\", \"data/web-worker/store/product/actions\", \"data/web-worker/store/product/selectors\", \"data/web-worker/store/actions\", \"configuration/plugins/registry\", \"util/dnd\", \"components/DroppableHOC\", \"components/RegistryInjectorHOC\", \"product/toolbar/ProductToolbar\", \"util/deepObjectCache\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Map\"] = factory(require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false), require(false));\n\telse\n\t\troot[\"Map\"] = factory(root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined], root[undefined]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_6__, __WEBPACK_EXTERNAL_MODULE_8__, __WEBPACK_EXTERNAL_MODULE_10__, __WEBPACK_EXTERNAL_MODULE_11__, __WEBPACK_EXTERNAL_MODULE_12__, __WEBPACK_EXTERNAL_MODULE_19__, __WEBPACK_EXTERNAL_MODULE_28__, __WEBPACK_EXTERNAL_MODULE_29__, __WEBPACK_EXTERNAL_MODULE_30__, __WEBPACK_EXTERNAL_MODULE_31__, __WEBPACK_EXTERNAL_MODULE_32__, __WEBPACK_EXTERNAL_MODULE_34__, __WEBPACK_EXTERNAL_MODULE_47__, __WEBPACK_EXTERNAL_MODULE_65__, __WEBPACK_EXTERNAL_MODULE_66__, __WEBPACK_EXTERNAL_MODULE_68__, __WEBPACK_EXTERNAL_MODULE_70__, __WEBPACK_EXTERNAL_MODULE_72__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 64);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_0__;\n\n/***/ }),\n/* 1 */,\n/* 2 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n/***/ }),\n/* 3 */,\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\n/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0), __webpack_require__(9), __webpack_require__(10), __webpack_require__(7)], __WEBPACK_AMD_DEFINE_RESULT__ = (function (ol, MultiPointCluster, withDataRequest, cache) {\n    'use strict';\n\n    var FEATURE_CLUSTER_RADIUS = 12;\n    var FEATURE_CLUSTER_RADIUS_MAX = 20;\n    var VECTOR_FEATURE_SELECTION_OVERLAY = 'org-bigconnect-map-vector-selected-overlay';\n\n    var DEFAULT_LAYER_CONFIG = {\n        sortable: true,\n        toggleable: true\n    };\n\n    var layers = {\n        tile: {\n            configure: function configure(id) {\n                var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n                var source = options.source,\n                    _options$sourceOption = options.sourceOptions,\n                    sourceOptions = _options$sourceOption === undefined ? {} : _options$sourceOption,\n                    config = _objectWithoutProperties(options, ['source', 'sourceOptions']);\n\n                var baseLayerSource = void 0;\n\n                if (source in ol.source && _.isFunction(ol.source[source])) {\n                    baseLayerSource = new ol.source[source](_extends({\n                        crossOrigin: 'anonymous'\n                    }, sourceOptions));\n                } else {\n                    console.error('Unknown map provider type: ', source);\n                    throw new Error('map.provider is invalid');\n                }\n\n                var layer = new ol.layer.Tile(_extends({}, DEFAULT_LAYER_CONFIG, {\n                    id: id,\n                    label: 'Base',\n                    type: 'tile',\n                    sortable: false,\n                    source: baseLayerSource\n                }, config));\n\n                return { source: baseLayerSource, layer: layer };\n            },\n            addEvents: function addEvents(map, _ref, handlers) {\n                var source = _ref.source;\n\n                return [source.on('tileloaderror', function (event) {\n                    var MaxRetry = 3;\n                    var tile = event.tile;\n\n\n                    if (tile) {\n                        tile._retryCount = (tile._retryCount || 0) + 1;\n                        if (tile._retryCount <= MaxRetry) {\n                            console.warn('Tile error retry: ' + tile._retryCount + ' of ' + MaxRetry, tile.src_);\n                            _.defer(function () {\n                                tile.load();\n                            });\n                        }\n                    }\n                })];\n            }\n        },\n\n        cluster: {\n            configure: function configure(id) {\n                var _this = this;\n\n                var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n                var source = new ol.source.Vector({ features: [] });\n                var clusterSource = new MultiPointCluster({ source: source });\n                var layer = new ol.layer.Vector(_extends({}, DEFAULT_LAYER_CONFIG, {\n                    id: id,\n                    label: 'Cluster',\n                    type: 'cluster',\n                    style: function style(cluster) {\n                        return _this.style(cluster, { source: source });\n                    },\n                    source: clusterSource\n                }, options));\n                var heatmap = new ol.layer.Heatmap(_extends({}, DEFAULT_LAYER_CONFIG, options, {\n                    visible: false,\n                    id: 'heatmap_cluster',\n                    label: 'Heatmap',\n                    type: 'cluster_heatmap',\n                    source: source\n                }));\n\n                cache.clear();\n\n                return { source: source, clusterSource: clusterSource, layers: [heatmap, layer] };\n            },\n            style: function style(cluster) {\n                var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n                    source = _ref2.source,\n                    _ref2$selected = _ref2.selected,\n                    selected = _ref2$selected === undefined ? false : _ref2$selected;\n\n                var count = cluster.get('count');\n                var selectionState = cluster.get('selectionState') || 'none';\n                var isSelected = selected || selectionState !== 'none';\n\n                if (count > 1) {\n                    return styles.cluster(cluster, { selected: isSelected, source: source });\n                } else {\n                    return styles.feature(cluster.get('features')[0], { selected: isSelected });\n                }\n            },\n            addEvents: function addEvents(map, _ref3, handlers) {\n                var _this2 = this;\n\n                var source = _ref3.source,\n                    clusterSource = _ref3.clusterSource,\n                    layers = _ref3.layers;\n\n                var _layers = _slicedToArray(layers, 2),\n                    heatmapLayer = _layers[0],\n                    vectorLayer = _layers[1];\n\n                var addToElements = function addToElements(list) {\n                    return function (feature) {\n                        var el = feature.get('element');\n                        var key = el.type === 'vertex' ? 'vertices' : 'edges';\n                        list[key].push(el.id);\n                    };\n                };\n                var isPartiallySelected = function isPartiallySelected(cluster) {\n                    if (cluster.get('count') < 2) return false;\n\n                    var features = cluster.get('features');\n                    var selected = features.filter(function (f) {\n                        return f.get('selected');\n                    });\n                    return 0 < selected.length && selected.length < features.length;\n                };\n                var getClusterFromEvent = function getClusterFromEvent(_ref4) {\n                    var pixel = _ref4.pixel;\n\n                    var pixelFeatures = map.getFeaturesAtPixel(pixel, {\n                        layerFilter: function layerFilter(layer) {\n                            return layer === vectorLayer;\n                        }\n                    });\n                    return pixelFeatures && pixelFeatures[0];\n                };\n\n                // For heatmap selections\n                var onHeatmapClick = map.on('click', function (_ref5) {\n                    var pixel = _ref5.pixel;\n\n                    var elements = { vertices: [], edges: [] };\n                    map.forEachFeatureAtPixel(pixel, addToElements(elements), {\n                        layerFilter: function layerFilter(layer) {\n                            return layer === heatmapLayer;\n                        }\n                    });\n\n                    if (elements.vertices.length || elements.edges.length) {\n                        handlers.onSelectElements(elements);\n                    }\n                });\n\n                // For partial cluster selections\n                var onClusterClick = map.on('click', function (event) {\n                    var targetFeature = getClusterFromEvent(event);\n\n                    if (targetFeature && isPartiallySelected(targetFeature)) {\n                        var elements = { vertices: [], edges: [] };\n                        var clusterIterator = addToElements(elements);\n\n                        targetFeature.get('features').forEach(clusterIterator);\n                        handlers.onAddSelection(elements);\n                    }\n                });\n\n                //this does not support ol.interaction.Select.multi because of partial cluster selection\n                var selectInteraction = new ol.interaction.Select({\n                    addCondition: function addCondition(event) {\n                        if (event.originalEvent.shiftKey) {\n                            return true;\n                        } else {\n                            var targetFeature = getClusterFromEvent(event);\n                            return !!targetFeature && isPartiallySelected(targetFeature);\n                        }\n                    },\n                    condition: ol.events.condition.click,\n                    toggleCondition: ol.events.condition.platformModifierKeyOnly,\n                    layers: [vectorLayer],\n                    style: function style(cluster) {\n                        return _this2.style(cluster, { source: source, selected: true });\n                    }\n                });\n\n                map.addInteraction(selectInteraction);\n\n                var onSelectCluster = selectInteraction.on('select', function (event) {\n                    var selected = event.selected,\n                        interaction = event.target;\n\n                    var clusters = interaction.getFeatures();\n                    var elements = { vertices: [], edges: [] };\n                    var clusterIterator = addToElements(elements);\n\n                    clusters.forEach(function (cluster) {\n                        var features = cluster.get('features');\n                        if (isPartiallySelected(cluster) && !selected.includes(cluster)) {\n                            features = features.filter(function (f) {\n                                return f.get('selected');\n                            });\n                        }\n                        features.forEach(clusterIterator);\n                    });\n\n                    handlers.onSelectElements(elements);\n                });\n\n                var onClusterSourceChange = clusterSource.on('change', _.debounce(function () {\n                    var selected = selectInteraction.getFeatures(),\n                        clusters = this.getFeatures(),\n                        newSelection = [],\n                        isSelected = function isSelected(feature) {\n                        return feature.get('selected');\n                    };\n\n                    clusters.forEach(function (cluster) {\n                        var innerFeatures = cluster.get('features');\n                        var all = true,\n                            some = false,\n                            count = 0;\n                        innerFeatures.forEach(function (feature) {\n                            var selected = isSelected(feature);\n                            all = all && selected;\n                            some = some || selected;\n                            count += selected ? 1 : 0;\n                        });\n\n                        if (some) {\n                            newSelection.push(cluster);\n                            cluster.set('selectionState', all ? 'all' : 'some');\n                            cluster.set('selectionCount', count);\n                        } else {\n                            cluster.unset('selectionState');\n                            cluster.unset('selectionCount');\n                        }\n                    });\n\n                    selected.clear();\n                    if (newSelection.length) {\n                        selected.extend(newSelection);\n                    }\n                }, 100));\n\n                return [onHeatmapClick, onClusterClick, onSelectCluster, onClusterSourceChange];\n            },\n\n\n            update: syncFeatures\n        },\n\n        ancillary: {\n            configure: function configure(id) {\n                var _this3 = this;\n\n                var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n                var map = arguments[2];\n\n                var source = new ol.source.Vector({\n                    features: [],\n                    wrapX: false\n                });\n                if (options.getExtent) {\n                    var _superExtent = source.getExtent;\n                    source.getExtent = function () {\n                        var extent = _superExtent && _superExtent.apply(this, arguments);\n                        var customExtent = options.getExtent(map, source, extent);\n                        if (ol.extent.isEmpty(customExtent)) {\n                            return extent || ol.extent.createEmpty();\n                        }\n                        return customExtent || extent || ol.extent.createEmpty();\n                    };\n                }\n                var layer = new ol.layer.Vector(_extends({}, DEFAULT_LAYER_CONFIG, {\n                    id: id,\n                    type: 'ancillary',\n                    sortable: false,\n                    toggleable: false,\n                    source: source,\n                    renderBuffer: 500,\n                    updateWhileInteracting: true,\n                    updateWhileAnimating: true,\n                    style: function style(ancillary) {\n                        return _this3.style(ancillary);\n                    }\n                }, options));\n\n                return { source: source, layer: layer };\n            },\n            style: function style(ancillary) {\n                var extensionStyles = ancillary.get('styles');\n                if (extensionStyles) {\n                    var normal = extensionStyles.normal;\n\n                    if (normal.length) {\n                        return normal;\n                    }\n                }\n            },\n\n\n            update: syncFeatures\n        },\n\n        vectorXhr: {\n            configure: function configure(id) {\n                var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n                var _options$sourceOption2 = options.sourceOptions,\n                    sourceOptions = _options$sourceOption2 === undefined ? {} : _options$sourceOption2,\n                    layerOptions = _objectWithoutProperties(options, ['sourceOptions']);\n\n                var source = new ol.source.Vector(sourceOptions);\n                var layer = new ol.layer.Vector(_extends({}, DEFAULT_LAYER_CONFIG, {\n                    id: id,\n                    type: 'vectorXhr',\n                    source: source\n                }, layerOptions));\n\n                return { source: source, layer: layer };\n            },\n            addEvents: function addEvents(map, _ref6, handlers) {\n                var olSource = _ref6.source,\n                    layer = _ref6.layer;\n\n                var elements = { vertices: [], edges: [] };\n                var element = layer.get('element');\n                var key = element.type === 'vertex' ? 'vertices' : 'edges';\n                var overlayId = getOverlayIdForLayer(layer);\n\n                elements[key].push(element.id);\n\n                var onGeoShapeClick = map.on('click', function (e) {\n                    var map = e.map,\n                        pixel = e.pixel;\n\n                    var featuresAtPixel = map.getFeaturesAtPixel(pixel);\n                    var sourceFeatures = olSource.getFeatures();\n\n                    if (featuresAtPixel) {\n                        if (featuresAtPixel.length === 1 && featuresAtPixel[0].getId() === overlayId && olSource.getFeatureById(overlayId)) {\n                            handlers.onSelectElements({ vertices: [], edges: [] });\n                        } else if (featuresAtPixel.every(function (feature) {\n                            return sourceFeatures.includes(feature);\n                        })) {\n                            handlers.onSelectElements(elements);\n                        }\n                    }\n                });\n\n                var onLayerFeaturesLoaded = olSource.on('propertyChange', function (e) {\n                    if (e.key === 'status' && e.target.get(e.key) === 'loaded') {\n                        var selectionOverlay = olSource.getFeatureById(overlayId);\n\n                        if (selectionOverlay) {\n                            var extent = void 0;\n\n                            olSource.forEachFeature(function (feature) {\n                                var geom = feature.getGeometry();\n                                var featureExtent = geom.getExtent();\n\n                                if (feature.getId() !== overlayId) {\n                                    if (extent) {\n                                        ol.extent.extend(extent, featureExtent);\n                                    } else {\n                                        extent = featureExtent;\n                                    }\n                                }\n                            });\n\n                            var geometry = ol.geom.Polygon.fromExtent(extent);\n                            selectionOverlay.setGeometry(geometry);\n                        }\n                    }\n                });\n\n                return [onGeoShapeClick, onLayerFeaturesLoaded];\n            },\n            update: function update(source, _ref7) {\n                var olSource = _ref7.source,\n                    layer = _ref7.layer;\n                var element = source.element,\n                    features = source.features,\n                    selected = source.selected;\n\n                var layerStatus = layer.get('status');\n                var nextFeatures = [];\n                var changed = false;\n                var fitFeatures = void 0;\n\n                if (element !== layer.get('element')) {\n                    olSource.set('element', element);\n                    changed = true;\n                }\n\n                if (!layerStatus) {\n                    this.loadFeatures(olSource, layer).then(function (features) {\n                        if (features) {\n                            olSource.clear(true);\n                            olSource.addFeatures(features);\n                            layer.set('status', 'loaded');\n                        }\n                    });\n                } else if (selected !== olSource.get('selected')) {\n                    var overlayId = getOverlayIdForLayer(layer);\n                    olSource.set('selected', selected);\n                    changed = true;\n\n                    if (selected && layerStatus === 'loaded') {\n                        var extent = void 0;\n                        olSource.forEachFeature(function (feature) {\n                            var geom = feature.getGeometry();\n                            var featureExtent = geom.getExtent();\n\n                            if (feature.getId() !== overlayId) {\n                                if (extent) {\n                                    ol.extent.extend(extent, featureExtent);\n                                } else {\n                                    extent = featureExtent;\n                                }\n                            }\n                        });\n\n                        var selectedOverlay = new ol.Feature(ol.geom.Polygon.fromExtent(extent || [0, 0, 0, 0]));\n                        selectedOverlay.setStyle(new ol.style.Style({\n                            fill: new ol.style.Fill({ color: [0, 136, 204, 0.3] }),\n                            stroke: new ol.style.Stroke({ color: [0, 136, 204, 0.4], width: 1 })\n                        }));\n                        selectedOverlay.setId(overlayId);\n\n                        olSource.addFeature(selectedOverlay);\n                    } else {\n                        var _selectedOverlay = olSource.getFeatureById(overlayId);\n                        if (_selectedOverlay) {\n                            olSource.removeFeature(_selectedOverlay);\n                        }\n                    }\n                }\n\n                return { changed: changed };\n            },\n            loadFeatures: function loadFeatures(olSource, layer) {\n                var _layer$getProperties = layer.getProperties(),\n                    id = _layer$getProperties.id,\n                    element = _layer$getProperties.element,\n                    propName = _layer$getProperties.propName,\n                    propKey = _layer$getProperties.propKey,\n                    mimeType = _layer$getProperties.mimeType;\n\n                layer.set('status', 'loading');\n\n                return withDataRequest.dataRequest('vertex', 'propertyValue', id, propName, propKey).then(function (source) {\n                    var format = getFormatForMimeType(mimeType);\n                    var dataProjection = format.readProjection(source);\n\n                    if (!dataProjection || !ol.proj.get(dataProjection.getCode())) {\n                        throw new Error('unhandledDataProjection');\n                    } else {\n                        var features = format.readFeatures(source, {\n                            dataProjection: dataProjection,\n                            featureProjection: 'EPSG:3857'\n                        });\n\n                        return features;\n                    }\n                }).then(function (features) {\n                    return features.map(function (feature, i) {\n                        feature.setId(layer.get('id') + ':' + i);\n                        feature.set('element', element);\n\n                        return feature;\n                    });\n                }).catch(function (e) {\n                    var message = e.message === 'unhandledDataProjection' ? i18n('org.bigconnect.web.product.map.MapWorkProduct.layer.error.data.format') : i18n('org.bigconnect.web.product.map.MapWorkProduct.layer.error');\n\n                    layer.set('status', { type: 'error', message: message });\n                });\n            }\n        }\n    };\n\n    var styles = {\n        feature: function feature(_feature) {\n            var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n                _ref8$selected = _ref8.selected,\n                selected = _ref8$selected === undefined ? false : _ref8$selected;\n\n            var _feature$getPropertie = _feature.getProperties(),\n                focused = _feature$getPropertie.focused,\n                focusedDim = _feature$getPropertie.focusedDim,\n                extensionStyles = _feature$getPropertie.styles,\n                featureSelected = _feature$getPropertie.selected,\n                radius = _feature$getPropertie._nodeRadius;\n\n            var isSelected = selected || featureSelected;\n            var needSelectedStyle = true;\n            var needFocusStyle = true;\n            var styleList = void 0;\n\n            if (extensionStyles) {\n                var normalStyle = extensionStyles.normal,\n                    selectedStyle = extensionStyles.selected;\n\n                var style = void 0;\n                if (normalStyle.length && (!isSelected || !selectedStyle.length)) {\n                    style = normalStyle;\n                } else if (selectedStyle.length && isSelected) {\n                    style = selectedStyle;\n                }\n\n                if (style) {\n                    styleList = _.isArray(style) ? style : [style];\n                }\n            } else {\n                needSelectedStyle = false;\n                needFocusStyle = false;\n                styleList = cache.getOrCreateFeature({\n                    src: _feature.get(isSelected ? 'iconUrlSelected' : 'iconUrl'),\n                    imgSize: _feature.get('iconSize'),\n                    scale: 1 / _feature.get('pixelRatio'),\n                    anchor: _feature.get('iconAnchor')\n                }, focused);\n            }\n\n            if (_.isEmpty(styleList)) {\n                console.warn('No styles for feature, ignoring.', _feature);\n                return [];\n            }\n\n            if (needFocusStyle && focused) {\n                return cache.addFocus(radius, cache.reset(radius, styleList));\n            }\n            if (focusedDim) {\n                return cache.addDim(radius, styleList);\n            }\n\n            return cache.reset(radius, styleList);\n        },\n        cluster: function cluster(_cluster) {\n            var _ref9 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n                _ref9$selected = _ref9.selected,\n                selected = _ref9$selected === undefined ? false : _ref9$selected,\n                source = _ref9.source,\n                clusterSource = _ref9.clusterSource;\n\n            var count = _cluster.get('count'),\n                focusStats = _cluster.get('focusStats'),\n                selectionState = _cluster.get('selectionState') || 'none',\n                selectionCount = _cluster.get('selectionCount') || 0,\n                _source$countStats = source.countStats,\n                min = _source$countStats.min,\n                max = _source$countStats.max,\n                value = Math.min(max, Math.max(min, count)),\n                radius = min === max ? FEATURE_CLUSTER_RADIUS : interpolate(value, min, max, FEATURE_CLUSTER_RADIUS, FEATURE_CLUSTER_RADIUS_MAX);\n\n\n            return cache.getOrCreateCluster({\n                count: count, radius: radius, selected: selected, selectionState: selectionState, selectionCount: selectionCount, focusStats: focusStats\n            });\n        }\n    };\n\n    function interpolate(v, x0, x1, y0, y1) {\n        return (y0 * (x1 - v) + y1 * (v - x0)) / (x1 - x0);\n    }\n\n    function setLayerConfig() {\n        var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n        var layer = arguments[1];\n\n        var _config$visible = config.visible,\n            visible = _config$visible === undefined ? true : _config$visible,\n            _config$opacity = config.opacity,\n            opacity = _config$opacity === undefined ? 1 : _config$opacity,\n            _config$zIndex = config.zIndex,\n            zIndex = _config$zIndex === undefined ? 0 : _config$zIndex,\n            properties = _objectWithoutProperties(config, ['visible', 'opacity', 'zIndex']);\n\n        _.mapObject(properties, function (value, key) {\n            if (value === null) {\n                layer.unset(key);\n            } else {\n                layer.set(key, value);\n            }\n        });\n\n        layer.setVisible(visible);\n        layer.setOpacity(opacity);\n        layer.setZIndex(zIndex);\n    }\n\n    function syncFeatures(_ref10, _ref11, focused) {\n        var features = _ref10.features;\n        var source = _ref11.source;\n\n        var existingFeatures = _.indexBy(source.getFeatures(), function (f) {\n            return f.getId();\n        });\n        var newFeatures = [];\n        var changed = false;\n\n        if (features) {\n            for (var featureIndex = 0; featureIndex < features.length; featureIndex++) {\n                var data = features[featureIndex];\n\n                var id = data.id,\n                    _styles = data.styles,\n                    geometryOverride = data.geometry,\n                    geoLocations = data.geoLocations,\n                    element = data.element,\n                    rest = _objectWithoutProperties(data, ['id', 'styles', 'geometry', 'geoLocations', 'element']);\n\n                var geometry = null;\n\n                if (geometryOverride) {\n                    geometry = geometryOverride;\n                } else if (geoLocations) {\n                    geometry = cache.getOrCreateGeometry(id, geoLocations);\n                }\n\n                if (geometry) {\n                    var feature;\n\n                    (function () {\n                        var featureValues = _extends({}, rest, {\n                            element: element,\n                            geoLocations: geoLocations,\n                            geometry: geometry\n                        });\n\n                        if (_styles) {\n                            var normal = _styles.normal,\n                                selected = _styles.selected;\n\n                            if (normal && normal.length) {\n                                var radius = getRadiusFromStyles(normal);\n                                var normalImage = _.isFunction(normal[0].getImage) && normal[0].getImage();\n\n                                featureValues._nodeRadius = radius;\n\n                                if (selected.length === 0 && !geometryOverride && normalImage && _.isFunction(normalImage.getStroke)) {\n                                    var newSelected = normal[0].clone();\n                                    var prevStroke = normal[0].getImage().getStroke();\n                                    var newStroke = new ol.style.Stroke({\n                                        color: '#0088cc',\n                                        width: prevStroke && prevStroke.getWidth() || 1\n                                    });\n\n                                    newSelected.image_ = normal[0].getImage().clone({\n                                        stroke: newStroke,\n                                        opacity: 1\n                                    });\n\n                                    featureValues.styles = {\n                                        normal: normal,\n                                        selected: [newSelected]\n                                    };\n                                } else {\n                                    featureValues.styles = _styles;\n                                }\n                            }\n                        }\n\n                        if (focused && focused.isFocusing) {\n                            if (element.id in focused[element.type === 'vertex' ? 'vertices' : 'edges']) {\n                                featureValues.focused = true;\n                                featureValues.focusedDim = false;\n                            } else {\n                                featureValues.focused = false;\n                                featureValues.focusedDim = true;\n                            }\n                        } else {\n                            featureValues.focused = false;\n                            featureValues.focusedDim = false;\n                        }\n\n                        if (id in existingFeatures) {\n                            var existingFeature = existingFeatures[id];\n                            var diff = _.any(existingFeature.getProperties(), function (val, name) {\n                                switch (name) {\n                                    case 'styles':\n                                    case 'interacting':\n                                        return false;\n                                    case 'geoLocations':\n                                        return !_.isEqual(val, featureValues[name]);\n                                    default:\n                                        return val !== featureValues[name];\n                                }\n                            });\n\n                            if (diff) {\n                                changed = true;\n                                if (existingFeature.get('interacting')) {\n                                    delete featureValues.geometry;\n                                }\n                                existingFeature.setProperties(featureValues);\n                            }\n                            delete existingFeatures[id];\n                        } else {\n                            feature = new ol.Feature(featureValues);\n\n                            feature.setId(data.id);\n                            newFeatures.push(feature);\n                        }\n                    })();\n                }\n            }\n        }\n\n        var fitFeatures = void 0;\n        if (newFeatures.length) {\n            changed = true;\n            source.addFeatures(newFeatures);\n            fitFeatures = newFeatures;\n        }\n        if (!_.isEmpty(existingFeatures)) {\n            changed = true;\n            _.forEach(existingFeatures, function (feature) {\n                return source.removeFeature(feature);\n            });\n        }\n        return { changed: changed, fitFeatures: fitFeatures };\n    }\n\n    function getFormatForMimeType(mimeType) {\n        switch (mimeType) {\n            case 'application/vnd.geo+json':\n                return new ol.format.GeoJSON();\n            case 'application/vnd.google-earth.kml+xml':\n                return new ol.format.KML();\n        }\n    }\n\n    function getOverlayIdForLayer(layer) {\n        return layer.get('id') + '|' + VECTOR_FEATURE_SELECTION_OVERLAY;\n    }\n\n    function getRadiusFromStyles(styles) {\n        for (var i = styles.length - 1; i >= 0; i--) {\n            if (_.isFunction(styles[i].getImage)) {\n                var image = styles[i].getImage();\n                var radius = image && _.isFunction(image.getRadius) && image.getRadius();\n\n                if (radius) {\n                    var nodeRadius = radius / devicePixelRatio;\n                    return nodeRadius;\n                }\n            }\n        }\n    }\n\n    return {\n        byType: layers,\n        styles: styles,\n        setLayerConfig: setLayerConfig\n    };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ }),\n/* 5 */,\n/* 6 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_6__;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\n/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0), __webpack_require__(11)], __WEBPACK_AMD_DEFINE_RESULT__ = (function (ol, Cache) {\n\n    var MAX_CACHE_ITEMS = 1000;\n    var EXPIRATION_MINUTES = 5;\n    var DEBUG = false;\n    var SELECTED_COLOR = '#0088cc';\n\n    var cache = new Cache(MAX_CACHE_ITEMS, DEBUG);\n    var geoCache = new Cache(MAX_CACHE_ITEMS, DEBUG);\n    var cacheOptions = {\n        expirationSliding: EXPIRATION_MINUTES * 60\n    };\n    var FocusPadding = 3;\n    var FocusCirclePadding = 6;\n    var FocusRadius = 5;\n    var FocusFill = new ol.style.Fill({ color: SELECTED_COLOR });\n    var FocusStroke = new ol.style.Stroke({ color: '#ffffff', width: 1 });\n\n    return {\n        clear: function clear() {\n            cache.clear();\n            geoCache.clear();\n        },\n        getOrCreateGeometry: function getOrCreateGeometry(id, geoLocations) {\n            var hash = ['geo', id].concat(_toConsumableArray(geoLocations.map(function (_ref) {\n                var _ref2 = _slicedToArray(_ref, 2),\n                    latitude = _ref2[0],\n                    longitude = _ref2[1];\n\n                return latitude + ',' + longitude;\n            }))).join(',');\n            var geo = geoCache.getItem(hash);\n            if (!geo) {\n                geo = new ol.geom.MultiPoint(geoLocations.map(function (geo) {\n                    return ol.proj.fromLonLat(geo);\n                }));\n                geoCache.setItem(hash, geo, cacheOptions);\n            }\n            return geo;\n        },\n        getOrCreateFeature: function getOrCreateFeature(options, focused) {\n            var key = hash(options, focused);\n            var cached = cache.getItem(key);\n            if (cached) {\n                return cached;\n            }\n\n            var style = [new ol.style.Style({ image: new ol.style.Icon(options), zIndex: 1 })];\n            if (focused) {\n                var imgSize = options.imgSize,\n                    _options$anchor = options.anchor,\n                    anchor = _options$anchor === undefined ? [0.5, 0.5] : _options$anchor;\n\n                style.splice(0, 0, new ol.style.Style({\n                    renderer: function renderer(point, _ref3) {\n                        var context = _ref3.context,\n                            feature = _ref3.feature,\n                            geometry = _ref3.geometry,\n                            pixelRatio = _ref3.pixelRatio,\n                            resolution = _ref3.resolution,\n                            rotation = _ref3.rotation;\n\n                        context.setTransform(1, 0, 0, 1, 0, 0);\n                        var x = point[0] - imgSize[0] * anchor[0] - FocusPadding * pixelRatio;\n                        var y = point[1] - imgSize[1] * anchor[1] - FocusPadding * pixelRatio;\n                        var w = imgSize[0] + FocusPadding * 2 * pixelRatio;\n                        var h = imgSize[1] + FocusPadding * 2 * pixelRatio;\n                        var radius = FocusRadius * pixelRatio;\n\n                        context.save();\n                        context.globalAlpha = 0.2;\n                        context.beginPath();\n                        context.moveTo(x + radius, y);\n                        context.lineTo(x + w - radius, y);\n                        context.quadraticCurveTo(x + w, y, x + w, y + radius);\n                        context.lineTo(x + w, y + h - radius);\n                        context.quadraticCurveTo(x + w, y + h, x + w - radius, y + h);\n                        context.lineTo(x + radius, y + h);\n                        context.quadraticCurveTo(x, y + h, x, y + h - radius);\n                        context.lineTo(x, y + radius);\n                        context.quadraticCurveTo(x, y, x + radius, y);\n                        context.closePath();\n                        context.fillStyle = SELECTED_COLOR;\n                        context.shadowBlur = radius / 2;\n                        context.shadowColor = 'white';\n                        context.shadowOffsetX = 0;\n                        context.shadowOffsetY = 0;\n                        context.fill();\n\n                        context.restore();\n                    },\n\n                    zIndex: 0\n                }));\n            }\n            cache.setItem(key, style, cacheOptions);\n\n            return style;\n        },\n        getOrCreateCluster: function getOrCreateCluster(_ref4) {\n            var count = _ref4.count,\n                r = _ref4.radius,\n                selected = _ref4.selected,\n                selectionState = _ref4.selectionState,\n                selectionCount = _ref4.selectionCount,\n                _ref4$focusStats = _ref4.focusStats,\n                all = _ref4$focusStats.all,\n                some = _ref4$focusStats.some,\n                dim = _ref4$focusStats.dim;\n\n            var key = ['cluster', count, r, selected, selectionState, selectionCount, all, some, dim].join('|');\n\n            var style = cache.getItem(key);\n            if (style) {\n                return style;\n            }\n\n            style = [new ol.style.Style({\n                image: new ol.style.Circle({\n                    radius: r * devicePixelRatio,\n                    fill: new ol.style.Fill({ color: 'rgba(255,255,255,0.01)' })\n                })\n            }), new ol.style.Style({\n                renderer: function renderer(_ref5, _ref6) {\n                    var _ref7 = _slicedToArray(_ref5, 2),\n                        x = _ref7[0],\n                        y = _ref7[1];\n\n                    var context = _ref6.context,\n                        pixelRatio = _ref6.pixelRatio;\n\n                    var radius = r * pixelRatio;\n                    var unselectedFill = 'rgba(241,59,60,0.8)',\n                        selectedFill = 'rgba(0,112,195,0.8)',\n                        selectedFillNoAlpha = 'rgb(0,112,195)',\n                        unselectedStroke = '#AD2E2E',\n                        stroke = selected ? '#08538B' : unselectedStroke,\n                        lineWidth = 2 * pixelRatio,\n                        textStroke = stroke,\n                        fill = selected ? selectedFill : unselectedFill;\n\n                    if (selected && selectionState === 'some') {\n                        fill = unselectedFill;\n                        textStroke = unselectedStroke;\n                        stroke = unselectedStroke;\n                    }\n\n                    context.save();\n                    if (dim && !some) {\n                        context.globalAlpha = 0.4;\n                    }\n                    context.setTransform(1, 0, 0, 1, 0, 0);\n                    context.translate(x, y);\n\n                    if (some) {\n                        context.beginPath();\n                        context.arc(0, 0, radius + FocusCirclePadding * pixelRatio, 0, 2 * Math.PI, true);\n                        context.fillStyle = 'rgba(0, 136, 204, 0.2)';\n                        context.fill();\n                        context.closePath();\n                    }\n\n                    context.beginPath();\n                    context.arc(0, 0, radius, 0, 2 * Math.PI, true);\n                    context.fillStyle = fill;\n                    context.fill();\n\n                    if (selectionState === 'some') {\n                        context.strokeStyle = stroke;\n                        context.lineWidth = Math.max(4 * pixelRatio, lineWidth);\n                        context.stroke();\n                        context.closePath();\n                        var portion = Math.max(0.1, Math.min(0.9, selectionCount / count));\n                        context.beginPath();\n                        context.arc(0, 0, radius, Math.PI / -2, Math.PI * 2 * portion - Math.PI / 2, false);\n                        context.strokeStyle = selectedFillNoAlpha;\n                        context.stroke();\n                        context.closePath();\n                    } else {\n                        context.strokeStyle = stroke;\n                        context.lineWidth = lineWidth;\n                        context.stroke();\n                        context.closePath();\n                    }\n\n                    context.font = 'bold condensed ' + radius + 'px sans-serif';\n                    context.textAlign = 'center';\n                    context.fillStyle = 'white';\n                    context.textBaseline = 'middle';\n                    context.strokeStyle = textStroke;\n                    context.lineWidth = pixelRatio;\n\n                    if (some && some !== count) {\n                        var text = some.toString();\n                        context.strokeText(text, 0, radius * -0.4);\n                        context.fillText(text, 0, radius * -0.4);\n\n                        context.font = 'bold condensed ' + radius * 0.7 + 'px sans-serif';\n                        context.fillStyle = 'rgba(255,255,255,0.8)';\n                        context.strokeText(count.toString(), 0, radius * 0.55);\n                        context.fillText(count.toString(), 0, radius * 0.55);\n\n                        context.beginPath();\n                        context.moveTo(radius * -0.5, radius * 0.1);\n                        context.lineTo(radius * 0.5, radius * 0.1);\n                        context.strokeStyle = 'rgba(255,255,255,0.3)';\n                        context.stroke();\n                        context.closePath();\n                    } else {\n                        var _text = count.toString();\n                        context.strokeText(_text, 0, 0);\n                        context.fillText(_text, 0, 0);\n                    }\n\n                    context.restore();\n                }\n            })];\n\n            cache.setItem(key, style, cacheOptions);\n            return style;\n        },\n        addFocus: function addFocus(radius, list) {\n            var key = 'focus' + radius;\n            var focusStyle = cache.getItem(key);\n            if (!focusStyle) {\n                focusStyle = new ol.style.Style({\n                    image: new ol.style.Circle({\n                        radius: radius + 5,\n                        fill: FocusFill,\n                        stroke: FocusStroke\n                    }),\n                    zIndex: 0\n                });\n                focusStyle.getImage().setOpacity(0.2);\n                cache.setItem(key, focusStyle, cacheOptions);\n            }\n\n            return [focusStyle].concat(_toConsumableArray(list));\n        },\n        addDim: function addDim(radius, list) {\n            var image = list.length && list[0].getImage();\n            if (image) {\n                image.setOpacity(0.4);\n            }\n            return list;\n        },\n        reset: function reset(radius, list) {\n            var image = list.length && list[0].getImage();\n            if (image && image.getOpacity() < 1) {\n                image.setOpacity(1);\n            }\n            return list;\n        }\n    };\n\n    function hash(_ref8, focused) {\n        var src = _ref8.src,\n            imgSize = _ref8.imgSize,\n            scale = _ref8.scale,\n            anchor = _ref8.anchor;\n\n        return [focused, src, imgSize[0] + ',' + imgSize[1], scale, anchor[0] + ',' + anchor[1]].join('|');\n    }\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_8__;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\n\n/**\n * This file is a fork of http://openlayers.org/en/master/apidoc/ol.source.Cluster.html\n * with support for multi-point clusters.\n */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = (function (ol) {\n    'use strict';\n\n    var MultiPointCluster = function MultiPointCluster(options) {\n        ol.source.Vector.call(this, {\n            attributions: options.attributions,\n            extent: options.extent,\n            logo: options.logo,\n            projection: options.projection,\n            wrapX: options.wrapX\n        });\n\n        this.resolution = undefined;\n        this.distance = 20 * devicePixelRatio;\n        this.features = [];\n        this.geometryFunction = options.geometryFunction || function (feature) {\n            return feature.getGeometry();\n        };\n        this.source = options.source;\n        this.refresh = _.debounce(this.refresh.bind(this), 100);\n        this.source.on('change', this.refresh);\n    };\n\n    ol.inherits(MultiPointCluster, ol.source.Vector);\n\n    MultiPointCluster.prototype.refresh = function () {\n        this.clear();\n        this.cluster();\n        this.addFeatures(this.features);\n        this.changed();\n    };\n\n    MultiPointCluster.prototype.getSource = function () {\n        return this.source;\n    };\n\n    MultiPointCluster.prototype.loadFeatures = function (extent, resolution, projection) {\n        this.source.loadFeatures(extent, resolution, projection);\n        this.updateResolution(resolution);\n    };\n\n    MultiPointCluster.prototype.updateResolution = function (resolution) {\n        if (resolution !== this.resolution) {\n            this.clear();\n            this.resolution = resolution;\n            this.cluster();\n            this.addFeatures(this.features);\n        }\n    };\n\n    MultiPointCluster.prototype.setDistance = function (distance) {\n        this.distance = distance;\n        this.refresh();\n    };\n\n    MultiPointCluster.prototype.cluster = function () {\n        var self = this;\n        if (this.resolution === undefined) {\n            return;\n        }\n        var resolution = this.resolution;\n        var distance = this.distance;\n        this.features.length = 0;\n        var source = this.source;\n        var features = source.getFeatures();\n        var clustered = {};\n\n        var getRadius = function getRadius(feature) {\n            var radius = feature.get('_nodeRadius') * devicePixelRatio;\n            return radius || distance;\n        };\n        var maxRadius = features.reduce(function (max, f) {\n            var radius = getRadius(f);\n            return Math.max(max, radius);\n        }, 0);\n        var countStats = { max: 0, min: Number.MAX_VALUE };\n        this.source.countStats = countStats;\n\n        for (var i = 0; i < features.length; i++) {\n            clusterFeature(features[i]);\n        }\n\n        function clusterFeature(feature) {\n            var radius = getRadius(feature);\n            var mapDistanceSearch = (radius + maxRadius) * resolution;\n            var mapDistance = radius * resolution;\n            var geometry = self.geometryFunction(feature);\n            if (geometry) {\n                var coordinates = geometry.getCoordinates();\n                for (var _i = 0; _i < coordinates.length; _i++) {\n                    clusterCoordinate(coordinates[_i], _i);\n                }\n            }\n\n            function clusterCoordinate(coordinate, coordinateIndex) {\n                if (!(feature.getId().toString() + '_' + coordinateIndex in clustered)) {\n\n                    // Search radius is this feature box + max size\n                    var extentSearch = ol.extent.boundingExtent([coordinate]);\n                    ol.extent.buffer(extentSearch, mapDistanceSearch, extentSearch);\n\n                    // Exact bounds to further match for collision\n                    var extent1 = ol.extent.boundingExtent([coordinate]);\n                    ol.extent.buffer(extent1, mapDistance, extent1);\n\n                    var neighbors = source.getFeaturesInExtent(extentSearch),\n                        coords = [],\n                        count = 0;\n\n                    var featuresToCluster = neighbors.filter(function (neighbor) {\n                        var neighborGeometry = self.geometryFunction(neighbor);\n                        var neighborCoordinates = neighborGeometry.getCoordinates();\n                        var neighborUid = neighbor.getId().toString() + '_';\n\n                        var coordsInCluster = neighborCoordinates.filter(function (coordinate, coordinateIndex) {\n                            var uid = neighborUid + coordinateIndex;\n\n                            var extent2 = ol.extent.boundingExtent([coordinate]);\n                            ol.extent.buffer(extent2, getRadius(neighbor) * resolution, extent2);\n\n                            if (ol.extent.intersects(extent1, extent2)) {\n                                if (!(uid in clustered)) {\n                                    coords.push(coordinate);\n                                    clustered[uid] = true;\n                                    return true;\n                                }\n                            }\n                            return false;\n                        }).length;\n                        count += coordsInCluster;\n                        return coordsInCluster > 0;\n                    });\n\n                    countStats.max = Math.max(count, countStats.max);\n                    countStats.min = Math.min(count, countStats.min);\n                    self.features.push(self.createCluster(featuresToCluster, coords, count));\n                }\n            }\n        }\n    };\n\n    MultiPointCluster.prototype.createCluster = function (features, coordinates, count) {\n        var focusStats = { some: 0, all: false, dim: false };\n        features.forEach(function (feature) {\n            var focused = feature.get('focused');\n            focusStats.some += focused ? 1 : 0;\n            focusStats.all = focusStats.all && focused;\n            focusStats.dim = focusStats.dim || feature.get('focusedDim');\n        });\n        var centers = coordinates.reduce(function (sums, c) {\n            return sums.map(function (s, i) {\n                return s + c[i];\n            });\n        }, [0, 0]);\n        var average = centers.map(function (val) {\n            return val / coordinates.length;\n        });\n        var geometry = new ol.geom.Point(average);\n\n        return new ol.Feature({ geometry: geometry, features: features, coordinates: coordinates, count: count, focusStats: focusStats });\n    };\n\n    return MultiPointCluster;\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_10__;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_11__;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_12__;\n\n/***/ }),\n/* 13 */,\n/* 14 */,\n/* 15 */,\n/* 16 */,\n/* 17 */,\n/* 18 */,\n/* 19 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_19__;\n\n/***/ }),\n/* 20 */,\n/* 21 */,\n/* 22 */,\n/* 23 */,\n/* 24 */,\n/* 25 */,\n/* 26 */,\n/* 27 */,\n/* 28 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_28__;\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_29__;\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_30__;\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_31__;\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_32__;\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(34)], __WEBPACK_AMD_DEFINE_RESULT__ = (function (actions) {\n    actions.protectFromWorker();\n\n    return actions.createActions({\n        workerImpl: 'com/mware/web/product/map/dist/actions-impl',\n        actions: {\n            dropElements: function dropElements(productId, elements, _ref) {\n                var undoable = _ref.undoable;\n                return { productId: productId, elements: elements, undoable: undoable };\n            },\n            removeElements: function removeElements(productId, elements, _ref2) {\n                var undoable = _ref2.undoable;\n                return { productId: productId, elements: elements, undoable: undoable };\n            },\n\n            setLayerOrder: function setLayerOrder(productId, layerOrder) {\n                return { productId: productId, layerOrder: layerOrder };\n            }\n        }\n    });\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_34__;\n\n/***/ }),\n/* 35 */,\n/* 36 */,\n/* 37 */,\n/* 38 */,\n/* 39 */,\n/* 40 */,\n/* 41 */,\n/* 42 */,\n/* 43 */,\n/* 44 */,\n/* 45 */,\n/* 46 */,\n/* 47 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_47__;\n\n/***/ }),\n/* 48 */,\n/* 49 */,\n/* 50 */,\n/* 51 */,\n/* 52 */,\n/* 53 */,\n/* 54 */,\n/* 55 */,\n/* 56 */,\n/* 57 */,\n/* 58 */,\n/* 59 */,\n/* 60 */,\n/* 61 */,\n/* 62 */,\n/* 63 */,\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\n/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(29), __webpack_require__(8), __webpack_require__(47), __webpack_require__(30), __webpack_require__(31), __webpack_require__(32), __webpack_require__(28), __webpack_require__(65), __webpack_require__(33), __webpack_require__(66), __webpack_require__(67), __webpack_require__(4)], __WEBPACK_AMD_DEFINE_RESULT__ = (function (redux, ReactDom, registry, selectionActions, productActions, productSelectors, ontologySelectors, dnd, mapActions, DroppableHOC, Map, layerHelpers) {\n    'use strict';\n\n    registry.registerExtension('org.bigconnect.product.toolbar.item', {\n        identifier: 'org-bigconnect-map-layers',\n        itemComponentPath: 'com/mware/web/product/map/dist/MapLayersContainer',\n        placementHint: 'popover',\n        label: i18n('org.bigconnect.web.product.map.MapWorkProduct.layers.toolbar.item.label'),\n        canHandle: function canHandle(product) {\n            return product.kind === 'org.bigconnect.web.product.map.MapWorkProduct';\n        }\n    });\n\n    var mimeTypes = [BC_MIMETYPES.ELEMENTS];\n\n    return redux.connect(function (state, props) {\n        var product = productSelectors.getProduct(state);\n        var layerConfig = product.extendedData && product.extendedData['org-bigconnect-map-layers'] && product.extendedData['org-bigconnect-map-layers'].config;\n\n        return _extends({}, props, {\n            workspaceId: state.workspace.currentId,\n            configProperties: state.configuration.properties,\n            ontologyProperties: ontologySelectors.getProperties(state),\n            panelPadding: { top: 0, left: 0, right: 0, bottom: 0 },\n            selection: productSelectors.getSelectedElementsInProduct(state),\n            viewport: productSelectors.getViewport(state),\n            productElementIds: productSelectors.getElementIdsInProduct(state),\n            product: productSelectors.getProduct(state),\n            elements: productSelectors.getElementsInProduct(state),\n            focused: productSelectors.getFocusedElementsInProduct(state),\n            pixelRatio: state.screen.pixelRatio,\n            mimeTypes: mimeTypes,\n            style: { height: '100%' },\n            layerConfig: layerConfig\n        });\n    }, function (dispatch, props) {\n        return {\n            onClearSelection: function onClearSelection() {\n                return dispatch(selectionActions.clear());\n            },\n            onAddSelection: function onAddSelection(selection) {\n                return dispatch(selectionActions.add(selection));\n            },\n            onSelectElements: function onSelectElements(selection) {\n                return dispatch(selectionActions.set(selection));\n            },\n            onSelectAll: function onSelectAll(id) {\n                return dispatch(productActions.selectAll(id));\n            },\n\n            onUpdatePreview: function onUpdatePreview(id, dataUrl) {\n                return dispatch(productActions.updatePreview(id, dataUrl));\n            },\n\n            // TODO: these should be mapActions\n            onUpdateViewport: function onUpdateViewport(id, _ref) {\n                var pan = _ref.pan,\n                    zoom = _ref.zoom;\n                return dispatch(productActions.updateViewport(id, { pan: pan, zoom: zoom }));\n            },\n\n            // For DroppableHOC\n            onDrop: function onDrop(event) {\n                var elements = dnd.getElementsFromDataTransfer(event.dataTransfer);\n                if (elements) {\n                    event.preventDefault();\n                    event.stopPropagation();\n\n                    dispatch(mapActions.dropElements(props.product.id, elements, { undoable: true }));\n                }\n            },\n\n            onDropElementIds: function onDropElementIds(elementIds) {\n                dispatch(mapActions.dropElements(props.product.id, elementIds, { undoable: true }));\n            },\n\n\n            onRemoveElementIds: function onRemoveElementIds(elementIds) {\n                dispatch(mapActions.removeElements(props.product.id, elementIds, { undoable: true }));\n            },\n\n            onVertexMenu: function onVertexMenu(element, vertexId, position) {\n                $(element).trigger('showVertexContextMenu', { vertexId: vertexId, position: position });\n            },\n\n            setLayerOrder: function setLayerOrder(layerOrder) {\n                return dispatch(mapActions.setLayerOrder(props.product.id, layerOrder));\n            }\n        };\n    })(DroppableHOC(Map));\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_65__;\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_66__;\n\n/***/ }),\n/* 67 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\n/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(6), __webpack_require__(2), __webpack_require__(69), __webpack_require__(71), __webpack_require__(4), __webpack_require__(47), __webpack_require__(68), __webpack_require__(12), __webpack_require__(72), __webpack_require__(19), __webpack_require__(7)], __WEBPACK_AMD_DEFINE_RESULT__ = (function (createReactClass, PropTypes, OpenLayers, clusterHover, layerHelpers, registry, RegistryInjectorHOC, F, DeepObjectCache, mapConfig, clusterCache) {\n    'use strict';\n\n    var iconAnchor = [0.5, 1.0];\n    var getIconSize = _.memoize(function (ratio) {\n        return [22, 40].map(function (v) {\n            return v * ratio;\n        });\n    });\n\n    /**\n     * @deprecated Use {@link org.bigconnect.product.toolbar.item} instead\n     */\n    registry.documentExtensionPoint('org.bigconnect.map.options', 'Add components to the map options toolbar', function (e) {\n        return 'identifier' in e && 'optionComponentPath' in e;\n    }, 'https://docs.bigconnect.io/developer-guide/plugin-development/web-plugins/extension-point-reference-1/map-options');\n\n    registry.markUndocumentedExtensionPoint('org.bigconnect.map.style');\n\n    registry.markUndocumentedExtensionPoint('org.bigconnect.map.geometry');\n\n    registry.markUndocumentedExtensionPoint('org.bigconnect.map.layer');\n\n    var REQUEST_UPDATE_DEBOUNCE = 300;\n    var GEOSHAPE_MIMETYPES = ['application/vnd.geo+json', 'application/vnd.google-earth.kml+xml'];\n\n    var Map = createReactClass({\n        displayName: 'Map',\n\n\n        propTypes: {\n            configProperties: PropTypes.object.isRequired,\n            onUpdateViewport: PropTypes.func.isRequired,\n            onSelectElements: PropTypes.func.isRequired,\n            onVertexMenu: PropTypes.func.isRequired,\n            elements: PropTypes.shape({ vertices: PropTypes.object, edges: PropTypes.object })\n        },\n\n        getInitialState: function getInitialState() {\n            return { viewport: this.props.viewport, generatePreview: true };\n        },\n        shouldComponentUpdate: function shouldComponentUpdate(nextProps) {\n            var _this = this;\n\n            var onlyViewportChanged = Object.keys(nextProps).every(function (key) {\n                if (key === 'viewport') {\n                    return true;\n                }\n                return _this.props[key] === nextProps[key];\n            });\n\n            if (onlyViewportChanged) {\n                return false;\n            }\n            return true;\n        },\n        componentWillMount: function componentWillMount() {\n            this.caches = {\n                styles: {\n                    canHandle: new DeepObjectCache(),\n                    style: new DeepObjectCache(),\n                    selectedStyle: new DeepObjectCache()\n                },\n                geometries: {\n                    canHandle: new DeepObjectCache(),\n                    geometry: new DeepObjectCache()\n                }\n            };\n            this.requestUpdateDebounce = _.debounce(this.clearCaches, REQUEST_UPDATE_DEBOUNCE);\n        },\n        componentDidMount: function componentDidMount() {\n            var _this2 = this;\n\n            this.mounted = true;\n\n            $(this.wrap).on('selectAll', function (event) {\n                _this2.props.onSelectAll(_this2.props.product.id);\n            });\n            $(document).on('elementsCut.org-bigconnect-map', function (event, _ref) {\n                var vertexIds = _ref.vertexIds;\n\n                _this2.props.onRemoveElementIds({ vertexIds: vertexIds, edgeIds: [] });\n            });\n            $(document).on('elementsPasted.org-bigconnect-map', function (event, elementIds) {\n                _this2.props.onDropElementIds(elementIds);\n            });\n\n            this.saveViewportDebounce = _.debounce(this.saveViewport, 250);\n\n            this.legacyListeners({\n                fileImportSuccess: { node: $('.products-full-pane.visible')[0], handler: function handler(event, _ref2) {\n                        var vertexIds = _ref2.vertexIds;\n\n                        _this2.props.onDropElementIds({ vertexIds: vertexIds });\n                    } }\n            });\n        },\n        componentWillUnmount: function componentWillUnmount() {\n            this.mounted = false;\n            this.removeEvents.forEach(function (_ref3) {\n                var node = _ref3.node,\n                    func = _ref3.func,\n                    events = _ref3.events;\n\n                $(node).off(events, func);\n            });\n\n            $(this.wrap).off('selectAll');\n            $(document).off('.org-bigconnect-map');\n            this.saveViewport(this.props);\n        },\n        componentWillReceiveProps: function componentWillReceiveProps(nextProps) {\n            if (nextProps.product.id === this.props.product.id) {\n                this.setState({ viewport: {}, generatePreview: false });\n            } else {\n                this.saveViewport(this.props);\n                this.setState({ viewport: nextProps.viewport || {}, generatePreview: true });\n            }\n        },\n        render: function render() {\n            var _this3 = this;\n\n            var _state = this.state,\n                viewport = _state.viewport,\n                generatePreview = _state.generatePreview;\n            var _props = this.props,\n                product = _props.product,\n                registry = _props.registry,\n                panelPadding = _props.panelPadding,\n                focused = _props.focused,\n                layerConfig = _props.layerConfig,\n                setLayerOrder = _props.setLayerOrder,\n                onAddSelection = _props.onAddSelection,\n                onSelectElements = _props.onSelectElements;\n\n            var _mapConfig = mapConfig(),\n                baseSource = _mapConfig.source,\n                baseSourceOptions = _mapConfig.sourceOptions,\n                config = _objectWithoutProperties(_mapConfig, ['source', 'sourceOptions']);\n\n            var layerExtensions = _.indexBy(registry['org.bigconnect.map.layer'], 'id');\n\n            return React.createElement(\n                'div',\n                { className: 'org-bigconnect-map', style: { height: '100%', marginTop: '2px' }, ref: function ref(r) {\n                        _this3.wrap = r;\n                    } },\n                React.createElement(OpenLayers, _extends({\n                    ref: function ref(c) {\n                        _this3._openlayers = c;\n                    },\n                    product: product,\n                    focused: focused,\n                    baseSource: baseSource,\n                    baseSourceOptions: baseSourceOptions,\n                    sourcesByLayerId: this.mapElementsToSources(),\n                    layerExtensions: layerExtensions,\n                    layerConfig: layerConfig,\n                    viewport: viewport,\n                    generatePreview: generatePreview,\n                    panelPadding: panelPadding,\n                    clearCaches: this.requestUpdateDebounce,\n                    setLayerOrder: setLayerOrder,\n                    onTap: this.onTap,\n                    onPan: this.onViewport,\n                    onZoom: this.onViewport,\n                    onContextTap: this.onContextTap,\n                    onAddSelection: onAddSelection,\n                    onSelectElements: onSelectElements,\n                    onMouseOver: this.onMouseOver,\n                    onMouseOut: this.onMouseOut,\n                    onUpdatePreview: this.onUpdatePreview\n                }, config))\n            );\n        },\n        onTap: function onTap(_ref4) {\n            var map = _ref4.map,\n                pixel = _ref4.pixel;\n\n            if (!map.hasFeatureAtPixel(pixel)) {\n                this.props.onClearSelection();\n            }\n        },\n        onMouseOver: function onMouseOver(ol, map, features) {\n            var cluster = features && features[0];\n            var coordinates = cluster && cluster.get('coordinates');\n            if (coordinates && coordinates.length > 1) {\n                clusterHover.show(ol, map, cluster, layerHelpers.styles.feature);\n            }\n        },\n        onMouseOut: function onMouseOut(ol, map, features) {\n            clusterHover.hide(ol, map);\n        },\n        onContextTap: function onContextTap(ol, _ref5) {\n            var map = _ref5.map,\n                pixel = _ref5.pixel,\n                originalEvent = _ref5.originalEvent;\n\n            clusterHover.hide(ol, map);\n\n            var productVertices = this.props.product.extendedData.vertices;\n            var featuresAtPixel = map.getFeaturesAtPixel(pixel);\n            var isValidVertex = function isValidVertex(element) {\n                var isAncillary = element && productVertices[element.id] && productVertices[element.id].ancillary;\n                return element && element.type === 'vertex' && !isAncillary;\n            };\n            var vertexId = void 0;\n\n            if (featuresAtPixel && featuresAtPixel.length) {\n                var _target = featuresAtPixel[0];\n                var element = _target.get('element');\n\n                if (isValidVertex(element)) {\n                    vertexId = element.id;\n                } else {\n                    var clusteredFeatures = _target.get('features') || [];\n                    var clusteredFeature = clusteredFeatures.find(function (f) {\n                        var element = f.get('element');\n                        return isValidVertex(element);\n                    });\n                    vertexId = clusteredFeature && clusteredFeature.get('element').id;\n                }\n            }\n\n            if (vertexId) {\n                var pageX = originalEvent.pageX,\n                    pageY = originalEvent.pageY;\n\n                this.props.onVertexMenu(originalEvent.target, vertexId, { x: pageX, y: pageY });\n            }\n        },\n        onUpdatePreview: function onUpdatePreview() {\n            var _props2 = this.props,\n                onUpdatePreview = _props2.onUpdatePreview,\n                product = _props2.product;\n\n\n            onUpdatePreview(product.id);\n        },\n        onViewport: function onViewport(event) {\n            var productId = this.props.product.id;\n\n            var view = event.target;\n            var zoom = view.getZoom();\n            var pan = [].concat(_toConsumableArray(view.getCenter()));\n\n            if (!this.currentViewport) {\n                this.currentViewport = {};\n            }\n            this.currentViewport[productId] = { zoom: zoom, pan: pan };\n\n            this.saveViewportDebounce(this.props);\n        },\n        saveViewport: function saveViewport(props) {\n            if (this.mounted) {\n                var productId = props.product.id;\n                if (this.currentViewport && productId in this.currentViewport) {\n                    var viewport = this.currentViewport[productId];\n                    props.onUpdateViewport(productId, viewport);\n                }\n            }\n        },\n        getGeometry: function getGeometry(edgeInfo, element, ontology) {\n            var _this4 = this;\n\n            var registry = this.props.registry;\n\n            var calculatedGeometry = registry['org.bigconnect.map.geometry'].reduce(function (geometries, _ref6) {\n                var canHandle = _ref6.canHandle,\n                    geometry = _ref6.geometry,\n                    layer = _ref6.layer;\n\n                /**\n                 * Decide which elements to apply geometry\n                 *\n                 * @function org.bigconnect.map.geometry~canHandle\n                 * @param {object} productEdgeInfo The edge info from product->vertex\n                 * @param {object} element The element\n                 * @param {Array.} element.properties The element properties\n                 * @param {object} ontology The ontology object for this element (concept/relationship)\n                 * @returns {boolean} True if extension should handle this element (style/selectedStyle functions will be invoked.)\n                 */\n                if (_this4.caches.geometries.canHandle.getOrUpdate(canHandle, edgeInfo, element, ontology)) {\n\n                    /**\n                     * Return an OpenLayers [`ol.geom.Geometry`](http://openlayers.org/en/latest/apidoc/ol.geom.Geometry.html)\n                     * object for the given element.\n                     *\n                     * @function org.bigconnect.map.geometry~geometry\n                     * @param {object} productEdgeInfo The edge info from product->vertex\n                     * @param {object} element The element\n                     * @param {Array.} element.properties The element properties\n                     * @param {object} ontology The ontology element (concept / relationship)\n                     * @returns {ol.geom.Geometry}\n                     */\n                    var geo = _this4.caches.geometries.geometry.getOrUpdate(geometry, edgeInfo, element, ontology);\n                    if (geo) {\n                        /**\n                         * Provide a layer configuration object to specify which layer this geometry should be placed on\n                         *\n                         * @typedef org.bigconnect.map.geometry~layer\n                         * @property {string} id The id of the layer\n                         * @property {string} type The type of layer\n                         *\n                         */\n                        geometries.push({\n                            geometry: geo,\n                            layer: layer\n                        });\n                    }\n                }\n                return geometries;\n            }, []);\n\n            if (calculatedGeometry.length) {\n                if (calculatedGeometry.length > 1) {\n                    console.warn('Multiple geometry extensions applying to element, ignoring others', calculatedGeometry.slice(1));\n                }\n                return calculatedGeometry[0];\n            }\n        },\n        getStyles: function getStyles(edgeInfo, element, ontology) {\n            var _this5 = this;\n\n            var registry = this.props.registry;\n\n            var calculatedStyles = registry['org.bigconnect.map.style'].reduce(function (styles, _ref7) {\n                var canHandle = _ref7.canHandle,\n                    style = _ref7.style,\n                    selectedStyle = _ref7.selectedStyle;\n\n\n                /**\n                 * Decide which elements to apply style\n                 *\n                 * @function org.bigconnect.map.style~canHandle\n                 * @param {object} productEdgeInfo The edge info from product->vertex\n                 * @param {object} element The element\n                 * @param {Array.} element.properties The element properties\n                 * @param {object} ontology The ontology object for this element (concept/relationship)\n                 * @returns {boolean} True if extension should handle this element (style/selectedStyle functions will be invoked.)\n                 */\n                if (_this5.caches.styles.canHandle.getOrUpdate(canHandle, edgeInfo, element, ontology)) {\n                    if (style) {\n                        /**\n                         * Return an OpenLayers [`ol.style.Style`](http://openlayers.org/en/latest/apidoc/ol.style.Style.html)\n                         * object for the given element.\n                         *\n                         * @function org.bigconnect.map.style~style\n                         * @param {object} productEdgeInfo The edge info from product->vertex\n                         * @param {object} element The element\n                         * @param {Array.} element.properties The element properties\n                         * @returns {ol.style.Style}\n                         */\n                        var normalStyle = _this5.caches.styles.style.getOrUpdate(style, edgeInfo, element, ontology);\n                        if (normalStyle) {\n                            if (_.isArray(normalStyle)) {\n                                var _styles$normal;\n\n                                if (normalStyle.length) (_styles$normal = styles.normal).push.apply(_styles$normal, _toConsumableArray(normalStyle));\n                            } else {\n                                styles.normal.push(normalStyle);\n                            }\n                        }\n                    }\n\n                    if (selectedStyle) {\n                        var output = _this5.caches.styles.selectedStyle.getOrUpdate(selectedStyle, edgeInfo, element, ontology);\n                        if (output) {\n                            if (_.isArray(output)) {\n                                var _styles$selected;\n\n                                if (output.length) (_styles$selected = styles.selected).push.apply(_styles$selected, _toConsumableArray(output));\n                            } else {\n                                styles.selected.push(output);\n                            }\n                        }\n                    }\n                }\n                return styles;\n            }, { normal: [], selected: [] });\n\n            if (calculatedStyles.normal.length || calculatedStyles.selected.length) {\n                return calculatedStyles;\n            }\n        },\n        mapElementsToSources: function mapElementsToSources() {\n            var _this6 = this;\n\n            var _props3 = this.props,\n                product = _props3.product,\n                workspaceId = _props3.workspaceId;\n            var extendedData = product.extendedData;\n\n            if (!extendedData || !extendedData.vertices) return [];\n            var _props$elements = this.props.elements,\n                vertices = _props$elements.vertices,\n                edges = _props$elements.edges;\n\n            var elementsSelectedById = _extends({}, _.indexBy(this.props.selection.vertices), _.indexBy(this.props.selection.edges));\n            var elements = Object.values(vertices).concat(Object.values(edges));\n            var geoLocationProperties = _.groupBy(this.props.ontologyProperties, 'dataType').geoLocation;\n            var addOrUpdateSource = function addOrUpdateSource(_ref8, feature) {\n                var id = _ref8.id,\n                    rest = _objectWithoutProperties(_ref8, ['id']);\n\n                if (!sources[id]) {\n                    sources[id] = _extends({ features: [] }, rest);\n                } else if (!sources[id].features) {\n                    sources[id].features = [];\n                }\n\n                sources[id].features.push(feature);\n            };\n            var sources = {\n                cluster: {\n                    id: 'cluster',\n                    type: 'cluster',\n                    features: []\n                }\n            };\n\n            elements.forEach(function (el) {\n                var extendedDataType = extendedData[el.type === 'vertex' ? 'vertices' : 'edges'];\n                var edgeInfo = extendedDataType[el.id];\n                var ontology = F.vertex.ontology(el);\n                var styles = _this6.getStyles(edgeInfo, el, ontology);\n                var geometryOverride = _this6.getGeometry(edgeInfo, el, ontology);\n                var geometry = geometryOverride && geometryOverride.geometry;\n                var layer = geometryOverride && geometryOverride.layer || {};\n                var selected = el.id in elementsSelectedById;\n\n                if (extendedData.vertices[el.id] && extendedData.vertices[el.id].ancillary) {\n                    addOrUpdateSource(_extends({ id: 'ancillary', type: 'ancillary' }, layer), {\n                        id: el.id,\n                        element: el,\n                        selected: selected,\n                        styles: styles,\n                        geometry: geometry\n                    });\n\n                    return;\n                }\n\n                if (F.vertex.displayType(el) === 'document') {\n                    var mimeType = F.vertex.prop(el, ONTOLOGY_CONSTANTS.PROP_MIME_TYPE);\n\n                    if (GEOSHAPE_MIMETYPES.includes(mimeType)) {\n                        var rawProp = F.vertex.props(el, ONTOLOGY_CONSTANTS.PROP_RAW)[0];\n                        addOrUpdateSource({\n                            id: el.id,\n                            element: el,\n                            type: 'vectorXhr',\n                            mimeType: mimeType,\n                            propName: rawProp.name,\n                            propKey: rawProp.key,\n                            selected: selected,\n                            styles: styles\n                        });\n                    }\n                }\n\n                var geoLocations = geoLocationProperties && geoLocationProperties.reduce(function (props, _ref9) {\n                    var title = _ref9.title;\n\n                    var geoProps = F.vertex.props(el, title);\n                    geoProps.forEach(function (geoProp) {\n                        var value = geoProp.value;\n\n                        if (value) {\n                            var latitude = value.latitude,\n                                longitude = value.longitude;\n\n                            if (!isNaN(latitude) && !isNaN(longitude)) {\n                                var validCoordinates = latitude >= -90 && latitude <= 90 && longitude >= -180 && longitude <= 180;\n                                if (validCoordinates) {\n                                    props.push([longitude, latitude]);\n                                } else {\n                                    console.warn('Vertex has geoLocation with invalid coordinates', value, el);\n                                }\n                            }\n                        }\n                    });\n                    return props;\n                }, []),\n                    iconUrl = 'map/marker/image?' + $.param({\n                    type: el.conceptType,\n                    workspaceId: _this6.props.workspaceId,\n                    scale: _this6.props.pixelRatio > 1 ? '2' : '1'\n                }),\n                    iconUrlSelected = iconUrl + '&selected=true';\n\n                if (geoLocations.length) {\n                    addOrUpdateSource(_extends({ id: 'cluster' }, layer), {\n                        id: el.id,\n                        element: el,\n                        selected: selected,\n                        iconUrl: iconUrl,\n                        iconUrlSelected: iconUrlSelected,\n                        iconSize: getIconSize(_this6.props.pixelRatio),\n                        iconAnchor: iconAnchor,\n                        pixelRatio: _this6.props.pixelRatio,\n                        styles: styles,\n                        geometry: geometry,\n                        geoLocations: geoLocations\n                    });\n                }\n            });\n\n            return sources;\n        },\n        legacyListeners: function legacyListeners(map) {\n            var _this7 = this;\n\n            this.removeEvents = [];\n\n            _.each(map, function (handler, events) {\n                var node = _this7.wrap;\n                var func = handler;\n                if (!_.isFunction(handler)) {\n                    node = handler.node;\n                    func = handler.handler;\n                }\n                _this7.removeEvents.push({ node: node, func: func, events: events });\n                $(node).on(events, func);\n            });\n        },\n        clearCaches: function clearCaches() {\n            var _this8 = this;\n\n            clusterCache.clear();\n\n            if (this.mounted) {\n                Object.keys(this.caches).forEach(function (k) {\n                    Object.keys(_this8.caches[k]).forEach(function (key) {\n                        return _this8.caches[k][key].clear();\n                    });\n                });\n                this.forceUpdate();\n            }\n        }\n    });\n\n    return RegistryInjectorHOC(Map, ['org.bigconnect.map.style', 'org.bigconnect.map.geometry', 'org.bigconnect.map.layer']);\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_68__;\n\n/***/ }),\n/* 69 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\n/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(6), __webpack_require__(2), __webpack_require__(0), __webpack_require__(4), __webpack_require__(70)], __WEBPACK_AMD_DEFINE_RESULT__ = (function (createReactClass, PropTypes, ol, layerHelpers, ProductToolbar) {\n\n    var noop = function noop() {};\n\n    var ANIMATION_DURATION = 200,\n        MIN_FIT_ZOOM_RESOLUTION = 30,\n        MAX_FIT_ZOOM_RESOLUTION = 20000,\n        PREVIEW_WIDTH = 300,\n        PREVIEW_HEIGHT = 300,\n        PREVIEW_DEBOUNCE_SECONDS = 2,\n        LAYERS_EXTENDED_DATA_KEY = 'org-bigconnect-map-layers',\n        BASE_LAYER_ID = 'base';\n\n    var OpenLayers = createReactClass({\n        displayName: 'OpenLayers',\n\n        propTypes: {\n            product: PropTypes.object.isRequired,\n            baseSource: PropTypes.string.isRequired,\n            baseSourceOptions: PropTypes.object,\n            sourcesByLayerId: PropTypes.object,\n            generatePreview: PropTypes.bool,\n            onSelectElements: PropTypes.func.isRequired,\n            onUpdatePreview: PropTypes.func.isRequired,\n            onTap: PropTypes.func,\n            onContextTap: PropTypes.func,\n            onZoom: PropTypes.func,\n            onPan: PropTypes.func,\n            onMouseOver: PropTypes.func,\n            onMouseOut: PropTypes.func\n        },\n\n        getInitialState: function getInitialState() {\n            return { panning: false };\n        },\n        getDefaultProps: function getDefaultProps() {\n            return {\n                generatePreview: false,\n                onTap: noop,\n                onContextTap: noop,\n                onZoom: noop,\n                onPan: noop\n            };\n        },\n        componentWillReceiveProps: function componentWillReceiveProps(nextProps) {\n            var _this = this;\n\n            var _props = this.props,\n                prevSourcesByLayerId = _props.sourcesByLayerId,\n                prevProduct = _props.product;\n            var nextSourcesByLayerId = nextProps.sourcesByLayerId,\n                nextProduct = nextProps.product,\n                registry = nextProps.registry,\n                layerExtensions = nextProps.layerExtensions;\n            var _state = this.state,\n                map = _state.map,\n                layersWithSources = _state.layersWithSources;\n\n            var nextLayerIds = Object.keys(nextProps.sourcesByLayerId);\n\n            if (layersWithSources && (nextLayerIds.length !== Object.keys(layersWithSources).length || nextLayerIds.some(function (layerId) {\n                return !layersWithSources[layerId];\n            }))) {\n                var previous = Object.keys(prevSourcesByLayerId);\n                var newLayers = [];\n                var nextLayers = map.getLayerGroup().getLayers().getArray().slice(0);\n                var existingLayersById = _.indexBy(nextLayers, function (layer) {\n                    return layer.get('id');\n                });\n                var newLayersWithSources = {};\n                var addLayer = function addLayer(initializer, layerId, options, map) {\n                    var layerWithSource = _this.initializeLayer(initializer, layerId, options, map);\n                    var layers = layerWithSource.layers || [layerWithSource.layer];\n\n                    layers.forEach(function (layer) {\n                        var config = nextProps.layerConfig && nextProps.layerConfig[layer.get('id')];\n                        if (config) {\n                            layerHelpers.setLayerConfig(config, layer);\n                        }\n\n                        newLayersWithSources[layerId] = layerWithSource;\n                        nextLayers.push(layer);\n                    });\n                };\n\n                Object.keys(nextSourcesByLayerId).forEach(function (layerId) {\n                    if (!prevSourcesByLayerId[layerId]) {\n                        newLayers.push(layerId);\n                    } else {\n                        var layerIndex = previous.indexOf(layerId);\n                        previous.splice(layerIndex, 1);\n                    }\n                });\n\n                previous.forEach(function (layerId) {\n                    var layerIndex = nextLayers.findIndex(function (layer) {\n                        return layer.get('id') === layerId;\n                    });\n                    nextLayers.splice(layerIndex, 1);\n                });\n\n                newLayers.forEach(function (layerId) {\n                    if (!existingLayersById[layerId]) {\n                        var _nextSourcesByLayerId = nextSourcesByLayerId[layerId],\n                            type = _nextSourcesByLayerId.type,\n                            features = _nextSourcesByLayerId.features,\n                            options = _objectWithoutProperties(_nextSourcesByLayerId, ['type', 'features']);\n\n                        var initializer = layerHelpers.byType[type] || registry['org.bigconnect.map.layer'].find(function (e) {\n                            return e.type === type;\n                        });\n\n                        if (initializer) {\n                            addLayer(initializer, layerId, options, map);\n                        } else {\n                            console.warn('Sources present for layer: ' + layerId + ', but no layer type defined for: ' + type);\n                        }\n                    }\n                });\n\n                if (nextProduct.id !== prevProduct.id) {\n                    _.mapObject(layerExtensions, function (e, layerId) {\n                        if (!(layerId in newLayersWithSources) && !(layerId in nextSourcesByLayerId)) {\n                            addLayer(e, layerId, e.options, map);\n                        }\n                    });\n                }\n\n                map.getLayerGroup().setLayers(new ol.Collection(nextLayers));\n\n                if (previous.length || Object.keys(newLayersWithSources).length) {\n                    this.setState({ layersWithSources: _extends({}, _.omit(layersWithSources, previous), newLayersWithSources) });\n                }\n            }\n        },\n        componentDidUpdate: function componentDidUpdate(prevProps, prevState) {\n            var _state2 = this.state,\n                map = _state2.map,\n                layersWithSources = _state2.layersWithSources;\n            var _props2 = this.props,\n                product = _props2.product,\n                sourcesByLayerId = _props2.sourcesByLayerId,\n                layerExtensions = _props2.layerExtensions,\n                layerConfig = _props2.layerConfig,\n                focused = _props2.focused,\n                viewport = _props2.viewport,\n                generatePreview = _props2.generatePreview;\n\n\n            var changed = false;\n            var fit = [];\n\n            var layers = map.getLayers();\n\n            layers.forEach(function (layer) {\n                var layerId = layer.get('id');\n\n                var layerType = layer.get('type');\n                var layerHelper = layerHelpers.byType[layerType] || layerExtensions[layerId];\n                var layerWithSources = layersWithSources[layerId];\n                var nextSource = sourcesByLayerId[layerId];\n                var prevSource = prevProps.sourcesByLayerId[layerId];\n\n                if (layerHelper && layerWithSources) {\n                    var shouldUpdate = _.isFunction(layerHelper.shouldUpdate) ? layerHelper.shouldUpdate(nextSource, prevSource, layerWithSources, focused) : true;\n\n                    if (shouldUpdate && _.isFunction(layerHelper.update) && nextSource) {\n                        var _ref = layerHelper.update(nextSource, layerWithSources, focused) || {},\n                            _ref$changed = _ref.changed,\n                            c = _ref$changed === undefined ? true : _ref$changed,\n                            _ref$fitFeatures = _ref.fitFeatures,\n                            fitFeatures = _ref$fitFeatures === undefined ? [] : _ref$fitFeatures;\n\n                        changed = changed || c;\n                        if (fitFeatures) fit.push.apply(fit, _toConsumableArray(fitFeatures));\n                    }\n                }\n            });\n\n            var newLayerOrder = product.extendedData && product.extendedData[LAYERS_EXTENDED_DATA_KEY] && product.extendedData[LAYERS_EXTENDED_DATA_KEY].layerOrder;\n            var prevLayerOrder = prevProps.product.extendedData && prevProps.product.extendedData[LAYERS_EXTENDED_DATA_KEY] && prevProps.product.extendedData[LAYERS_EXTENDED_DATA_KEY].layerOrder;\n            if (map && (map !== prevState.map || newLayerOrder !== prevLayerOrder) || prevState.layersWithSources.length !== Object.keys(layersWithSources).length || prevState.layersWithSource.some(function (layerId) {\n                return !layersWithSources[layerId];\n            })) {\n                this.applyLayerOrder();\n            }\n\n            if (fit.length) {\n                this.fit({ limitToFeatures: fit });\n            }\n\n            if (viewport && !_.isEmpty(viewport)) {\n                map.getView().setCenter(viewport.pan);\n                map.getView().setResolution(viewport.zoom);\n            }\n\n            if (map && (!prevState.map || prevProps.layerConfig !== layerConfig)) {\n                this.applyLayerConfig();\n            }\n\n            if (generatePreview) {\n                this._updatePreview({ fit: !viewport });\n            } else if (changed) {\n                this.updatePreview();\n            }\n        },\n        _updatePreview: function _updatePreview() {\n            var _this2 = this;\n\n            var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n            var _options$fit = options.fit,\n                fit = _options$fit === undefined ? false : _options$fit;\n            var _state3 = this.state,\n                map = _state3.map,\n                layersWithSources = _state3.layersWithSources;\n            var base = layersWithSources.base;\n\n            var doFit = function doFit() {\n                if (fit) _this2.fit({ animate: false });\n            };\n\n            // Since this is delayed, make sure component not unmounted\n            if (!this._canvasPreviewBuffer) return;\n\n            doFit();\n            map.once('postcompose', function (event) {\n                if (!_this2._canvasPreviewBuffer) return;\n                var loading = 0,\n                    loaded = 0,\n                    events,\n                    captureTimer;\n\n                doFit();\n\n                var mapCanvas = event.context.canvas;\n                var capture = _.debounce(function () {\n                    if (!_this2._canvasPreviewBuffer) return;\n\n                    doFit();\n\n                    map.once('postrender', function () {\n                        if (!_this2._canvasPreviewBuffer) return;\n                        var newCanvas = _this2._canvasPreviewBuffer;\n                        var context = newCanvas.getContext('2d');\n                        var hRatio = PREVIEW_WIDTH / mapCanvas.width;\n                        var vRatio = PREVIEW_HEIGHT / mapCanvas.height;\n                        var ratio = Math.min(hRatio, vRatio);\n                        newCanvas.width = Math.trunc(mapCanvas.width * ratio);\n                        newCanvas.height = Math.trunc(mapCanvas.height * ratio);\n                        context.drawImage(mapCanvas, 0, 0, mapCanvas.width, mapCanvas.height, 0, 0, newCanvas.width, newCanvas.height);\n                        if (events) {\n                            events.forEach(function (key) {\n                                return ol.Observable.unByKey(key);\n                            });\n                        }\n                        _this2.props.onUpdatePreview(newCanvas.toDataURL('image/png'));\n                    });\n                    map.renderSync();\n                }, 100);\n\n                var tileLoadStart = function tileLoadStart() {\n                    clearTimeout(captureTimer);\n                    ++loading;\n                };\n                var tileLoadEnd = function tileLoadEnd(event) {\n                    clearTimeout(captureTimer);\n                    if (loading === ++loaded) {\n                        captureTimer = capture();\n                    }\n                };\n\n                events = [base.source.on('tileloadstart', tileLoadStart), base.source.on('tileloadend', tileLoadEnd), base.source.on('tileloaderror', tileLoadEnd)];\n            });\n            map.renderSync();\n        },\n        componentDidMount: function componentDidMount() {\n            this._canvasPreviewBuffer = document.createElement('canvas');\n            this._canvasPreviewBuffer.width = PREVIEW_WIDTH;\n            this._canvasPreviewBuffer.height = PREVIEW_HEIGHT;\n\n            this.olEvents = [];\n            this.domEvents = [];\n            this.updatePreview = _.debounce(this._updatePreview, PREVIEW_DEBOUNCE_SECONDS * 1000);\n\n            var _configureMap = this.configureMap(),\n                map = _configureMap.map,\n                layersWithSources = _configureMap.layersWithSources;\n\n            this.setState({ map: map, layersWithSources: layersWithSources });\n        },\n        componentWillUnmount: function componentWillUnmount() {\n            this._canvasPreviewBuffer = null;\n            clearTimeout(this._handleMouseMoveTimeout);\n            if (this.domEvents) {\n                this.domEvents.forEach(function (fn) {\n                    return fn();\n                });\n                this.domEvents = null;\n            }\n            if (this.olEvents) {\n                this.olEvents.forEach(function (key) {\n                    return ol.Observable.unByKey(key);\n                });\n                this.olEvents = null;\n            }\n        },\n        render: function render() {\n            // Cover the map when panning/dragging to avoid sending events there\n            var moveWrapper = this.state.panning ? React.createElement('div', { className: 'draggable-wrapper' }) : '';\n            return React.createElement(\n                'div',\n                { style: { height: '100%' } },\n                React.createElement('div', { style: { height: '100%' }, ref: 'map' }),\n                React.createElement(ProductToolbar, {\n                    product: this.props.product,\n                    injectedProductProps: this.getInjectedToolProps(),\n                    rightOffset: this.props.panelPadding.right,\n                    showNavigationControls: true,\n                    onFit: this.onControlsFit,\n                    onZoom: this.onControlsZoom }),\n                moveWrapper\n            );\n        },\n        onControlsFit: function onControlsFit() {\n            this.fit();\n        },\n        onControlsZoom: function onControlsZoom(type) {\n            var map = this.state.map;\n\n            var view = map.getView();\n\n            if (!this._slowZoomIn) {\n                this._slowZoomIn = _.throttle(zoomByDelta(1), ANIMATION_DURATION, { trailing: false });\n                this._slowZoomOut = _.throttle(zoomByDelta(-1), ANIMATION_DURATION, { trailing: false });\n            }\n\n            if (type === 'in') {\n                this._slowZoomIn();\n            } else {\n                this._slowZoomOut();\n            }\n\n            function zoomByDelta(delta) {\n                return function () {\n                    var currentResolution = view.getResolution();\n                    if (currentResolution) {\n                        view.animate({\n                            resolution: view.constrainResolution(currentResolution, delta),\n                            duration: ANIMATION_DURATION\n                        });\n                    }\n                };\n            }\n        },\n        onControlsPan: function onControlsPan(_ref2, _ref3) {\n            var x = _ref2.x,\n                y = _ref2.y;\n            var state = _ref3.state;\n\n            if (state === 'panningStart') {\n                this.setState({ panning: true });\n            } else if (state === 'panningEnd') {\n                this.setState({ panning: false });\n            } else {\n                var map = this.state.map;\n\n                var view = map.getView();\n\n                var currentCenter = view.getCenter(),\n                    resolution = view.getResolution(),\n                    center = view.constrainCenter([currentCenter[0] - x * resolution, currentCenter[1] + y * resolution]);\n\n                view.setCenter(center);\n            }\n        },\n        extentFromFeatures: function extentFromFeatures(features) {\n            var extent = ol.extent.createEmpty();\n            features.forEach(function (feature) {\n                var fExtent = feature.getGeometry().getExtent();\n                if (!ol.extent.isEmpty(fExtent)) {\n                    ol.extent.extend(extent, fExtent);\n                }\n            });\n            return extent;\n        },\n        fit: function fit() {\n            var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n            var _options$animate = options.animate,\n                animate = _options$animate === undefined ? true : _options$animate,\n                _options$limitToFeatu = options.limitToFeatures,\n                limitToFeatures = _options$limitToFeatu === undefined ? [] : _options$limitToFeatu;\n            var _state4 = this.state,\n                map = _state4.map,\n                layersWithSources = _state4.layersWithSources;\n\n            var view = map.getView();\n            var changeZoom = limitToFeatures.length !== 1;\n            var extent = void 0;\n\n            if (limitToFeatures.length) {\n                extent = this.extentFromFeatures(limitToFeatures);\n            } else {\n                extent = ol.extent.createEmpty();\n                map.getLayers().forEach(function (layer) {\n                    var source = layersWithSources.cluster.layers.includes(layer) ? layersWithSources.cluster.source : layer.getSource();\n\n                    if (layer.getVisible()) {\n                        if (_.isFunction(source.getExtent)) {\n                            ol.extent.extend(extent, source.getExtent());\n                        }\n                    }\n                });\n            }\n\n            if (!ol.extent.isEmpty(extent)) {\n                var resolution = view.getResolution(),\n                    extentWithPadding = extent,\n                    _props$panelPadding = this.props.panelPadding,\n                    left = _props$panelPadding.left,\n                    right = _props$panelPadding.right,\n                    top = _props$panelPadding.top,\n                    bottom = _props$panelPadding.bottom,\n                    clientBox = this.refs.map.getBoundingClientRect(),\n                    padding = 20,\n                    viewportWidth = clientBox.width - left - right - padding * 2,\n                    viewportHeight = clientBox.height - top - bottom - padding * 2,\n                    extentWithPaddingSize = ol.extent.getSize(extentWithPadding),\n                    currentExtent = view.calculateExtent([viewportWidth, viewportHeight]),\n                    idealResolution = Math.max(extentWithPaddingSize[0] / viewportWidth, extentWithPaddingSize[1] / viewportHeight);\n\n\n                if (limitToFeatures.length) {\n                    var horizontalSync = ((left + padding) / 2 - (right + padding) / 2) * resolution;\n                    var verticalSync = ((top + padding) / 2 - (bottom + padding) / 2) * resolution;\n                    currentExtent[0] += horizontalSync;\n                    currentExtent[1] += verticalSync;\n                    currentExtent[2] += horizontalSync;\n                    currentExtent[3] += verticalSync;\n\n                    var insideCurrentView = ol.extent.containsExtent(currentExtent, extent);\n                    if (insideCurrentView) {\n                        return;\n                    }\n                }\n\n                var newResolution = changeZoom ? view.constrainResolution(Math.min(MAX_FIT_ZOOM_RESOLUTION, Math.max(idealResolution, MIN_FIT_ZOOM_RESOLUTION)), -1) : view.getResolution();\n                var center = ol.extent.getCenter(extentWithPadding);\n                var offsetX = left - right;\n                var offsetY = top - bottom;\n                var lon = offsetX * newResolution / 2;\n                var lat = offsetY * newResolution / 2;\n                center[0] = center[0] - lon;\n                center[1] = center[1] - lat;\n\n                var _options = { center: center };\n                if (changeZoom) {\n                    _options.resolution = newResolution;\n                }\n\n                view.animate(_extends({}, _options, {\n                    duration: animate ? ANIMATION_DURATION : 0\n                }));\n            } else {\n                view.animate(_extends({}, this.getDefaultViewParameters(), {\n                    duration: animate ? ANIMATION_DURATION : 0\n                }));\n            }\n        },\n        getDefaultViewParameters: function getDefaultViewParameters() {\n            return {\n                zoom: 2,\n                minZoom: 1,\n                center: [0, 0]\n            };\n        },\n        configureMap: function configureMap() {\n            var _this3 = this;\n\n            var _props3 = this.props,\n                baseSource = _props3.baseSource,\n                _props3$baseSourceOpt = _props3.baseSourceOptions,\n                baseSourceOptions = _props3$baseSourceOpt === undefined ? {} : _props3$baseSourceOpt,\n                sourcesByLayerId = _props3.sourcesByLayerId,\n                layerExtensions = _props3.layerExtensions;\n\n            var layersWithSources = {};\n\n            var addLayer = function addLayer(layerExtension, id, options, map) {\n                if (layersWithSources[id]) return;\n\n                var layerWithSource = _this3.initializeLayer(layerExtension, id, options, map);\n                var layers = layerWithSource.layers || [layerWithSource.layer];\n\n                layers.forEach(function (l) {\n                    map.addLayer(l);\n                });\n                layersWithSources[id] = layerWithSource;\n            };\n\n            var map = new ol.Map({\n                loadTilesWhileInteracting: true,\n                keyboardEventTarget: document,\n                controls: [],\n                layers: [],\n                target: this.refs.map\n            });\n\n            // add the base(tile) layer\n            addLayer(layerHelpers.byType.tile, BASE_LAYER_ID, { source: baseSource, sourceOptions: baseSourceOptions }, map);\n            // add layers from org.bigconnect.map.layer registered extensions\n            _.mapObject(layerExtensions, function (extension, layerId) {\n                addLayer(extension, layerId, extension.options, map);\n            });\n            // add layers from sources passed in props\n            _.mapObject(sourcesByLayerId, function (_ref4, layerId) {\n                var type = _ref4.type,\n                    features = _ref4.features,\n                    options = _objectWithoutProperties(_ref4, ['type', 'features']);\n\n                var initializer = layerHelpers.byType[type];\n                if (initializer) {\n                    addLayer(initializer, layerId, options, map);\n                } else {\n                    console.warn('Sources present for layer: ' + layerId + ', but no layer type defined for: ' + type);\n                }\n            });\n            this.configureEvents(map);\n\n            var view = new ol.View(this.getDefaultViewParameters());\n            this.olEvents.push(view.on('change:center', function (event) {\n                return _this3.props.onPan(event);\n            }));\n            this.olEvents.push(view.on('change:resolution', function (event) {\n                return _this3.props.onZoom(event);\n            }));\n\n            map.setView(view);\n            return { map: map, layersWithSources: layersWithSources };\n        },\n        configureEvents: function configureEvents(map) {\n            var _this4 = this;\n\n            var self = this;\n\n            this.olEvents.push(map.on('click', function (event) {\n                self.props.onTap(event);\n            }));\n            this.olEvents.push(map.on('pointerup', function (event) {\n                var pointerEvent = event.pointerEvent;\n\n                if (pointerEvent && pointerEvent.button === 2) {\n                    self.props.onContextTap(ol, event);\n                }\n            }));\n\n            var viewport = map.getViewport();\n            this.domEvent(viewport, 'contextmenu', function (event) {\n                event.preventDefault();\n            });\n            this.domEvent(viewport, 'mouseup', function (event) {\n                event.preventDefault();\n                if (event.button === 2 || event.ctrlKey) {\n                    // TODO\n                    //self.handleContextMenu(event);\n                }\n            });\n            this.domEvent(viewport, 'mousemove', function (event) {\n                var pixel = map.getEventPixel(event);\n                var hit = map.getFeaturesAtPixel(pixel);\n                if (hit) {\n                    _this4.handleMouseMove(hit);\n                    map.getTarget().style.cursor = 'pointer';\n                } else {\n                    _this4.handleMouseMove();\n                    map.getTarget().style.cursor = '';\n                }\n            });\n        },\n        initializeLayer: function initializeLayer(layerExtension, layerId, options, map) {\n            var _props4 = this.props,\n                baseSource = _props4.baseSource,\n                baseSourceOptions = _props4.baseSourceOptions,\n                sourcesByLayerId = _props4.sourcesByLayerId,\n                generatePreview = _props4.generatePreview,\n                layerExtensions = _props4.layerExtensions,\n                layerConfig = _props4.layerConfig,\n                handlers = _objectWithoutProperties(_props4, ['baseSource', 'baseSourceOptions', 'sourcesByLayerId', 'generatePreview', 'layerExtensions', 'layerConfig']);\n\n            var layerHelper = layerExtension.type && layerHelpers.byType[layerExtension.type] || layerExtension;\n            var layerWithSource = layerHelper.configure(layerId, options, map);\n\n            if (_.isFunction(layerHelper.addEvents)) {\n                this.olEvents.concat(layerHelper.addEvents(map, layerWithSource, handlers));\n            }\n\n            var layers = layerWithSource.layers || [layerWithSource.layer];\n            layers.forEach(function (layer) {\n                var config = layerConfig && layerConfig[layer.get('id')];\n                if (config) {\n                    layerHelpers.setLayerConfig(config, layer);\n                }\n            });\n\n            return layerWithSource;\n        },\n        applyLayerOrder: function applyLayerOrder() {\n            var map = this.state.map;\n            var _props5 = this.props,\n                product = _props5.product,\n                setLayerOrder = _props5.setLayerOrder;\n\n            var layersById = _.indexBy(map.getLayers().getArray(), function (layer) {\n                return layer.get('id');\n            });\n            var nextLayerGroup = map.getLayerGroup();\n            var layerOrder = product.extendedData && product.extendedData[LAYERS_EXTENDED_DATA_KEY] && product.extendedData[LAYERS_EXTENDED_DATA_KEY].layerOrder.slice(0) || [];\n\n            var orderedLayers = new ol.Collection();\n            var newLayers = [];\n\n            orderedLayers.push(layersById[BASE_LAYER_ID]);\n            delete layersById[BASE_LAYER_ID];\n\n            if (layerOrder.length) {\n                layerOrder = layerOrder.reverse();\n\n                layerOrder.forEach(function (layerId, i) {\n                    var layer = layersById[layerId];\n                    if (layer) {\n                        orderedLayers.push(layer);\n\n                        delete layersById[layerId];\n                    }\n                });\n\n                _.mapObject(layersById, function (layer, layerId) {\n                    orderedLayers.push(layer);\n                    newLayers.push(layerId);\n                });\n\n                nextLayerGroup.setLayers(orderedLayers);\n            } else {\n                newLayers = map.getLayers().getArray().slice(1).reduce(function (ids, layer) {\n                    ids.push(layer.get('id'));\n                    return ids;\n                }, []);\n            }\n\n            if (newLayers.length) {\n                setLayerOrder(layerOrder.concat(newLayers.reverse()));\n            }\n        },\n        applyLayerConfig: function applyLayerConfig() {\n            var map = this.state.map;\n            var layerConfig = this.props.layerConfig;\n\n            if (layerConfig) {\n                var layersById = _.indexBy(map.getLayers().getArray(), function (layer) {\n                    return layer.get('id');\n                });\n\n                _.mapObject(layersById, function (layer, layerId) {\n                    var config = layerConfig[layerId];\n                    layerHelpers.setLayerConfig(config, layersById[layerId]);\n                });\n            }\n        },\n        domEvent: function domEvent(el, type, handler) {\n            this.domEvents.push(function () {\n                return el.removeEventListener(type, handler);\n            });\n            el.addEventListener(type, handler, false);\n        },\n        handleMouseMove: function handleMouseMove(features) {\n            var _this5 = this;\n\n            var _props6 = this.props,\n                onMouseOver = _props6.onMouseOver,\n                onMouseOut = _props6.onMouseOut;\n            var map = this.state.map;\n\n\n            if (!onMouseOver && !onMouseOut) {\n                return;\n            }\n\n            var stillHoveringSameFeature = features && this._handleMouseMoveFeatures && this._handleMouseMoveFeatures.length === features.length && this._handleMouseMoveFeatures[0] === features[0];\n\n            if (!stillHoveringSameFeature) {\n                clearTimeout(this._handleMouseMoveTimeout);\n\n                if (features && features.length) {\n                    this._handleMouseMoveTimeout = setTimeout(function () {\n                        _this5._handleMouseMoveFeatures = features;\n                        if (onMouseOver) {\n                            onMouseOver(ol, map, _this5._handleMouseMoveFeatures);\n                        }\n                    }, 250);\n                } else if (this._handleMouseMoveFeatures) {\n                    if (onMouseOut) {\n                        onMouseOut(ol, map, this._handleMouseMoveFeatures);\n                    }\n                    this._handleMouseMoveFeatures = null;\n                }\n            }\n        },\n\n\n        /**\n         * Map work product toolbar item component\n         *\n         * @typedef org.bigconnect.product.toolbar.item~MapComponent\n         * @property {function} requestUpdate Reload the maps extensions and styles.\n         * Call when the result of extensions will change from variables\n         * outside of inputs (preferences, etc).\n         * @property {object} product The map product\n         * @property {object} ol The [Openlayers Api](http://openlayers.org/en/latest/apidoc/)\n         * @property {object} map [map](http://openlayers.org/en/latest/apidoc/ol.Map.html) instance\n         * @property {Object.} layersWithSources Keyed by the id of the layer, the map's rendered layers with their sources\n         * @property {object} cluster deprecated, access this from inside {@link org.bigconnect.product.toolbar.item~layersWithSources} instead\n         * @property {object} cluster.clusterSource [multiPointCluster] that implements the [`ol.source.Cluster`](http://openlayers.org/en/latest/apidoc/ol.source.Cluster.html) interface to cluster the `source` features.\n         * @property {object} cluster.source The [`ol.source.Vector`](http://openlayers.org/en/latest/apidoc/ol.source.Vector.html) source of all map pins before clustering.\n         * @property {object} cluster.layer The [`ol.layer.Vector`](http://openlayers.org/en/latest/apidoc/ol.layer.Vector.html) pin layer\n         */\n        getInjectedToolProps: function getInjectedToolProps() {\n            var _props7 = this.props,\n                requestUpdate = _props7.clearCaches,\n                product = _props7.product;\n            var _state5 = this.state,\n                map = _state5.map,\n                layersWithSources = _state5.layersWithSources;\n\n            var props = {};\n\n            if (map && layersWithSources) {\n                /**\n                 * @typedef {object} org.bigconnect.product.toolbar.item~layerWithSource\n                 * @property {object} source The [`ol.source`](http://openlayers.org/en/latest/apidoc/ol.source.html) of the layer\n                 * @property {object} layer The [`ol.layer`](http://openlayers.org/en/latest/apidoc/ol.layer.html) rendered in the map\n                 */\n                /**\n                 * @typedef {object.} org.bigconnect.product.toolbar.item~layersWithSources\n                 *\n                 * Keyed by layerId, the map's rendered sources with the layers they are backing\n                 */\n                props = { product: product, ol: ol, map: map, cluster: layersWithSources.cluster, layersWithSources: layersWithSources, requestUpdate: requestUpdate };\n            }\n\n            return props;\n        }\n    });\n\n    return OpenLayers;\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ }),\n/* 70 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_70__;\n\n/***/ }),\n/* 71 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0), __webpack_require__(19)], __WEBPACK_AMD_DEFINE_RESULT__ = (function (ol, mapConfig) {\n\n    var overlay = void 0;\n    var innerMap = void 0;\n    var layer = void 0;\n    var element = void 0;\n\n    return {\n        show: function show(ol, map, cluster, styleFn) {\n            if (overlay) {\n                map.removeOverlay(overlay);\n            }\n\n            var coordinates = cluster.get('coordinates');\n            var extent = ol.extent.boundingExtent(coordinates);\n            var size = getSize(extent);\n            var coord = cluster.getGeometry().getCoordinates();\n            var pixel = map.getPixelFromCoordinate(coord);\n            var offset = 20;\n            var flip = pixel[1] < size[1] + offset;\n\n            if (!element) {\n                element = $('
').css({ position: 'relative' }).show();\n element.append('
');\n element.append('
');\n }\n element.toggleClass('top', !flip).toggleClass('bottom', flip);\n element.find('.popover-content').css({ width: size[0], height: size[1] });\n\n overlay = new ol.Overlay({\n offset: [0, offset * (flip ? 1 : -1)],\n element: element[0]\n });\n\n element.show();\n map.addOverlay(overlay);\n\n overlay.setPosition(coord);\n overlay.setPositioning(flip ? 'top-center' : 'bottom-center');\n\n if (!innerMap) {\n var _setupMap = setupMap(styleFn),\n _map = _setupMap.map,\n _layer = _setupMap.layer;\n\n innerMap = _map;\n layer = _layer;\n }\n\n innerMap.setSize(size);\n\n var maxRadius = cluster.get('features').reduce(function (max, f) {\n return Math.max(max, f.get('_nodeRadius'));\n }, 0);\n innerMap.getView().fit(extent, {\n size: size,\n maxZoom: 9,\n padding: [maxRadius, maxRadius, maxRadius, maxRadius]\n });\n layer.setStyle(styleFn);\n\n var source = layer.getSource();\n source.clear();\n source.addFeatures(cluster.get('features'));\n },\n hide: function hide(ol, map) {\n if (overlay) {\n map.removeOverlay(overlay);\n }\n }\n };\n\n function getSize(extent) {\n var aspect = (extent[2] - extent[0]) / (extent[3] - extent[1]) || 1;\n var size = [200, 200];\n if (aspect > 1) {\n size[1] = Math.max(150, size[0] * (1 / aspect));\n } else {\n size[0] = Math.max(150, size[1] * aspect);\n }\n return size;\n }\n\n function setupMap() {\n var _mapConfig = mapConfig(),\n source = _mapConfig.source,\n sourceOptions = _mapConfig.sourceOptions;\n\n var baseLayerSource = new ol.source[source](sourceOptions);\n var layer = new ol.layer.Vector({\n source: new ol.source.Vector({\n features: []\n })\n });\n return {\n map: new ol.Map({\n controls: [],\n layers: [new ol.layer.Tile({ source: baseLayerSource }), layer],\n target: element.find('.popover-content')[0]\n }),\n layer: layer\n };\n }\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ }),\n/* 72 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_72__;\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// Map.js","module.exports = __WEBPACK_EXTERNAL_MODULE_0__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"openlayers\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 0\n// module chunks = 0 1 2","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"prop-types\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 2\n// module chunks = 0 1","/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\ndefine([\n 'openlayers',\n '../multiPointCluster',\n 'util/withDataRequest',\n './cache',\n], function(\n ol,\n MultiPointCluster,\n withDataRequest,\n cache\n) {\n 'use strict';\n\n const FEATURE_CLUSTER_RADIUS = 12;\n const FEATURE_CLUSTER_RADIUS_MAX = 20;\n const VECTOR_FEATURE_SELECTION_OVERLAY = 'org-bigconnect-map-vector-selected-overlay';\n\n const DEFAULT_LAYER_CONFIG = {\n sortable: true,\n toggleable: true\n };\n\n const layers = {\n tile: {\n configure(id, options = {}) {\n const { source, sourceOptions = {}, ...config } = options;\n let baseLayerSource;\n\n if (source in ol.source && _.isFunction(ol.source[source])) {\n baseLayerSource = new ol.source[source]({\n crossOrigin: 'anonymous',\n ...sourceOptions\n });\n } else {\n console.error('Unknown map provider type: ', source);\n throw new Error('map.provider is invalid')\n }\n\n const layer = new ol.layer.Tile({\n ...DEFAULT_LAYER_CONFIG,\n id,\n label: 'Base',\n type: 'tile',\n sortable: false,\n source: baseLayerSource,\n ...config\n });\n\n return { source: baseLayerSource, layer }\n },\n\n addEvents(map, { source }, handlers) {\n return [\n source.on('tileloaderror', function(event) {\n const MaxRetry = 3;\n const { tile } = event;\n\n if (tile) {\n tile._retryCount = (tile._retryCount || 0) + 1;\n if (tile._retryCount <= MaxRetry) {\n console.warn(`Tile error retry: ${tile._retryCount} of ${MaxRetry}`, tile.src_);\n _.defer(() => {\n tile.load();\n })\n }\n }\n })\n ]\n }\n },\n\n cluster: {\n configure(id, options = {}) {\n const source = new ol.source.Vector({ features: [] });\n const clusterSource = new MultiPointCluster({ source });\n const layer = new ol.layer.Vector({\n ...DEFAULT_LAYER_CONFIG,\n id,\n label: 'Cluster',\n type: 'cluster',\n style: cluster => this.style(cluster, { source }),\n source: clusterSource,\n ...options\n });\n const heatmap = new ol.layer.Heatmap({\n ...DEFAULT_LAYER_CONFIG,\n ...options,\n visible: false,\n id: 'heatmap_cluster',\n label: 'Heatmap',\n type: 'cluster_heatmap',\n source\n })\n\n cache.clear();\n\n return { source, clusterSource, layers: [heatmap, layer] }\n },\n\n style(cluster, { source, selected = false } = {}) {\n const count = cluster.get('count');\n const selectionState = cluster.get('selectionState') || 'none';\n const isSelected = selected || selectionState !== 'none';\n\n if (count > 1) {\n return styles.cluster(cluster, { selected: isSelected, source });\n } else {\n return styles.feature(cluster.get('features')[0], { selected: isSelected })\n }\n },\n\n addEvents(map, { source, clusterSource, layers }, handlers) {\n const [ heatmapLayer, vectorLayer ] = layers;\n const addToElements = list => feature => {\n const el = feature.get('element');\n const key = el.type === 'vertex' ? 'vertices' : 'edges';\n list[key].push(el.id);\n };\n const isPartiallySelected = (cluster) => {\n if (cluster.get('count') < 2) return false;\n\n const features = cluster.get('features');\n const selected = features.filter(f => f.get('selected'));\n return 0 < selected.length && selected.length < features.length;\n };\n const getClusterFromEvent = ({ pixel }) => {\n const pixelFeatures = map.getFeaturesAtPixel(pixel, {\n layerFilter: layer => layer === vectorLayer\n });\n return pixelFeatures && pixelFeatures[0];\n };\n\n // For heatmap selections\n const onHeatmapClick = map.on('click', ({ pixel }) => {\n const elements = { vertices: [], edges: [] };\n map.forEachFeatureAtPixel(pixel, addToElements(elements), {\n layerFilter: layer => layer === heatmapLayer\n });\n\n if (elements.vertices.length || elements.edges.length) {\n handlers.onSelectElements(elements);\n }\n });\n\n // For partial cluster selections\n const onClusterClick = map.on('click', event => {\n const targetFeature = getClusterFromEvent(event);\n\n if (targetFeature && isPartiallySelected(targetFeature)) {\n const elements = { vertices: [], edges: [] };\n const clusterIterator = addToElements(elements);\n\n targetFeature.get('features').forEach(clusterIterator);\n handlers.onAddSelection(elements);\n }\n });\n\n //this does not support ol.interaction.Select.multi because of partial cluster selection\n const selectInteraction = new ol.interaction.Select({\n addCondition: (event) => {\n if (event.originalEvent.shiftKey) {\n return true;\n } else {\n const targetFeature = getClusterFromEvent(event);\n return !!targetFeature && isPartiallySelected(targetFeature);\n }\n },\n condition: ol.events.condition.click,\n toggleCondition: ol.events.condition.platformModifierKeyOnly,\n layers: [vectorLayer],\n style: cluster => this.style(cluster, { source, selected: true })\n });\n\n map.addInteraction(selectInteraction);\n\n const onSelectCluster = selectInteraction.on('select', function(event) {\n const { selected, target: interaction } = event;\n const clusters = interaction.getFeatures();\n const elements = { vertices: [], edges: [] };\n const clusterIterator = addToElements(elements);\n\n clusters.forEach(cluster => {\n let features = cluster.get('features');\n if (isPartiallySelected(cluster) && !selected.includes(cluster)) {\n features = features.filter(f => f.get('selected'));\n }\n features.forEach(clusterIterator);\n });\n\n handlers.onSelectElements(elements);\n });\n\n const onClusterSourceChange = clusterSource.on('change', _.debounce(function() {\n var selected = selectInteraction.getFeatures(),\n clusters = this.getFeatures(),\n newSelection = [],\n isSelected = feature => feature.get('selected');\n\n clusters.forEach(cluster => {\n var innerFeatures = cluster.get('features');\n var all = true, some = false, count = 0;\n innerFeatures.forEach(feature => {\n const selected = isSelected(feature);\n all = all && selected;\n some = some || selected;\n count += (selected ? 1 : 0)\n })\n\n if (some) {\n newSelection.push(cluster);\n cluster.set('selectionState', all ? 'all' : 'some');\n cluster.set('selectionCount', count);\n } else {\n cluster.unset('selectionState');\n cluster.unset('selectionCount');\n }\n })\n\n selected.clear()\n if (newSelection.length) {\n selected.extend(newSelection)\n }\n }, 100));\n\n return [\n onHeatmapClick,\n onClusterClick,\n onSelectCluster,\n onClusterSourceChange\n ]\n },\n\n update: syncFeatures\n },\n\n ancillary: {\n configure(id, options = {}, map) {\n const source = new ol.source.Vector({\n features: [],\n wrapX: false\n });\n if (options.getExtent) {\n const _superExtent = source.getExtent;\n source.getExtent = function() {\n const extent = _superExtent && _superExtent.apply(this, arguments);\n const customExtent = options.getExtent(map, source, extent);\n if (ol.extent.isEmpty(customExtent)) {\n return extent || ol.extent.createEmpty();\n }\n return customExtent || extent || ol.extent.createEmpty();\n };\n }\n const layer = new ol.layer.Vector({\n ...DEFAULT_LAYER_CONFIG,\n id,\n type: 'ancillary',\n sortable: false,\n toggleable: false,\n source,\n renderBuffer: 500,\n updateWhileInteracting: true,\n updateWhileAnimating: true,\n style: ancillary => this.style(ancillary),\n ...options\n });\n\n return { source, layer }\n },\n\n style(ancillary) {\n const extensionStyles = ancillary.get('styles');\n if (extensionStyles) {\n const { normal } = extensionStyles;\n if (normal.length) {\n return normal;\n }\n }\n },\n\n update: syncFeatures\n },\n\n vectorXhr: {\n configure(id, options = {}) {\n const { sourceOptions = {}, ...layerOptions } = options;\n const source = new ol.source.Vector(sourceOptions);\n const layer = new ol.layer.Vector({\n ...DEFAULT_LAYER_CONFIG,\n id,\n type: 'vectorXhr',\n source,\n ...layerOptions\n });\n\n return { source, layer };\n },\n\n addEvents(map, { source: olSource, layer }, handlers) {\n const elements = { vertices: [], edges: [] };\n const element = layer.get('element');\n const key = element.type === 'vertex' ? 'vertices' : 'edges';\n const overlayId = getOverlayIdForLayer(layer);\n\n elements[key].push(element.id);\n\n const onGeoShapeClick = map.on('click', (e) => {\n const { map, pixel } = e;\n const featuresAtPixel = map.getFeaturesAtPixel(pixel);\n const sourceFeatures = olSource.getFeatures();\n\n if (featuresAtPixel) {\n if (featuresAtPixel.length === 1\n && featuresAtPixel[0].getId() === overlayId\n && olSource.getFeatureById(overlayId)) {\n handlers.onSelectElements({ vertices: [], edges: [] });\n } else if (featuresAtPixel.every(feature => sourceFeatures.includes(feature))) {\n handlers.onSelectElements(elements);\n }\n }\n });\n\n const onLayerFeaturesLoaded = olSource.on('propertyChange', (e) => {\n if (e.key === 'status' && e.target.get(e.key) === 'loaded') {\n const selectionOverlay = olSource.getFeatureById(overlayId);\n\n if (selectionOverlay) {\n let extent;\n\n olSource.forEachFeature(feature => {\n const geom = feature.getGeometry();\n const featureExtent = geom.getExtent();\n\n if (feature.getId() !== overlayId) {\n if (extent) {\n ol.extent.extend(extent, featureExtent);\n } else {\n extent = featureExtent;\n }\n }\n });\n\n const geometry = ol.geom.Polygon.fromExtent(extent);\n selectionOverlay.setGeometry(geometry);\n }\n }\n });\n\n return [ onGeoShapeClick, onLayerFeaturesLoaded ]\n },\n\n update(source, { source: olSource, layer }) {\n const { element, features, selected } = source;\n const layerStatus = layer.get('status');\n const nextFeatures = [];\n let changed = false;\n let fitFeatures;\n\n if (element !== layer.get('element')) {\n olSource.set('element', element);\n changed = true;\n }\n\n if (!layerStatus) {\n this.loadFeatures(olSource, layer).then((features) => {\n if (features) {\n olSource.clear(true)\n olSource.addFeatures(features);\n layer.set('status', 'loaded');\n }\n });\n } else if (selected !== olSource.get('selected')) {\n const overlayId = getOverlayIdForLayer(layer);\n olSource.set('selected', selected);\n changed = true;\n\n if (selected && layerStatus === 'loaded') {\n let extent;\n olSource.forEachFeature(feature => {\n const geom = feature.getGeometry();\n const featureExtent = geom.getExtent();\n\n if (feature.getId() !== overlayId) {\n if (extent) {\n ol.extent.extend(extent, featureExtent);\n } else {\n extent = featureExtent;\n }\n }\n });\n\n const selectedOverlay = new ol.Feature(ol.geom.Polygon.fromExtent(extent || [0, 0, 0, 0]));\n selectedOverlay.setStyle(new ol.style.Style({\n fill: new ol.style.Fill({ color: [0, 136, 204, 0.3] }),\n stroke: new ol.style.Stroke({ color: [0, 136, 204, 0.4], width: 1 })\n }));\n selectedOverlay.setId(overlayId)\n\n olSource.addFeature(selectedOverlay);\n } else {\n const selectedOverlay = olSource.getFeatureById(overlayId);\n if (selectedOverlay) {\n olSource.removeFeature(selectedOverlay);\n }\n }\n }\n\n return { changed };\n },\n\n loadFeatures(olSource, layer) {\n const { id, element, propName, propKey, mimeType } = layer.getProperties();\n\n layer.set('status', 'loading');\n\n return withDataRequest.dataRequest('vertex', 'propertyValue', id, propName, propKey).then(source => {\n const format = getFormatForMimeType(mimeType);\n const dataProjection = format.readProjection(source);\n\n if (!dataProjection || !ol.proj.get(dataProjection.getCode())) {\n throw new Error('unhandledDataProjection');\n } else {\n const features = format.readFeatures(source, {\n dataProjection,\n featureProjection: 'EPSG:3857'\n });\n\n return features;\n }\n\n })\n .then(features => {\n return features.map((feature, i) => {\n feature.setId(`${layer.get('id')}:${i}`)\n feature.set('element', element)\n\n return feature\n })\n })\n .catch(e => {\n const message = e.message === 'unhandledDataProjection'\n ? i18n('org.bigconnect.web.product.map.MapWorkProduct.layer.error.data.format')\n : i18n('org.bigconnect.web.product.map.MapWorkProduct.layer.error');\n\n layer.set('status', { type: 'error', message });\n });\n }\n }\n };\n\n\n const styles = {\n feature(feature, { selected = false } = {}) {\n const {\n focused,\n focusedDim,\n styles: extensionStyles,\n selected: featureSelected,\n _nodeRadius: radius\n } = feature.getProperties();\n\n const isSelected = selected || featureSelected;\n let needSelectedStyle = true;\n let needFocusStyle = true;\n let styleList;\n\n if (extensionStyles) {\n const { normal: normalStyle, selected: selectedStyle } = extensionStyles;\n let style;\n if (normalStyle.length && (!isSelected || !selectedStyle.length)) {\n style = normalStyle;\n } else if (selectedStyle.length && isSelected) {\n style = selectedStyle;\n }\n\n if (style) {\n styleList = _.isArray(style) ? style : [style];\n }\n } else {\n needSelectedStyle = false;\n needFocusStyle = false;\n styleList = cache.getOrCreateFeature({\n src: feature.get(isSelected ? 'iconUrlSelected' : 'iconUrl'),\n imgSize: feature.get('iconSize'),\n scale: 1 / feature.get('pixelRatio'),\n anchor: feature.get('iconAnchor')\n }, focused)\n }\n\n if (_.isEmpty(styleList)) {\n console.warn('No styles for feature, ignoring.', feature);\n return [];\n }\n\n if (needFocusStyle && focused) {\n return cache.addFocus(radius, cache.reset(radius, styleList));\n }\n if (focusedDim) {\n return cache.addDim(radius, styleList)\n }\n\n return cache.reset(radius, styleList);\n },\n\n cluster(cluster, { selected = false, source, clusterSource } = {}) {\n var count = cluster.get('count'),\n focusStats = cluster.get('focusStats'),\n selectionState = cluster.get('selectionState') || 'none',\n selectionCount = cluster.get('selectionCount') || 0,\n { min, max } = source.countStats,\n value = Math.min(max, Math.max(min, count)),\n radius = min === max ?\n FEATURE_CLUSTER_RADIUS :\n interpolate(value, min, max, FEATURE_CLUSTER_RADIUS, FEATURE_CLUSTER_RADIUS_MAX);\n\n return cache.getOrCreateCluster({\n count, radius, selected, selectionState, selectionCount, focusStats\n })\n }\n };\n\n function interpolate(v, x0, x1, y0, y1) {\n return (y0 * (x1 - v) + y1 * (v - x0)) / (x1 - x0)\n }\n\n function setLayerConfig(config = {}, layer) {\n const { visible = true, opacity = 1, zIndex = 0, ...properties } = config;\n\n _.mapObject(properties, (value, key) => {\n if (value === null) {\n layer.unset(key);\n } else {\n layer.set(key, value);\n }\n })\n\n layer.setVisible(visible)\n layer.setOpacity(opacity)\n layer.setZIndex(zIndex)\n }\n\n function syncFeatures({ features }, { source }, focused) {\n const existingFeatures = _.indexBy(source.getFeatures(), f => f.getId());\n const newFeatures = [];\n var changed = false;\n\n if (features) {\n for (let featureIndex = 0; featureIndex < features.length; featureIndex++) {\n const data = features[featureIndex];\n const { id, styles, geometry: geometryOverride, geoLocations, element, ...rest } = data;\n let geometry = null;\n\n if (geometryOverride) {\n geometry = geometryOverride;\n } else if (geoLocations) {\n geometry = cache.getOrCreateGeometry(id, geoLocations);\n }\n\n if (geometry) {\n let featureValues = {\n ...rest,\n element,\n geoLocations,\n geometry\n };\n\n if (styles) {\n const { normal, selected } = styles;\n if (normal && normal.length) {\n const radius = getRadiusFromStyles(normal);\n const normalImage = _.isFunction(normal[0].getImage) &&\n normal[0].getImage();\n\n featureValues._nodeRadius = radius\n\n if (selected.length === 0 && !geometryOverride && normalImage && _.isFunction(normalImage.getStroke)) {\n const newSelected = normal[0].clone();\n const prevStroke = normal[0].getImage().getStroke();\n const newStroke = new ol.style.Stroke({\n color: '#0088cc',\n width: prevStroke && prevStroke.getWidth() || 1\n })\n\n newSelected.image_ = normal[0].getImage().clone({\n stroke: newStroke,\n opacity: 1\n });\n\n featureValues.styles = {\n normal,\n selected: [newSelected]\n }\n } else {\n featureValues.styles = styles;\n }\n }\n }\n\n if (focused && focused.isFocusing) {\n if (element.id in focused[element.type === 'vertex' ? 'vertices' : 'edges']) {\n featureValues.focused = true\n featureValues.focusedDim = false\n } else {\n featureValues.focused = false\n featureValues.focusedDim = true\n }\n } else {\n featureValues.focused = false\n featureValues.focusedDim = false\n }\n\n if (id in existingFeatures) {\n const existingFeature = existingFeatures[id];\n let diff = _.any(existingFeature.getProperties(), (val, name) => {\n switch (name) {\n case 'styles':\n case 'interacting':\n return false\n case 'geoLocations':\n return !_.isEqual(val, featureValues[name])\n default:\n return val !== featureValues[name]\n }\n })\n\n if (diff) {\n changed = true\n if (existingFeature.get('interacting')) {\n delete featureValues.geometry;\n }\n existingFeature.setProperties(featureValues)\n }\n delete existingFeatures[id];\n } else {\n var feature = new ol.Feature(featureValues);\n feature.setId(data.id);\n newFeatures.push(feature);\n }\n }\n }\n }\n\n let fitFeatures;\n if (newFeatures.length) {\n changed = true\n source.addFeatures(newFeatures);\n fitFeatures = newFeatures;\n }\n if (!_.isEmpty(existingFeatures)) {\n changed = true\n _.forEach(existingFeatures, feature => source.removeFeature(feature));\n }\n return { changed, fitFeatures };\n }\n\n function getFormatForMimeType(mimeType) {\n switch (mimeType) {\n case 'application/vnd.geo+json':\n return new ol.format.GeoJSON();\n case 'application/vnd.google-earth.kml+xml':\n return new ol.format.KML();\n }\n }\n\n function getOverlayIdForLayer(layer) {\n return layer.get('id') + '|' + VECTOR_FEATURE_SELECTION_OVERLAY;\n }\n\n function getRadiusFromStyles(styles) {\n for (let i = styles.length - 1; i >= 0; i--) {\n if (_.isFunction(styles[i].getImage)) {\n const image = styles[i].getImage();\n const radius = image && _.isFunction(image.getRadius) && image.getRadius();\n\n if (radius) {\n const nodeRadius = radius / devicePixelRatio\n return nodeRadius;\n }\n }\n }\n }\n\n return {\n byType: layers,\n styles,\n setLayerConfig\n }\n})\n\n\n\n// WEBPACK FOOTER //\n// ./util/layerHelpers.js","module.exports = __WEBPACK_EXTERNAL_MODULE_6__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"create-react-class\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 6\n// module chunks = 0 1","/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\ndefine(['openlayers', 'jscache'], function(ol, Cache) {\n\n const MAX_CACHE_ITEMS = 1000;\n const EXPIRATION_MINUTES = 5;\n const DEBUG = false;\n const SELECTED_COLOR = '#0088cc'\n\n const cache = new Cache(MAX_CACHE_ITEMS, DEBUG);\n const geoCache = new Cache(MAX_CACHE_ITEMS, DEBUG);\n const cacheOptions = {\n expirationSliding: EXPIRATION_MINUTES * 60\n }\n const FocusPadding = 3;\n const FocusCirclePadding = 6;\n const FocusRadius = 5;\n const FocusFill = new ol.style.Fill({ color: SELECTED_COLOR });\n const FocusStroke = new ol.style.Stroke({ color: '#ffffff', width: 1 });\n\n return {\n clear() {\n cache.clear();\n geoCache.clear();\n },\n\n getOrCreateGeometry(id, geoLocations) {\n const hash = ['geo', id, ...geoLocations.map(([latitude, longitude]) => latitude + ',' + longitude)].join(',')\n let geo = geoCache.getItem(hash);\n if (!geo) {\n geo = new ol.geom.MultiPoint(geoLocations.map(geo => ol.proj.fromLonLat(geo)))\n geoCache.setItem(hash, geo, cacheOptions);\n }\n return geo;\n },\n\n getOrCreateFeature(options, focused) {\n const key = hash(options, focused);\n const cached = cache.getItem(key)\n if (cached) {\n return cached;\n }\n\n const style = [new ol.style.Style({ image: new ol.style.Icon(options), zIndex: 1 })];\n if (focused) {\n const { imgSize, anchor = [0.5, 0.5] } = options;\n style.splice(0, 0, new ol.style.Style({\n renderer(point, { context, feature, geometry, pixelRatio, resolution, rotation }) {\n context.setTransform(1, 0, 0, 1, 0, 0);\n const x = point[0] - imgSize[0] * anchor[0] - FocusPadding * pixelRatio;\n const y = point[1] - imgSize[1] * anchor[1] - FocusPadding * pixelRatio;\n const w = imgSize[0] + FocusPadding * 2 * pixelRatio;\n const h = imgSize[1] + FocusPadding * 2 * pixelRatio;\n const radius = FocusRadius * pixelRatio;\n\n context.save();\n context.globalAlpha = 0.2;\n context.beginPath();\n context.moveTo(x + radius, y);\n context.lineTo(x + w - radius, y);\n context.quadraticCurveTo(x + w, y, x + w, y + radius);\n context.lineTo(x + w, y + h - radius);\n context.quadraticCurveTo(x + w, y + h, x + w - radius, y + h);\n context.lineTo(x + radius, y + h);\n context.quadraticCurveTo(x, y + h, x, y + h - radius);\n context.lineTo(x, y + radius);\n context.quadraticCurveTo(x, y, x + radius, y);\n context.closePath();\n context.fillStyle = SELECTED_COLOR;\n context.shadowBlur = radius / 2;\n context.shadowColor = 'white';\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n context.fill();\n\n context.restore();\n },\n zIndex: 0\n }))\n }\n cache.setItem(key, style, cacheOptions);\n\n return style;\n },\n\n getOrCreateCluster({\n count, radius: r, selected, selectionState, selectionCount,\n focusStats: { all, some, dim }\n }) {\n const key = [\n 'cluster', count, r, selected,\n selectionState, selectionCount,\n all, some, dim\n ].join('|');\n\n let style = cache.getItem(key);\n if (style) {\n return style;\n }\n\n style = [\n new ol.style.Style({\n image: new ol.style.Circle({\n radius: r * devicePixelRatio,\n fill: new ol.style.Fill({ color: 'rgba(255,255,255,0.01)' })\n })\n }),\n new ol.style.Style({\n renderer([x, y], { context, pixelRatio }) {\n const radius = r * pixelRatio;\n var unselectedFill = 'rgba(241,59,60,0.8)',\n selectedFill = 'rgba(0,112,195,0.8)',\n selectedFillNoAlpha = 'rgb(0,112,195)',\n unselectedStroke = '#AD2E2E',\n stroke = selected ? '#08538B' : unselectedStroke,\n lineWidth = 2 * pixelRatio,\n textStroke = stroke,\n fill = selected ? selectedFill : unselectedFill;\n\n if (selected && selectionState === 'some') {\n fill = unselectedFill;\n textStroke = unselectedStroke;\n stroke = unselectedStroke;\n }\n\n context.save();\n if (dim && !some) {\n context.globalAlpha = 0.4;\n }\n context.setTransform(1, 0, 0, 1, 0, 0);\n context.translate(x, y);\n\n if (some) {\n context.beginPath();\n context.arc(0, 0, radius + FocusCirclePadding * pixelRatio, 0, 2 * Math.PI, true);\n context.fillStyle = 'rgba(0, 136, 204, 0.2)';\n context.fill();\n context.closePath();\n }\n\n context.beginPath();\n context.arc(0, 0, radius, 0, 2 * Math.PI, true);\n context.fillStyle = fill;\n context.fill();\n\n if (selectionState === 'some') {\n context.strokeStyle = stroke;\n context.lineWidth = Math.max(4 * pixelRatio, lineWidth);\n context.stroke();\n context.closePath();\n const portion = Math.max(0.1, Math.min(0.9, selectionCount / count));\n context.beginPath();\n context.arc(0, 0, radius, Math.PI / -2, Math.PI * 2 * portion - Math.PI / 2, false);\n context.strokeStyle = selectedFillNoAlpha;\n context.stroke();\n context.closePath();\n } else {\n context.strokeStyle = stroke;\n context.lineWidth = lineWidth;\n context.stroke();\n context.closePath();\n }\n\n context.font = `bold condensed ${radius}px sans-serif`;\n context.textAlign = 'center';\n context.fillStyle = 'white';\n context.textBaseline = 'middle';\n context.strokeStyle = textStroke;\n context.lineWidth = pixelRatio;\n\n if (some && some !== count) {\n const text = some.toString();\n context.strokeText(text, 0, radius * -0.4);\n context.fillText(text, 0, radius * -0.4);\n\n context.font = `bold condensed ${radius * 0.7}px sans-serif`;\n context.fillStyle = 'rgba(255,255,255,0.8)';\n context.strokeText(count.toString(), 0, radius * 0.55);\n context.fillText(count.toString(), 0, radius * 0.55);\n\n context.beginPath();\n context.moveTo(radius * -0.5, radius * 0.1);\n context.lineTo(radius * 0.5, radius * 0.1);\n context.strokeStyle = 'rgba(255,255,255,0.3)';\n context.stroke();\n context.closePath();\n\n } else {\n const text = count.toString();\n context.strokeText(text, 0, 0);\n context.fillText(text, 0, 0);\n }\n\n context.restore();\n }\n })\n ];\n\n cache.setItem(key, style, cacheOptions);\n return style;\n },\n\n addFocus(radius, list) {\n const key = `focus${radius}`;\n let focusStyle = cache.getItem(key);\n if (!focusStyle) {\n focusStyle = new ol.style.Style({\n image: new ol.style.Circle({\n radius: radius + 5,\n fill: FocusFill,\n stroke: FocusStroke\n }),\n zIndex: 0\n })\n focusStyle.getImage().setOpacity(0.2);\n cache.setItem(key, focusStyle, cacheOptions);\n }\n\n return [focusStyle, ...list];\n },\n\n addDim(radius, list) {\n const image = list.length && list[0].getImage();\n if (image) {\n image.setOpacity(0.4);\n }\n return list;\n },\n\n reset(radius, list) {\n const image = list.length && list[0].getImage();\n if (image && image.getOpacity() < 1) {\n image.setOpacity(1);\n }\n return list;\n }\n }\n\n function hash({ src, imgSize, scale, anchor }, focused) {\n return [focused, src, `${imgSize[0]},${imgSize[1]}`, scale, `${anchor[0]},${anchor[1]}`].join('|')\n }\n\n});\n\n\n\n// WEBPACK FOOTER //\n// ./util/cache.js","module.exports = __WEBPACK_EXTERNAL_MODULE_8__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"react-dom\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 8\n// module chunks = 0 1","/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\n\n/**\n * This file is a fork of http://openlayers.org/en/master/apidoc/ol.source.Cluster.html\n * with support for multi-point clusters.\n */\ndefine(['openlayers'], function(ol) {\n 'use strict';\n\n var MultiPointCluster = function(options) {\n ol.source.Vector.call(this, {\n attributions: options.attributions,\n extent: options.extent,\n logo: options.logo,\n projection: options.projection,\n wrapX: options.wrapX\n });\n\n this.resolution = undefined;\n this.distance = 20 * devicePixelRatio;\n this.features = [];\n this.geometryFunction = options.geometryFunction || (feature => feature.getGeometry());\n this.source = options.source;\n this.refresh = _.debounce(this.refresh.bind(this), 100);\n this.source.on('change', this.refresh);\n };\n\n ol.inherits(MultiPointCluster, ol.source.Vector);\n\n MultiPointCluster.prototype.refresh = function() {\n this.clear();\n this.cluster();\n this.addFeatures(this.features);\n this.changed();\n }\n\n MultiPointCluster.prototype.getSource = function() {\n return this.source;\n }\n\n MultiPointCluster.prototype.loadFeatures = function(extent, resolution, projection) {\n this.source.loadFeatures(extent, resolution, projection);\n this.updateResolution(resolution);\n }\n\n MultiPointCluster.prototype.updateResolution = function(resolution) {\n if (resolution !== this.resolution) {\n this.clear();\n this.resolution = resolution;\n this.cluster();\n this.addFeatures(this.features);\n }\n }\n\n MultiPointCluster.prototype.setDistance = function(distance) {\n this.distance = distance;\n this.refresh();\n }\n\n MultiPointCluster.prototype.cluster = function() {\n var self = this;\n if (this.resolution === undefined) {\n return;\n }\n const resolution = this.resolution;\n const distance = this.distance;\n this.features.length = 0;\n var source = this.source;\n var features = source.getFeatures();\n var clustered = {};\n\n const getRadius = feature => {\n const radius = feature.get('_nodeRadius') * devicePixelRatio;\n return radius || distance;\n }\n const maxRadius = features.reduce((max, f) => {\n const radius = getRadius(f);\n return Math.max(max, radius)\n }, 0);\n const countStats = { max: 0, min: Number.MAX_VALUE };\n this.source.countStats = countStats;\n\n for (let i = 0; i < features.length; i++) {\n clusterFeature(features[i]);\n }\n\n function clusterFeature(feature) {\n const radius = getRadius(feature);\n var mapDistanceSearch = (radius + maxRadius) * resolution;\n var mapDistance = radius * resolution;\n var geometry = self.geometryFunction(feature);\n if (geometry) {\n var coordinates = geometry.getCoordinates();\n for (let i = 0; i < coordinates.length; i++) {\n clusterCoordinate(coordinates[i], i);\n }\n }\n\n function clusterCoordinate(coordinate, coordinateIndex) {\n if (!((feature.getId().toString() + '_' + coordinateIndex) in clustered)) {\n\n // Search radius is this feature box + max size\n const extentSearch = ol.extent.boundingExtent([coordinate])\n ol.extent.buffer(extentSearch, mapDistanceSearch, extentSearch);\n\n // Exact bounds to further match for collision\n const extent1 = ol.extent.boundingExtent([coordinate])\n ol.extent.buffer(extent1, mapDistance, extent1);\n\n var neighbors = source.getFeaturesInExtent(extentSearch),\n coords = [],\n count = 0;\n\n const featuresToCluster = neighbors.filter(function(neighbor) {\n var neighborGeometry = self.geometryFunction(neighbor);\n var neighborCoordinates = neighborGeometry.getCoordinates();\n var neighborUid = neighbor.getId().toString() + '_';\n\n var coordsInCluster = neighborCoordinates.filter(function(coordinate, coordinateIndex) {\n var uid = neighborUid + coordinateIndex;\n\n const extent2 = ol.extent.boundingExtent([coordinate])\n ol.extent.buffer(extent2, getRadius(neighbor) * resolution, extent2);\n\n if (ol.extent.intersects(extent1, extent2)) {\n if (!(uid in clustered)) {\n coords.push(coordinate)\n clustered[uid] = true;\n return true;\n }\n }\n return false;\n }).length\n count += coordsInCluster;\n return coordsInCluster > 0;\n });\n\n countStats.max = Math.max(count, countStats.max);\n countStats.min = Math.min(count, countStats.min);\n self.features.push(self.createCluster(featuresToCluster, coords, count));\n }\n }\n }\n };\n\n MultiPointCluster.prototype.createCluster = function(features, coordinates, count) {\n const focusStats = { some: 0, all: false, dim: false };\n features.forEach(feature => {\n const focused = feature.get('focused')\n focusStats.some += (focused ? 1 : 0);\n focusStats.all = focusStats.all && focused;\n focusStats.dim = focusStats.dim || feature.get('focusedDim');\n })\n const centers = coordinates.reduce((sums, c) => sums.map((s, i) => s + c[i]), [0, 0]);\n const average = centers.map(val => val / coordinates.length);\n const geometry = new ol.geom.Point(average);\n\n return new ol.Feature({ geometry, features, coordinates, count, focusStats });\n };\n\n return MultiPointCluster;\n});\n\n\n\n// WEBPACK FOOTER //\n// ./multiPointCluster.js","module.exports = __WEBPACK_EXTERNAL_MODULE_10__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"util/withDataRequest\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 10\n// module chunks = 0 1 2","module.exports = __WEBPACK_EXTERNAL_MODULE_11__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"jscache\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 11\n// module chunks = 0 1 2","module.exports = __WEBPACK_EXTERNAL_MODULE_12__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"util/vertex/formatters\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 12\n// module chunks = 0 1 2","module.exports = __WEBPACK_EXTERNAL_MODULE_19__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"util/mapConfig\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 19\n// module chunks = 1 2","module.exports = __WEBPACK_EXTERNAL_MODULE_28__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"data/web-worker/store/ontology/selectors\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 28\n// module chunks = 0 1","module.exports = __WEBPACK_EXTERNAL_MODULE_29__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"react-redux\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 29\n// module chunks = 0 1","module.exports = __WEBPACK_EXTERNAL_MODULE_30__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"data/web-worker/store/selection/actions\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 30\n// module chunks = 0 1","module.exports = __WEBPACK_EXTERNAL_MODULE_31__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"data/web-worker/store/product/actions\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 31\n// module chunks = 0 1","module.exports = __WEBPACK_EXTERNAL_MODULE_32__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"data/web-worker/store/product/selectors\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 32\n// module chunks = 0 1","/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\ndefine(['data/web-worker/store/actions'], function(actions) {\n actions.protectFromWorker();\n\n return actions.createActions({\n workerImpl: 'com/mware/web/product/map/dist/actions-impl',\n actions: {\n dropElements: (productId, elements, { undoable }) => ({ productId, elements, undoable }),\n removeElements: (productId, elements, { undoable }) => ({ productId, elements, undoable }),\n\n setLayerOrder: (productId, layerOrder) => ({ productId, layerOrder })\n }\n })\n})\n\n\n\n// WEBPACK FOOTER //\n// ./worker/actions.js","module.exports = __WEBPACK_EXTERNAL_MODULE_34__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"data/web-worker/store/actions\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 34\n// module chunks = 0 1","module.exports = __WEBPACK_EXTERNAL_MODULE_47__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"configuration/plugins/registry\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 47\n// module chunks = 1","/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\ndefine([\n 'react-redux',\n 'react-dom',\n 'configuration/plugins/registry',\n 'data/web-worker/store/selection/actions',\n 'data/web-worker/store/product/actions',\n 'data/web-worker/store/product/selectors',\n 'data/web-worker/store/ontology/selectors',\n 'util/dnd',\n './worker/actions',\n 'components/DroppableHOC',\n './Map',\n './util/layerHelpers'\n], function(\n redux,\n ReactDom,\n registry,\n selectionActions,\n productActions,\n productSelectors,\n ontologySelectors,\n dnd,\n mapActions,\n DroppableHOC,\n Map,\n layerHelpers) {\n 'use strict';\n\n registry.registerExtension('org.bigconnect.product.toolbar.item', {\n identifier: 'org-bigconnect-map-layers',\n itemComponentPath: 'com/mware/web/product/map/dist/MapLayersContainer',\n placementHint: 'popover',\n label: i18n('org.bigconnect.web.product.map.MapWorkProduct.layers.toolbar.item.label'),\n canHandle: (product) => product.kind === 'org.bigconnect.web.product.map.MapWorkProduct'\n });\n\n const mimeTypes = [BC_MIMETYPES.ELEMENTS];\n\n return redux.connect(\n\n (state, props) => {\n const product = productSelectors.getProduct(state);\n const layerConfig = product.extendedData\n && product.extendedData['org-bigconnect-map-layers']\n && product.extendedData['org-bigconnect-map-layers'].config;\n\n return {\n ...props,\n workspaceId: state.workspace.currentId,\n configProperties: state.configuration.properties,\n ontologyProperties: ontologySelectors.getProperties(state),\n panelPadding: { top: 0, left: 0, right: 0, bottom: 0 },\n selection: productSelectors.getSelectedElementsInProduct(state),\n viewport: productSelectors.getViewport(state),\n productElementIds: productSelectors.getElementIdsInProduct(state),\n product: productSelectors.getProduct(state),\n elements: productSelectors.getElementsInProduct(state),\n focused: productSelectors.getFocusedElementsInProduct(state),\n pixelRatio: state.screen.pixelRatio,\n mimeTypes,\n style: { height: '100%' },\n layerConfig\n }\n },\n\n (dispatch, props) => {\n return {\n onClearSelection: () => dispatch(selectionActions.clear()),\n onAddSelection: (selection) => dispatch(selectionActions.add(selection)),\n onSelectElements: (selection) => dispatch(selectionActions.set(selection)),\n onSelectAll: (id) => dispatch(productActions.selectAll(id)),\n\n onUpdatePreview: (id, dataUrl) => dispatch(productActions.updatePreview(id, dataUrl)),\n\n // TODO: these should be mapActions\n onUpdateViewport: (id, { pan, zoom }) => dispatch(productActions.updateViewport(id, { pan, zoom })),\n\n // For DroppableHOC\n onDrop: (event) => {\n const elements = dnd.getElementsFromDataTransfer(event.dataTransfer);\n if (elements) {\n event.preventDefault();\n event.stopPropagation();\n\n dispatch(mapActions.dropElements(props.product.id, elements, { undoable: true }))\n }\n },\n\n onDropElementIds(elementIds) {\n dispatch(mapActions.dropElements(props.product.id, elementIds, { undoable: true }));\n },\n\n onRemoveElementIds: (elementIds) => {\n dispatch(mapActions.removeElements(props.product.id, elementIds, { undoable: true }))\n },\n\n onVertexMenu: (element, vertexId, position) => {\n $(element).trigger('showVertexContextMenu', { vertexId, position });\n },\n\n setLayerOrder: (layerOrder) => dispatch(mapActions.setLayerOrder(props.product.id, layerOrder))\n }\n }\n\n )(DroppableHOC(Map));\n});\n\n\n\n// WEBPACK FOOTER //\n// ./MapContainer.jsx","module.exports = __WEBPACK_EXTERNAL_MODULE_65__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"util/dnd\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 65\n// module chunks = 1","module.exports = __WEBPACK_EXTERNAL_MODULE_66__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"components/DroppableHOC\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 66\n// module chunks = 1","/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\ndefine([\n 'create-react-class',\n 'prop-types',\n './OpenLayers',\n './clusterHover',\n './util/layerHelpers',\n 'configuration/plugins/registry',\n 'components/RegistryInjectorHOC',\n 'util/vertex/formatters',\n 'util/deepObjectCache',\n 'util/mapConfig',\n './util/cache'\n], function(\n createReactClass,\n PropTypes,\n OpenLayers,\n clusterHover,\n layerHelpers,\n registry,\n RegistryInjectorHOC,\n F,\n DeepObjectCache,\n mapConfig,\n clusterCache) {\n 'use strict';\n\n const iconAnchor = [0.5, 1.0];\n const getIconSize = _.memoize(ratio => [22, 40].map(v => v * ratio));\n\n /**\n * @deprecated Use {@link org.bigconnect.product.toolbar.item} instead\n */\n registry.documentExtensionPoint('org.bigconnect.map.options',\n 'Add components to the map options toolbar',\n function(e) {\n return ('identifier' in e) && ('optionComponentPath' in e);\n },\n 'https://docs.bigconnect.io/developer-guide/plugin-development/web-plugins/extension-point-reference-1/map-options'\n );\n\n registry.markUndocumentedExtensionPoint('org.bigconnect.map.style');\n\n registry.markUndocumentedExtensionPoint('org.bigconnect.map.geometry');\n\n registry.markUndocumentedExtensionPoint('org.bigconnect.map.layer');\n\n const REQUEST_UPDATE_DEBOUNCE = 300;\n const GEOSHAPE_MIMETYPES = [\n 'application/vnd.geo+json',\n 'application/vnd.google-earth.kml+xml'\n ];\n\n const Map = createReactClass({\n\n propTypes: {\n configProperties: PropTypes.object.isRequired,\n onUpdateViewport: PropTypes.func.isRequired,\n onSelectElements: PropTypes.func.isRequired,\n onVertexMenu: PropTypes.func.isRequired,\n elements: PropTypes.shape({ vertices: PropTypes.object, edges: PropTypes.object })\n },\n\n getInitialState() {\n return { viewport: this.props.viewport, generatePreview: true }\n },\n\n shouldComponentUpdate(nextProps) {\n const onlyViewportChanged = Object.keys(nextProps).every(key => {\n if (key === 'viewport') {\n return true;\n }\n return this.props[key] === nextProps[key];\n })\n\n if (onlyViewportChanged) {\n return false;\n }\n return true;\n },\n\n componentWillMount() {\n this.caches = {\n styles: {\n canHandle: new DeepObjectCache(),\n style: new DeepObjectCache(),\n selectedStyle: new DeepObjectCache()\n },\n geometries: {\n canHandle: new DeepObjectCache(),\n geometry: new DeepObjectCache()\n }\n };\n this.requestUpdateDebounce = _.debounce(this.clearCaches, REQUEST_UPDATE_DEBOUNCE)\n },\n\n componentDidMount() {\n this.mounted = true;\n\n $(this.wrap).on('selectAll', (event) => {\n this.props.onSelectAll(this.props.product.id);\n })\n $(document).on('elementsCut.org-bigconnect-map', (event, { vertexIds }) => {\n this.props.onRemoveElementIds({ vertexIds, edgeIds: [] });\n })\n $(document).on('elementsPasted.org-bigconnect-map', (event, elementIds) => {\n this.props.onDropElementIds(elementIds)\n })\n\n this.saveViewportDebounce = _.debounce(this.saveViewport, 250);\n\n this.legacyListeners({\n fileImportSuccess: { node: $('.products-full-pane.visible')[0], handler: (event, { vertexIds }) => {\n this.props.onDropElementIds({vertexIds});\n }}\n })\n },\n\n componentWillUnmount() {\n this.mounted = false;\n this.removeEvents.forEach(({ node, func, events }) => {\n $(node).off(events, func);\n });\n\n $(this.wrap).off('selectAll');\n $(document).off('.org-bigconnect-map');\n this.saveViewport(this.props)\n },\n\n componentWillReceiveProps(nextProps) {\n if (nextProps.product.id === this.props.product.id) {\n this.setState({ viewport: {}, generatePreview: false })\n } else {\n this.saveViewport(this.props)\n this.setState({ viewport: nextProps.viewport || {}, generatePreview: true })\n }\n },\n\n render() {\n const { viewport, generatePreview } = this.state;\n const { product, registry, panelPadding, focused, layerConfig, setLayerOrder, onAddSelection, onSelectElements } = this.props;\n const { source: baseSource, sourceOptions: baseSourceOptions, ...config } = mapConfig();\n const layerExtensions = _.indexBy(registry['org.bigconnect.map.layer'], 'id');\n\n return (\n
{this.wrap = r}}>\n {this._openlayers = c}}\n product={product}\n focused={focused}\n baseSource={baseSource}\n baseSourceOptions={baseSourceOptions}\n sourcesByLayerId={this.mapElementsToSources()}\n layerExtensions={layerExtensions}\n layerConfig={layerConfig}\n viewport={viewport}\n generatePreview={generatePreview}\n panelPadding={panelPadding}\n clearCaches={this.requestUpdateDebounce}\n setLayerOrder={setLayerOrder}\n onTap={this.onTap}\n onPan={this.onViewport}\n onZoom={this.onViewport}\n onContextTap={this.onContextTap}\n onAddSelection={onAddSelection}\n onSelectElements={onSelectElements}\n onMouseOver={this.onMouseOver}\n onMouseOut={this.onMouseOut}\n onUpdatePreview={this.onUpdatePreview}\n {...config}\n />\n
\n )\n },\n\n onTap({map, pixel}) {\n if (!map.hasFeatureAtPixel(pixel)) {\n this.props.onClearSelection();\n }\n },\n\n onMouseOver(ol, map, features) {\n const cluster = features && features[0];\n const coordinates = cluster && cluster.get('coordinates');\n if (coordinates && coordinates.length > 1) {\n clusterHover.show(ol, map, cluster, layerHelpers.styles.feature)\n }\n },\n\n onMouseOut(ol, map, features) {\n clusterHover.hide(ol, map);\n },\n\n onContextTap(ol, { map, pixel, originalEvent }) {\n clusterHover.hide(ol, map);\n\n const productVertices = this.props.product.extendedData.vertices;\n const featuresAtPixel = map.getFeaturesAtPixel(pixel);\n const isValidVertex = (element) => {\n const isAncillary = element && productVertices[element.id] && productVertices[element.id].ancillary;\n return element && element.type === 'vertex' && !isAncillary\n }\n let vertexId;\n\n if (featuresAtPixel && featuresAtPixel.length) {\n const target = featuresAtPixel[0];\n const element = target.get('element');\n\n if (isValidVertex(element)) {\n vertexId = element.id;\n } else {\n const clusteredFeatures = target.get('features') || [];\n const clusteredFeature = clusteredFeatures.find(f => {\n const element = f.get('element');\n return isValidVertex(element);\n });\n vertexId = clusteredFeature && clusteredFeature.get('element').id;\n }\n }\n\n if (vertexId) {\n const { pageX, pageY } = originalEvent;\n this.props.onVertexMenu(\n originalEvent.target,\n vertexId,\n { x: pageX, y: pageY }\n );\n }\n },\n\n onUpdatePreview() {\n const { onUpdatePreview, product } = this.props;\n\n onUpdatePreview(product.id);\n },\n\n onViewport(event) {\n const { product: { id: productId } } = this.props;\n const view = event.target;\n const zoom = view.getZoom();\n const pan = [...view.getCenter()];\n\n if (!this.currentViewport) {\n this.currentViewport = {};\n }\n this.currentViewport[productId] = { zoom, pan };\n\n this.saveViewportDebounce(this.props);\n },\n\n saveViewport(props) {\n if (this.mounted) {\n var productId = props.product.id;\n if (this.currentViewport && productId in this.currentViewport) {\n var viewport = this.currentViewport[productId];\n props.onUpdateViewport(productId, viewport);\n }\n }\n },\n\n getGeometry(edgeInfo, element, ontology) {\n const { registry } = this.props;\n const calculatedGeometry = registry['org.bigconnect.map.geometry']\n .reduce((geometries, { canHandle, geometry, layer }) => {\n /**\n * Decide which elements to apply geometry\n *\n * @function org.bigconnect.map.geometry~canHandle\n * @param {object} productEdgeInfo The edge info from product->vertex\n * @param {object} element The element\n * @param {Array.} element.properties The element properties\n * @param {object} ontology The ontology object for this element (concept/relationship)\n * @returns {boolean} True if extension should handle this element (style/selectedStyle functions will be invoked.)\n */\n if (this.caches.geometries.canHandle.getOrUpdate(canHandle, edgeInfo, element, ontology)) {\n\n /**\n * Return an OpenLayers [`ol.geom.Geometry`](http://openlayers.org/en/latest/apidoc/ol.geom.Geometry.html)\n * object for the given element.\n *\n * @function org.bigconnect.map.geometry~geometry\n * @param {object} productEdgeInfo The edge info from product->vertex\n * @param {object} element The element\n * @param {Array.} element.properties The element properties\n * @param {object} ontology The ontology element (concept / relationship)\n * @returns {ol.geom.Geometry}\n */\n const geo = this.caches.geometries.geometry.getOrUpdate(geometry, edgeInfo, element, ontology)\n if (geo) {\n /**\n * Provide a layer configuration object to specify which layer this geometry should be placed on\n *\n * @typedef org.bigconnect.map.geometry~layer\n * @property {string} id The id of the layer\n * @property {string} type The type of layer\n *\n */\n geometries.push({\n geometry: geo,\n layer\n });\n }\n }\n return geometries\n }, [])\n\n if (calculatedGeometry.length) {\n if (calculatedGeometry.length > 1) {\n console.warn('Multiple geometry extensions applying to element, ignoring others', calculatedGeometry.slice(1))\n }\n return calculatedGeometry[0]\n }\n },\n\n getStyles(edgeInfo, element, ontology) {\n const { registry } = this.props;\n const calculatedStyles = registry['org.bigconnect.map.style']\n .reduce((styles, { canHandle, style, selectedStyle }) => {\n\n /**\n * Decide which elements to apply style\n *\n * @function org.bigconnect.map.style~canHandle\n * @param {object} productEdgeInfo The edge info from product->vertex\n * @param {object} element The element\n * @param {Array.} element.properties The element properties\n * @param {object} ontology The ontology object for this element (concept/relationship)\n * @returns {boolean} True if extension should handle this element (style/selectedStyle functions will be invoked.)\n */\n if (this.caches.styles.canHandle.getOrUpdate(canHandle, edgeInfo, element, ontology)) {\n if (style) {\n /**\n * Return an OpenLayers [`ol.style.Style`](http://openlayers.org/en/latest/apidoc/ol.style.Style.html)\n * object for the given element.\n *\n * @function org.bigconnect.map.style~style\n * @param {object} productEdgeInfo The edge info from product->vertex\n * @param {object} element The element\n * @param {Array.} element.properties The element properties\n * @returns {ol.style.Style}\n */\n const normalStyle = this.caches.styles.style.getOrUpdate(style, edgeInfo, element, ontology)\n if (normalStyle) {\n if (_.isArray(normalStyle)) {\n if (normalStyle.length) styles.normal.push(...normalStyle)\n } else {\n styles.normal.push(normalStyle)\n }\n }\n }\n\n if (selectedStyle) {\n const output = this.caches.styles.selectedStyle.getOrUpdate(selectedStyle, edgeInfo, element, ontology)\n if (output) {\n if (_.isArray(output)) {\n if (output.length) styles.selected.push(...output)\n } else {\n styles.selected.push(output)\n }\n }\n }\n }\n return styles;\n }, { normal: [], selected: []})\n\n if (calculatedStyles.normal.length || calculatedStyles.selected.length) {\n return calculatedStyles;\n }\n },\n\n mapElementsToSources() {\n const { product, workspaceId } = this.props;\n const { extendedData } = product;\n if (!extendedData || !extendedData.vertices) return [];\n const { vertices, edges } = this.props.elements;\n const elementsSelectedById = { ..._.indexBy(this.props.selection.vertices), ..._.indexBy(this.props.selection.edges) };\n const elements = Object.values(vertices).concat(Object.values(edges));\n const geoLocationProperties = _.groupBy(this.props.ontologyProperties, 'dataType').geoLocation;\n const addOrUpdateSource = ({ id, ...rest }, feature) => {\n if (!sources[id]) {\n sources[id] = { features: [], ...rest };\n } else if (!sources[id].features) {\n sources[id].features = [];\n }\n\n sources[id].features.push(feature);\n };\n const sources = {\n cluster: {\n id: 'cluster',\n type: 'cluster',\n features: []\n }\n };\n\n elements.forEach(el => {\n const extendedDataType = extendedData[el.type === 'vertex' ? 'vertices' : 'edges'];\n const edgeInfo = extendedDataType[el.id];\n const ontology = F.vertex.ontology(el);\n const styles = this.getStyles(edgeInfo, el, ontology);\n const geometryOverride = this.getGeometry(edgeInfo, el, ontology)\n const geometry = geometryOverride && geometryOverride.geometry;\n const layer = geometryOverride && geometryOverride.layer || {};\n const selected = el.id in elementsSelectedById;\n\n if (extendedData.vertices[el.id] && extendedData.vertices[el.id].ancillary) {\n addOrUpdateSource({ id: 'ancillary', type: 'ancillary', ...layer }, {\n id: el.id,\n element: el,\n selected,\n styles,\n geometry\n });\n\n return;\n }\n\n if (F.vertex.displayType(el) === 'document') {\n const mimeType = F.vertex.prop(el, ONTOLOGY_CONSTANTS.PROP_MIME_TYPE);\n\n if (GEOSHAPE_MIMETYPES.includes(mimeType)) {\n const rawProp = F.vertex.props(el, ONTOLOGY_CONSTANTS.PROP_RAW)[0];\n addOrUpdateSource({\n id: el.id,\n element: el,\n type: 'vectorXhr',\n mimeType,\n propName: rawProp.name,\n propKey: rawProp.key,\n selected,\n styles\n });\n }\n }\n\n const geoLocations = geoLocationProperties && geoLocationProperties.reduce((props, { title }) => {\n const geoProps = F.vertex.props(el, title);\n geoProps.forEach(geoProp => {\n const { value } = geoProp;\n if (value) {\n const { latitude, longitude } = value;\n if (!isNaN(latitude) && !isNaN(longitude)) {\n const validCoordinates = (latitude >= -90 && latitude <= 90) && (longitude >= -180 && longitude <= 180);\n if (validCoordinates) {\n props.push([longitude, latitude])\n } else {\n console.warn('Vertex has geoLocation with invalid coordinates', value, el)\n }\n }\n }\n })\n return props;\n }, []),\n iconUrl = 'map/marker/image?' + $.param({\n type: el.conceptType,\n workspaceId: this.props.workspaceId,\n scale: this.props.pixelRatio > 1 ? '2' : '1',\n }),\n iconUrlSelected = `${iconUrl}&selected=true`;\n\n if (geoLocations.length) {\n addOrUpdateSource({ id: 'cluster', ...layer }, {\n id: el.id,\n element: el,\n selected,\n iconUrl,\n iconUrlSelected,\n iconSize: getIconSize(this.props.pixelRatio),\n iconAnchor,\n pixelRatio: this.props.pixelRatio,\n styles,\n geometry,\n geoLocations\n });\n }\n })\n\n return sources;\n },\n\n legacyListeners(map) {\n this.removeEvents = [];\n\n _.each(map, (handler, events) => {\n var node = this.wrap;\n var func = handler;\n if (!_.isFunction(handler)) {\n node = handler.node;\n func = handler.handler;\n }\n this.removeEvents.push({ node, func, events });\n $(node).on(events, func);\n })\n },\n\n clearCaches() {\n clusterCache.clear();\n\n if (this.mounted) {\n Object.keys(this.caches).forEach(k => {\n Object.keys(this.caches[k]).forEach(key => this.caches[k][key].clear())\n })\n this.forceUpdate();\n }\n }\n });\n\n return RegistryInjectorHOC(Map, [\n 'org.bigconnect.map.style',\n 'org.bigconnect.map.geometry',\n 'org.bigconnect.map.layer'\n ])\n});\n\n\n\n// WEBPACK FOOTER //\n// ./Map.jsx","module.exports = __WEBPACK_EXTERNAL_MODULE_68__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"components/RegistryInjectorHOC\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 68\n// module chunks = 1","/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\ndefine([\n 'create-react-class',\n 'prop-types',\n 'openlayers',\n './util/layerHelpers',\n 'product/toolbar/ProductToolbar'\n], function(\n createReactClass,\n PropTypes,\n ol,\n layerHelpers,\n ProductToolbar) {\n\n const noop = function() {};\n\n const ANIMATION_DURATION = 200,\n MIN_FIT_ZOOM_RESOLUTION = 30,\n MAX_FIT_ZOOM_RESOLUTION = 20000,\n PREVIEW_WIDTH = 300,\n PREVIEW_HEIGHT = 300,\n PREVIEW_DEBOUNCE_SECONDS = 2,\n LAYERS_EXTENDED_DATA_KEY = 'org-bigconnect-map-layers',\n BASE_LAYER_ID = 'base';\n\n const OpenLayers = createReactClass({\n propTypes: {\n product: PropTypes.object.isRequired,\n baseSource: PropTypes.string.isRequired,\n baseSourceOptions: PropTypes.object,\n sourcesByLayerId: PropTypes.object,\n generatePreview: PropTypes.bool,\n onSelectElements: PropTypes.func.isRequired,\n onUpdatePreview: PropTypes.func.isRequired,\n onTap: PropTypes.func,\n onContextTap: PropTypes.func,\n onZoom: PropTypes.func,\n onPan: PropTypes.func,\n onMouseOver: PropTypes.func,\n onMouseOut: PropTypes.func\n },\n\n getInitialState() {\n return { panning: false }\n },\n\n getDefaultProps() {\n return {\n generatePreview: false,\n onTap: noop,\n onContextTap: noop,\n onZoom: noop,\n onPan: noop\n }\n },\n\n componentWillReceiveProps(nextProps) {\n const { sourcesByLayerId: prevSourcesByLayerId, product: prevProduct } = this.props;\n const {\n sourcesByLayerId: nextSourcesByLayerId,\n product: nextProduct,\n registry,\n layerExtensions } = nextProps;\n const { map, layersWithSources } = this.state;\n const nextLayerIds = Object.keys(nextProps.sourcesByLayerId);\n\n if (layersWithSources && (\n nextLayerIds.length !== Object.keys(layersWithSources).length\n || nextLayerIds.some(layerId => !layersWithSources[layerId])\n )) {\n const previous = Object.keys(prevSourcesByLayerId);\n const newLayers = [];\n const nextLayers = map.getLayerGroup().getLayers().getArray().slice(0);\n const existingLayersById = _.indexBy(nextLayers, layer => layer.get('id'));\n const newLayersWithSources = {};\n const addLayer = (initializer, layerId, options, map) => {\n const layerWithSource = this.initializeLayer(initializer, layerId, options, map);\n const layers = layerWithSource.layers || [layerWithSource.layer];\n\n layers.forEach(layer => {\n const config = nextProps.layerConfig && nextProps.layerConfig[layer.get('id')];\n if (config) {\n layerHelpers.setLayerConfig(config, layer);\n }\n\n newLayersWithSources[layerId] = layerWithSource;\n nextLayers.push(layer);\n })\n\n };\n\n Object.keys(nextSourcesByLayerId).forEach((layerId) => {\n if (!prevSourcesByLayerId[layerId]) {\n newLayers.push(layerId);\n } else {\n const layerIndex = previous.indexOf(layerId);\n previous.splice(layerIndex, 1);\n }\n });\n\n previous.forEach(layerId => {\n const layerIndex = nextLayers.findIndex(layer => layer.get('id') === layerId);\n nextLayers.splice(layerIndex, 1);\n });\n\n newLayers.forEach(layerId => {\n if (!existingLayersById[layerId]) {\n const { type, features, ...options } = nextSourcesByLayerId[layerId];\n const initializer = layerHelpers.byType[type] || registry['org.bigconnect.map.layer'].find(e => e.type === type);\n\n if (initializer) {\n addLayer(initializer, layerId, options, map)\n } else {\n console.warn('Sources present for layer: ' + layerId + ', but no layer type defined for: ' + type);\n }\n }\n });\n\n if (nextProduct.id !== prevProduct.id) {\n _.mapObject(layerExtensions, (e, layerId) => {\n if (!(layerId in newLayersWithSources) && !(layerId in nextSourcesByLayerId)) {\n addLayer(e, layerId, e.options, map);\n }\n })\n }\n\n map.getLayerGroup().setLayers(new ol.Collection(nextLayers));\n\n if (previous.length || Object.keys(newLayersWithSources).length) {\n this.setState({ layersWithSources: {\n ..._.omit(layersWithSources, previous),\n ...newLayersWithSources\n }});\n }\n }\n },\n\n componentDidUpdate(prevProps, prevState) {\n const { map, layersWithSources } = this.state;\n const { product, sourcesByLayerId, layerExtensions, layerConfig, focused, viewport, generatePreview } = this.props;\n\n let changed = false;\n let fit = [];\n\n const layers = map.getLayers();\n\n layers.forEach(layer => {\n const layerId = layer.get('id');\n\n const layerType = layer.get('type');\n const layerHelper = layerHelpers.byType[layerType] || layerExtensions[layerId];\n const layerWithSources = layersWithSources[layerId];\n const nextSource = sourcesByLayerId[layerId];\n const prevSource = prevProps.sourcesByLayerId[layerId];\n\n if (layerHelper && layerWithSources) {\n const shouldUpdate = _.isFunction(layerHelper.shouldUpdate)\n ? layerHelper.shouldUpdate(nextSource, prevSource, layerWithSources, focused)\n : true;\n\n if (shouldUpdate && _.isFunction(layerHelper.update) && nextSource) {\n const { changed: c = true, fitFeatures = [] } = layerHelper.update(nextSource, layerWithSources, focused) || {};\n changed = changed || c;\n if (fitFeatures) fit.push(...fitFeatures)\n }\n }\n });\n\n const newLayerOrder = product.extendedData\n && product.extendedData[LAYERS_EXTENDED_DATA_KEY]\n && product.extendedData[LAYERS_EXTENDED_DATA_KEY].layerOrder;\n const prevLayerOrder = prevProps.product.extendedData\n && prevProps.product.extendedData[LAYERS_EXTENDED_DATA_KEY]\n && prevProps.product.extendedData[LAYERS_EXTENDED_DATA_KEY].layerOrder;\n if (map && (map !== prevState.map || newLayerOrder !== prevLayerOrder)\n || prevState.layersWithSources.length !== Object.keys(layersWithSources).length\n || prevState.layersWithSource.some(layerId => !layersWithSources[layerId])) {\n this.applyLayerOrder();\n }\n\n if (fit.length) {\n this.fit({ limitToFeatures: fit });\n }\n\n if (viewport && !_.isEmpty(viewport)) {\n map.getView().setCenter(viewport.pan);\n map.getView().setResolution(viewport.zoom);\n }\n\n if (map && (!prevState.map || prevProps.layerConfig !== layerConfig)) {\n this.applyLayerConfig();\n }\n\n if (generatePreview) {\n this._updatePreview({ fit: !viewport });\n } else if (changed) {\n this.updatePreview();\n }\n },\n\n _updatePreview(options = {}) {\n const { fit = false } = options;\n const { map, layersWithSources } = this.state;\n const { base } = layersWithSources;\n const doFit = () => {\n if (fit) this.fit({ animate: false });\n };\n\n // Since this is delayed, make sure component not unmounted\n if (!this._canvasPreviewBuffer) return;\n\n doFit();\n map.once('postcompose', (event) => {\n if (!this._canvasPreviewBuffer) return;\n var loading = 0, loaded = 0, events, captureTimer;\n\n doFit();\n\n const mapCanvas = event.context.canvas;\n const capture = _.debounce(() => {\n if (!this._canvasPreviewBuffer) return;\n\n doFit();\n\n map.once('postrender', () => {\n if (!this._canvasPreviewBuffer) return;\n var newCanvas = this._canvasPreviewBuffer;\n var context = newCanvas.getContext('2d');\n var hRatio = PREVIEW_WIDTH / mapCanvas.width;\n var vRatio = PREVIEW_HEIGHT / mapCanvas.height;\n var ratio = Math.min(hRatio, vRatio);\n newCanvas.width = Math.trunc(mapCanvas.width * ratio);\n newCanvas.height = Math.trunc(mapCanvas.height * ratio);\n context.drawImage(mapCanvas,\n 0, 0, mapCanvas.width, mapCanvas.height,\n 0, 0, newCanvas.width, newCanvas.height\n );\n if (events) {\n events.forEach(key => ol.Observable.unByKey(key));\n }\n this.props.onUpdatePreview(newCanvas.toDataURL('image/png'));\n });\n map.renderSync();\n }, 100)\n\n const tileLoadStart = () => {\n clearTimeout(captureTimer);\n ++loading;\n };\n const tileLoadEnd = (event) => {\n clearTimeout(captureTimer);\n if (loading === ++loaded) {\n captureTimer = capture();\n }\n };\n\n events = [\n base.source.on('tileloadstart', tileLoadStart),\n base.source.on('tileloadend', tileLoadEnd),\n base.source.on('tileloaderror', tileLoadEnd)\n ];\n });\n map.renderSync();\n },\n\n componentDidMount() {\n this._canvasPreviewBuffer = document.createElement('canvas');\n this._canvasPreviewBuffer.width = PREVIEW_WIDTH;\n this._canvasPreviewBuffer.height = PREVIEW_HEIGHT;\n\n this.olEvents = [];\n this.domEvents = [];\n this.updatePreview = _.debounce(this._updatePreview, PREVIEW_DEBOUNCE_SECONDS * 1000);\n const { map, layersWithSources } = this.configureMap();\n\n this.setState({ map, layersWithSources })\n },\n\n componentWillUnmount() {\n this._canvasPreviewBuffer = null;\n clearTimeout(this._handleMouseMoveTimeout);\n if (this.domEvents) {\n this.domEvents.forEach(fn => fn());\n this.domEvents = null;\n }\n if (this.olEvents) {\n this.olEvents.forEach(key => ol.Observable.unByKey(key));\n this.olEvents = null;\n }\n },\n\n render() {\n // Cover the map when panning/dragging to avoid sending events there\n const moveWrapper = this.state.panning ? (
) : '';\n return (\n
\n
\n \n {moveWrapper}\n
\n )\n },\n\n onControlsFit() {\n this.fit();\n },\n\n onControlsZoom(type) {\n const { map } = this.state;\n const view = map.getView();\n\n if (!this._slowZoomIn) {\n this._slowZoomIn = _.throttle(zoomByDelta(1), ANIMATION_DURATION, {trailing: false});\n this._slowZoomOut = _.throttle(zoomByDelta(-1), ANIMATION_DURATION, {trailing: false});\n }\n\n if (type === 'in') {\n this._slowZoomIn();\n } else {\n this._slowZoomOut();\n }\n\n function zoomByDelta(delta) {\n return () => {\n var currentResolution = view.getResolution();\n if (currentResolution) {\n view.animate({\n resolution: view.constrainResolution(currentResolution, delta),\n duration: ANIMATION_DURATION\n });\n }\n }\n }\n },\n\n onControlsPan({ x, y }, { state }) {\n if (state === 'panningStart') {\n this.setState({ panning: true })\n } else if (state === 'panningEnd') {\n this.setState({ panning: false })\n } else {\n const { map } = this.state;\n const view = map.getView();\n\n var currentCenter = view.getCenter(),\n resolution = view.getResolution(),\n center = view.constrainCenter([\n currentCenter[0] - x * resolution,\n currentCenter[1] + y * resolution\n ]);\n\n view.setCenter(center);\n }\n },\n\n extentFromFeatures(features) {\n const extent = ol.extent.createEmpty();\n features.forEach(feature => {\n const fExtent = feature.getGeometry().getExtent();\n if (!ol.extent.isEmpty(fExtent)) {\n ol.extent.extend(extent, fExtent);\n }\n });\n return extent;\n },\n\n fit(options = {}) {\n const { animate = true, limitToFeatures = [] } = options;\n const { map, layersWithSources } = this.state;\n const view = map.getView();\n const changeZoom = limitToFeatures.length !== 1;\n let extent;\n\n if (limitToFeatures.length) {\n extent = this.extentFromFeatures(limitToFeatures)\n } else {\n extent = ol.extent.createEmpty();\n map.getLayers().forEach(layer => {\n const source = layersWithSources.cluster.layers.includes(layer) ?\n layersWithSources.cluster.source : layer.getSource();\n\n if (layer.getVisible()) {\n if (_.isFunction(source.getExtent)) {\n ol.extent.extend(extent, source.getExtent());\n }\n }\n })\n }\n\n if (!ol.extent.isEmpty(extent)) {\n var resolution = view.getResolution(),\n extentWithPadding = extent,\n { left, right, top, bottom } = this.props.panelPadding,\n clientBox = this.refs.map.getBoundingClientRect(),\n padding = 20,\n viewportWidth = clientBox.width - left - right - padding * 2,\n viewportHeight = clientBox.height - top - bottom - padding * 2,\n extentWithPaddingSize = ol.extent.getSize(extentWithPadding),\n currentExtent = view.calculateExtent([viewportWidth, viewportHeight]),\n\n // Figure out ideal resolution based on available realestate\n idealResolution = Math.max(\n extentWithPaddingSize[0] / viewportWidth,\n extentWithPaddingSize[1] / viewportHeight\n );\n\n\n if (limitToFeatures.length) {\n const horizontalSync = ((left + padding) / 2 - (right + padding) / 2) * resolution;\n const verticalSync = ((top + padding) / 2 - (bottom + padding) / 2) * resolution;\n currentExtent[0] += horizontalSync;\n currentExtent[1] += verticalSync;\n currentExtent[2] += horizontalSync;\n currentExtent[3] += verticalSync;\n\n var insideCurrentView = ol.extent.containsExtent(currentExtent, extent);\n if (insideCurrentView) {\n return;\n }\n }\n\n const newResolution = changeZoom ? view.constrainResolution(\n Math.min(MAX_FIT_ZOOM_RESOLUTION, Math.max(idealResolution, MIN_FIT_ZOOM_RESOLUTION)), -1\n ) : view.getResolution();\n const center = ol.extent.getCenter(extentWithPadding);\n const offsetX = left - right;\n const offsetY = top - bottom;\n const lon = offsetX * newResolution / 2;\n const lat = offsetY * newResolution / 2;\n center[0] = center[0] - lon;\n center[1] = center[1] - lat;\n\n const options = { center };\n if (changeZoom) {\n options.resolution = newResolution;\n }\n\n view.animate({\n ...options,\n duration: animate ? ANIMATION_DURATION : 0\n })\n } else {\n view.animate({\n ...this.getDefaultViewParameters(),\n duration: animate ? ANIMATION_DURATION : 0\n });\n }\n },\n\n getDefaultViewParameters() {\n return {\n zoom: 2,\n minZoom: 1,\n center: [0, 0]\n };\n },\n\n configureMap() {\n const { baseSource, baseSourceOptions = {}, sourcesByLayerId, layerExtensions } = this.props;\n const layersWithSources = {};\n\n const addLayer = (layerExtension, id, options, map) => {\n if (layersWithSources[id]) return;\n\n const layerWithSource = this.initializeLayer(layerExtension, id, options, map);\n const layers = layerWithSource.layers || [layerWithSource.layer];\n\n layers.forEach(l => { map.addLayer(l); });\n layersWithSources[id] = layerWithSource;\n };\n\n const map = new ol.Map({\n loadTilesWhileInteracting: true,\n keyboardEventTarget: document,\n controls: [],\n layers: [],\n target: this.refs.map\n });\n\n // add the base(tile) layer\n addLayer(layerHelpers.byType.tile, BASE_LAYER_ID, { source: baseSource, sourceOptions: baseSourceOptions }, map);\n // add layers from org.bigconnect.map.layer registered extensions\n _.mapObject(layerExtensions, (extension, layerId) => { addLayer(extension, layerId, extension.options, map) });\n // add layers from sources passed in props\n _.mapObject(sourcesByLayerId, ({ type, features, ...options }, layerId) => {\n const initializer = layerHelpers.byType[type];\n if (initializer) {\n addLayer(initializer, layerId, options, map);\n } else {\n console.warn('Sources present for layer: ' + layerId + ', but no layer type defined for: ' + type);\n }\n });\n this.configureEvents(map);\n\n const view = new ol.View(this.getDefaultViewParameters());\n this.olEvents.push(view.on('change:center', (event) => this.props.onPan(event)));\n this.olEvents.push(view.on('change:resolution', (event) => this.props.onZoom(event)));\n\n map.setView(view);\n return { map, layersWithSources}\n },\n\n configureEvents(map) {\n var self = this;\n\n this.olEvents.push(map.on('click', function(event) {\n self.props.onTap(event);\n }));\n this.olEvents.push(map.on('pointerup', function(event) {\n const { pointerEvent } = event;\n if (pointerEvent && pointerEvent.button === 2) {\n self.props.onContextTap(ol, event);\n }\n }));\n\n const viewport = map.getViewport();\n this.domEvent(viewport, 'contextmenu', function(event) {\n event.preventDefault();\n })\n this.domEvent(viewport, 'mouseup', function(event) {\n event.preventDefault();\n if (event.button === 2 || event.ctrlKey) {\n // TODO\n //self.handleContextMenu(event);\n }\n });\n this.domEvent(viewport, 'mousemove', event => {\n const pixel = map.getEventPixel(event);\n const hit = map.getFeaturesAtPixel(pixel);\n if (hit) {\n this.handleMouseMove(hit);\n map.getTarget().style.cursor = 'pointer';\n } else {\n this.handleMouseMove();\n map.getTarget().style.cursor = '';\n }\n });\n },\n\n initializeLayer(layerExtension, layerId, options, map) {\n const { baseSource, baseSourceOptions, sourcesByLayerId, generatePreview, layerExtensions, layerConfig, ...handlers } = this.props;\n const layerHelper = layerExtension.type && layerHelpers.byType[layerExtension.type] || layerExtension;\n const layerWithSource = layerHelper.configure(layerId, options, map);\n\n if (_.isFunction(layerHelper.addEvents)) {\n this.olEvents.concat(layerHelper.addEvents(map, layerWithSource, handlers));\n }\n\n const layers = layerWithSource.layers || [layerWithSource.layer];\n layers.forEach(layer => {\n const config = layerConfig && layerConfig[layer.get('id')];\n if (config) {\n layerHelpers.setLayerConfig(config, layer);\n }\n });\n\n return layerWithSource;\n },\n\n applyLayerOrder() {\n const { map } = this.state;\n const { product, setLayerOrder } = this.props;\n const layersById = _.indexBy(map.getLayers().getArray(), layer => layer.get('id'));\n const nextLayerGroup = map.getLayerGroup();\n let layerOrder = product.extendedData\n && product.extendedData[LAYERS_EXTENDED_DATA_KEY]\n && product.extendedData[LAYERS_EXTENDED_DATA_KEY].layerOrder.slice(0) || [];\n\n let orderedLayers = new ol.Collection();\n let newLayers = [];\n\n orderedLayers.push(layersById[BASE_LAYER_ID]);\n delete layersById[BASE_LAYER_ID];\n\n if (layerOrder.length) {\n layerOrder = layerOrder.reverse();\n\n layerOrder.forEach((layerId, i) => {\n const layer = layersById[layerId];\n if (layer) {\n orderedLayers.push(layer);\n\n delete layersById[layerId];\n }\n });\n\n _.mapObject(layersById, (layer, layerId) => {\n orderedLayers.push(layer);\n newLayers.push(layerId);\n });\n\n nextLayerGroup.setLayers(orderedLayers);\n } else {\n newLayers = map.getLayers().getArray().slice(1).reduce((ids, layer) => {\n ids.push(layer.get('id'));\n return ids;\n }, []);\n }\n\n if (newLayers.length) {\n setLayerOrder(layerOrder.concat(newLayers.reverse()))\n }\n },\n\n applyLayerConfig() {\n const map = this.state.map;\n const layerConfig = this.props.layerConfig;\n\n if (layerConfig) {\n const layersById = _.indexBy(map.getLayers().getArray(), layer => layer.get('id'));\n\n _.mapObject(layersById, (layer, layerId) => {\n const config = layerConfig[layerId];\n layerHelpers.setLayerConfig(config, layersById[layerId]);\n });\n }\n },\n\n domEvent(el, type, handler) {\n this.domEvents.push(() => el.removeEventListener(type, handler));\n el.addEventListener(type, handler, false);\n },\n\n handleMouseMove(features) {\n const { onMouseOver, onMouseOut } = this.props;\n const { map } = this.state;\n\n if (!onMouseOver && !onMouseOut ) {\n return;\n }\n\n const stillHoveringSameFeature = features &&\n this._handleMouseMoveFeatures &&\n this._handleMouseMoveFeatures.length === features.length &&\n this._handleMouseMoveFeatures[0] === features[0];\n\n if (!stillHoveringSameFeature) {\n clearTimeout(this._handleMouseMoveTimeout);\n\n if (features && features.length) {\n this._handleMouseMoveTimeout = setTimeout(() => {\n this._handleMouseMoveFeatures = features;\n if (onMouseOver) {\n onMouseOver(ol, map, this._handleMouseMoveFeatures)\n }\n }, 250);\n } else if (this._handleMouseMoveFeatures) {\n if (onMouseOut) {\n onMouseOut(ol, map, this._handleMouseMoveFeatures)\n }\n this._handleMouseMoveFeatures = null;\n }\n }\n },\n\n /**\n * Map work product toolbar item component\n *\n * @typedef org.bigconnect.product.toolbar.item~MapComponent\n * @property {function} requestUpdate Reload the maps extensions and styles.\n * Call when the result of extensions will change from variables\n * outside of inputs (preferences, etc).\n * @property {object} product The map product\n * @property {object} ol The [Openlayers Api](http://openlayers.org/en/latest/apidoc/)\n * @property {object} map [map](http://openlayers.org/en/latest/apidoc/ol.Map.html) instance\n * @property {Object.} layersWithSources Keyed by the id of the layer, the map's rendered layers with their sources\n * @property {object} cluster deprecated, access this from inside {@link org.bigconnect.product.toolbar.item~layersWithSources} instead\n * @property {object} cluster.clusterSource [multiPointCluster] that implements the [`ol.source.Cluster`](http://openlayers.org/en/latest/apidoc/ol.source.Cluster.html) interface to cluster the `source` features.\n * @property {object} cluster.source The [`ol.source.Vector`](http://openlayers.org/en/latest/apidoc/ol.source.Vector.html) source of all map pins before clustering.\n * @property {object} cluster.layer The [`ol.layer.Vector`](http://openlayers.org/en/latest/apidoc/ol.layer.Vector.html) pin layer\n */\n getInjectedToolProps() {\n const { clearCaches: requestUpdate, product } = this.props;\n const { map, layersWithSources } = this.state;\n let props = {};\n\n if (map && layersWithSources) {\n /**\n * @typedef {object} org.bigconnect.product.toolbar.item~layerWithSource\n * @property {object} source The [`ol.source`](http://openlayers.org/en/latest/apidoc/ol.source.html) of the layer\n * @property {object} layer The [`ol.layer`](http://openlayers.org/en/latest/apidoc/ol.layer.html) rendered in the map\n */\n /**\n * @typedef {object.} org.bigconnect.product.toolbar.item~layersWithSources\n *\n * Keyed by layerId, the map's rendered sources with the layers they are backing\n */\n props = { product, ol, map, cluster: layersWithSources.cluster, layersWithSources, requestUpdate }\n }\n\n return props;\n }\n })\n\n return OpenLayers;\n})\n\n\n\n\n// WEBPACK FOOTER //\n// ./OpenLayers.jsx","module.exports = __WEBPACK_EXTERNAL_MODULE_70__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"product/toolbar/ProductToolbar\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 70\n// module chunks = 1","/*\n * This file is part of the BigConnect project.\n *\n * Copyright (c) 2013-2020 MWARE SOLUTIONS SRL\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License version 3\n * as published by the Free Software Foundation with the addition of the\n * following permission added to Section 15 as permitted in Section 7(a):\n * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY\n * MWARE SOLUTIONS SRL, MWARE SOLUTIONS SRL DISCLAIMS THE WARRANTY OF\n * NON INFRINGEMENT OF THIRD PARTY RIGHTS\n *\n * This program is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n * or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Affero General Public License for more details.\n * You should have received a copy of the GNU Affero General Public License\n * along with this program; if not, see http://www.gnu.org/licenses or write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA, 02110-1301 USA, or download the license from the following URL:\n * https://www.gnu.org/licenses/agpl-3.0.txt\n *\n * The interactive user interfaces in modified source and object code versions\n * of this program must display Appropriate Legal Notices, as required under\n * Section 5 of the GNU Affero General Public License.\n *\n * You can be released from the requirements of the license by purchasing\n * a commercial license. Buying such a license is mandatory as soon as you\n * develop commercial activities involving the BigConnect software without\n * disclosing the source code of your own applications.\n *\n * These activities include: offering paid services to customers as an ASP,\n * embedding the product in a web application, shipping BigConnect with a\n * closed source product.\n */\ndefine(['openlayers', 'util/mapConfig'], function(ol, mapConfig) {\n\n let overlay;\n let innerMap;\n let layer;\n let element;\n\n return {\n show(ol, map, cluster, styleFn) {\n if (overlay) {\n map.removeOverlay(overlay);\n }\n\n const coordinates = cluster.get('coordinates');\n const extent = ol.extent.boundingExtent(coordinates)\n const size = getSize(extent)\n const coord = cluster.getGeometry().getCoordinates();\n const pixel = map.getPixelFromCoordinate(coord);\n const offset = 20;\n const flip = pixel[1] < (size[1] + offset)\n\n if (!element) {\n element = $('
').css({ position: 'relative'}).show()\n element.append('
')\n element.append('
')\n }\n element.toggleClass('top', !flip).toggleClass('bottom', flip)\n element.find('.popover-content').css({ width: size[0], height: size[1] })\n\n overlay = new ol.Overlay({\n offset: [0, offset * (flip ? 1 : -1)],\n element: element[0],\n });\n\n element.show()\n map.addOverlay(overlay);\n\n overlay.setPosition(coord);\n overlay.setPositioning(flip ? 'top-center' : 'bottom-center');\n\n if (!innerMap) {\n const { map: _map, layer: _layer } = setupMap(styleFn);\n innerMap = _map;\n layer = _layer;\n }\n\n innerMap.setSize(size);\n\n const maxRadius = cluster.get('features').reduce((max, f) => {\n return Math.max(max, f.get('_nodeRadius'))\n }, 0);\n innerMap.getView().fit(extent, {\n size,\n maxZoom: 9,\n padding: [maxRadius, maxRadius, maxRadius, maxRadius]\n })\n layer.setStyle(styleFn);\n\n const source = layer.getSource();\n source.clear();\n source.addFeatures(cluster.get('features'))\n },\n\n hide(ol, map) {\n if (overlay) {\n map.removeOverlay(overlay);\n }\n }\n }\n\n function getSize(extent) {\n const aspect = (extent[2] - extent[0]) / (extent[3] - extent[1]) || 1\n let size = [200, 200]\n if (aspect > 1) {\n size[1] = Math.max(150, size[0] * (1 / aspect))\n } else {\n size[0] = Math.max(150, size[1] * aspect);\n }\n return size;\n }\n\n function setupMap() {\n const { source, sourceOptions } = mapConfig();\n let baseLayerSource = new ol.source[source](sourceOptions)\n const layer = new ol.layer.Vector({\n source: new ol.source.Vector({\n features: []\n })\n })\n return {\n map: new ol.Map({\n controls: [],\n layers: [\n new ol.layer.Tile({ source: baseLayerSource }),\n layer,\n ],\n target: element.find('.popover-content')[0]\n }),\n layer\n };\n }\n})\n\n\n\n// WEBPACK FOOTER //\n// ./clusterHover.js","module.exports = __WEBPACK_EXTERNAL_MODULE_72__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"util/deepObjectCache\",\"commonjs2\":false,\"commonjs\":false}\n// module id = 72\n// module chunks = 1"],"sourceRoot":""}