/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // identity function for calling harmony imports with the correct context /******/ __webpack_require__.i = function(value) { return value; }; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 34); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Created by gavorhes on 12/10/2015. */ Object.defineProperty(exports, "__esModule", { value: true }); /** * create a namespace on the gv object * @param {string} namespace to create * @returns {object} object representing the namespace */ function provide(namespace) { "use strict"; if (typeof window['gv'] == 'undefined') { window['gv'] = {}; } var parts = namespace.split('.'); var nameSpace = window['gv']; for (var i = 0; i < parts.length; i++) { var newObject = nameSpace[parts[i]]; if (typeof newObject == 'undefined') { nameSpace[parts[i]] = {}; } nameSpace = nameSpace[parts[i]]; } return nameSpace; } provide('util'); window['gv'].util.provide = provide; exports.default = provide; /***/ }), /* 1 */ /***/ (function(module, exports) { module.exports = $; /***/ }), /* 2 */ /***/ (function(module, exports) { module.exports = ol; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Created by gavorhes on 11/3/2015. */ Object.defineProperty(exports, "__esModule", { value: true }); var provide_1 = __webpack_require__(0); var nm = provide_1.default('util'); /** * guids are used to uniquely identify groups and features * @returns {string} a new guid */ function makeGuid() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' .replace(/[xy]/g, function (c) { var r = Math.random() * 16 | 0, v = c == 'x' ? r : r & 0x3 | 0x8; return v.toString(16); }); } nm.makeGuid = makeGuid; exports.default = makeGuid; /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Created by gavorhes on 11/3/2015. */ Object.defineProperty(exports, "__esModule", { value: true }); var mapPopupCls_1 = __webpack_require__(12); /** * The single popup object catch is that it is common to multimap pages * @type {MapPopupCls} */ exports.mapPopup = new mapPopupCls_1.default(); exports.default = exports.mapPopup; /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Created by gavorhes on 12/8/2015. */ var provide_1 = __webpack_require__(0); var nm = provide_1.default('olHelpers'); /** * base interaction */ var MapInteractionBase = (function () { /** * map interaction base * @param subtype - the interaction subtype */ function MapInteractionBase(subtype) { this._map = null; this._initialized = false; this._subtype = subtype; } /** * base initializer, returns true for already initialized * @param theMap - the ol Map * @returns true for already initialized */ MapInteractionBase.prototype.init = function (theMap) { if (!this._initialized) { this._map = theMap; this._initialized = true; } }; Object.defineProperty(MapInteractionBase.prototype, "map", { /** * get reference to the ol map object * @returns {ol.Map} the map object */ get: function () { return this._map; }, enumerable: true, configurable: true }); Object.defineProperty(MapInteractionBase.prototype, "initialized", { /** * get if is initialized * @returns {boolean} is initialized */ get: function () { return this._initialized; }, enumerable: true, configurable: true }); /** * Check the initialization status and throw exception if not valid yet * @protected */ MapInteractionBase.prototype._checkInit = function () { if (!this.initialized) { var msg = this._subtype + " object not initialized"; alert(msg); console.log(msg); throw msg; } }; /** * Check the initialization status and throw exception if not valid yet */ MapInteractionBase.prototype.checkInit = function () { this._checkInit(); }; return MapInteractionBase; }()); exports.MapInteractionBase = MapInteractionBase; nm.MapInteractionBase = MapInteractionBase; exports.default = MapInteractionBase; /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Created by gavorhes on 11/3/2015. */ Object.defineProperty(exports, "__esModule", { value: true }); var mapMoveCls_1 = __webpack_require__(11); /** * The single map move object catch is that it is common to multimap pages * @type {MapMoveCls} */ exports.mapMove = new mapMoveCls_1.default(); exports.default = exports.mapMove; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Created by gavorhes on 12/15/2015. */ Object.defineProperty(exports, "__esModule", { value: true }); var quickMapBase_1 = __webpack_require__(13); var provide_1 = __webpack_require__(0); var mapMove_1 = __webpack_require__(6); var mapPopup_1 = __webpack_require__(4); var nm = provide_1.default('olHelpers'); /** * Sets up a map with some default parameters and initializes * mapMove and mapPopup * * @param {object} [options={}] config options * @param {string} [options.divId=map] map div id * @param {object} [options.center={}] center config object * @param {number} [options.center.x=-10018378] center x, web mercator x or lon * @param {number} [options.center.y=5574910] center y, web mercator y or lat * @param {number} [options.zoom=7] zoom level * @param {number} [options.minZoom=undefined] min zoom * @param {number} [options.maxZoom=undefined] max zoom * @param {boolean} [options.baseSwitcher=true] if add base map switcher * @param {boolean} [options.fullScreen=false] if add base map switcher * @returns {ol.Map} the ol map */ function quickMap(options) { var m = quickMapBase_1.quickMapBase(options); mapMove_1.default.init(m); mapPopup_1.default.init(m); return m; } exports.quickMap = quickMap; nm.quickMap = quickMap; exports.default = quickMap; /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var zoomResolutionConvert = __webpack_require__(14); var provide_1 = __webpack_require__(0); var makeGuid_1 = __webpack_require__(3); var $ = __webpack_require__(1); var nm = provide_1.default('layers'); /** * The base layer class * @abstract */ var LayerBase = (function () { /** * The base layer for all others * @param {string} url - url for source * @param {object} options - config * @param {string} [options.id=makeGuid()] - layer id * @param {string} [options.name=Unnamed Layer] - layer name * @param {number} [options.opacity=1] - opacity * @param {boolean} [options.visible=true] - default visible * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 * @param {object} [options.params={}] - the get parameters to include to retrieve the layer * @param {number} [options.zIndex=0] - the z index for the layer * @param {function} [options.loadCallback] - function to call on load, context this is the layer object * @param {boolean} [options.legendCollapse=false] - if the legend item should be initially collapsed * @param {boolean} [options.legendCheckbox=true] - if the legend item should have a checkbox for visibility * @param {boolean} [options.legendContent=undefined] - additional content to add to the legend */ function LayerBase(url, options) { if (options === void 0) { options = {}; } options = options || {}; if (typeof url !== 'string') { throw 'Invalid URL'; } this._url = url; this._params = typeof options.params == 'object' ? options.params : {}; this._legendCollapse = typeof options.legendCollapse == 'boolean' ? options.legendCollapse : false; this._legendCheckbox = typeof options.legendCheckbox == 'boolean' ? options.legendCheckbox : true; this.id = options.id || makeGuid_1.default(); this._name = options.name || 'Unnamed Layer'; this.animate = false; this._opacity = typeof options.opacity == 'number' ? options.opacity : 1; if (this._opacity > 1) { this._opacity = 1; } else if (this._opacity < 0) { this._opacity = 0; } this._visible = typeof options.visible === 'boolean' ? options.visible : true; this._source = undefined; /** * * @protected */ this._olLayer = undefined; this._loaded = false; this._maxResolution = zoomResolutionConvert.zoomToResolution(options.minZoom); if (typeof this._maxResolution !== 'undefined') { this._maxResolution += 0.00001; } this._minResolution = zoomResolutionConvert.zoomToResolution(options.maxZoom); this._minZoom = typeof options.minZoom == 'number' ? options.minZoom : undefined; this._maxZoom = typeof options.maxZoom == 'number' ? options.maxZoom : undefined; this._zIndex = typeof options.zIndex == 'number' ? options.zIndex : 0; this.loadCallback = typeof options.loadCallback == 'function' ? options.loadCallback : function () { }; this._legendContent = ''; if (this._legendCheckbox) { this._legendContent += "<input type=\"checkbox\" " + (this.visible ? 'checked' : '') + " " + ("class=\"legend-check\" id=\"" + this.id + "-legend-layer-check\"><span></span>"); this._legendContent += "<label for=\"" + this.id + "-legend-layer-check\" class=\"legend-layer-name\">" + this.name + "</label>"; } else { this._legendContent += "<label class=\"legend-layer-name\">" + this.name + "</label>"; } this._$legendDiv = null; this._applyCollapseCalled = false; this._addLegendContent(typeof options.legendContent === 'string' ? options.legendContent : undefined); } /** * base load function, sets _loaded = true if it is not already * @protected * @returns {boolean} if already loaded */ LayerBase.prototype._load = function () { if (this.loaded == true) { return true; } else { this._loaded = true; return false; } }; /** * Get the legend html, be sure to only add to the DOM once * @returns {string} html for layer wrapped in a div */ LayerBase.prototype.getLegendDiv = function () { return "<div class=\"legend-layer-div\" id=\"" + this.id + "-legend-layer-div\">" + this._legendContent + "</div>"; }; /** * * @param additionalContent - additional content to add to legend * @private */ LayerBase.prototype._addLegendContent = function (additionalContent) { if (additionalContent === void 0) { additionalContent = ''; } var addCollapse = additionalContent.indexOf('<ul>') > -1; if (addCollapse) { additionalContent = '<span class="legend-items-expander" title="Expand/Collapse">▼</span>' + additionalContent; } this._legendContent += additionalContent; this._$legendDiv = $("#" + this.id + "-legend-layer-div"); if (this._$legendDiv.length > 0) { this._$legendDiv.append(additionalContent); this.applyCollapse(); } }; /** * add additional content to the legend * @param {string} [additionalContent=] - additonal content to add */ LayerBase.prototype.addLegendContent = function (additionalContent) { this._addLegendContent(additionalContent); }; LayerBase.prototype.applyCollapse = function () { if (this._applyCollapseCalled) { console.log('collapse already applied'); return undefined; } this._$legendDiv = $("#" + this.id + "-legend-layer-div"); if (this._$legendDiv.length > 0) { var $expander = this._$legendDiv.find('.legend-items-expander'); if ($expander.length > 0) { this._applyCollapseCalled = true; $expander.click(function () { var $this = $(this); $this.siblings('ul').slideToggle(); if ($this.hasClass('legend-layer-group-collapsed')) { $this.removeClass('legend-layer-group-collapsed'); $this.html('▼'); } else { $this.addClass('legend-layer-group-collapsed'); $this.html('▶'); } }); if (this._legendCollapse) { $expander.trigger('click'); } } } }; /** * trick to refresh the layer */ LayerBase.prototype.refresh = function () { if (this.source) { this.source.refresh(); } }; Object.defineProperty(LayerBase.prototype, "id", { get: function () { return this._id; }, set: function (newId) { this._id = newId; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBase.prototype, "animate", { get: function () { return this._animate; }, set: function (animate) { this._animate = animate; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBase.prototype, "legendContent", { /** * get the legend content * @type {string} */ get: function () { return this._legendContent; }, /** * set the legend content directly * @param {string} newVal - new content * @protected */ set: function (newVal) { this._legendContent = newVal; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBase.prototype, "params", { /** * get the map get params * @type {object} */ get: function () { return this._params; }, /** * set the map get params * @param {object} newParams - new get params * @protected */ set: function (newParams) { this._params = newParams; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBase.prototype, "minResolution", { /** * get the minimum resolution * @type {number|*} */ get: function () { return this._minResolution; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBase.prototype, "maxResolution", { /** * get the maximum resolution * @type {number|*} */ get: function () { return this._maxResolution; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBase.prototype, "minZoom", { /** * get min zoom * @type {number|*} */ get: function () { return this._minZoom; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBase.prototype, "maxZoom", { /** * get max zoom * @type {number|*} */ get: function () { return this._maxZoom; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBase.prototype, "url", { /** * get the url * @type {string} */ get: function () { return this._url; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBase.prototype, "visible", { /** * Get the layer visibility * @type {boolean} */ get: function () { return this._visible; }, /** * set the visibility * @param visibility */ set: function (visibility) { this.setVisible(visibility); }, enumerable: true, configurable: true }); LayerBase.prototype.setVisible = function (visibility) { this._visible = visibility; if (this.olLayer) { this.olLayer.setVisible(this._visible); if (visibility && !this._loaded) { this._load(); } } }; Object.defineProperty(LayerBase.prototype, "opacity", { /** * Get the layer opacity * @type {number} */ get: function () { return this._opacity; }, /** * Set the layer opacity * @param {number} opacity - layer opacity */ set: function (opacity) { this._opacity = opacity; if (this.olLayer) { this.olLayer.setOpacity(this._opacity); } }, enumerable: true, configurable: true }); Object.defineProperty(LayerBase.prototype, "name", { /** * Get the layer name * @type {string} */ get: function () { return this._name; }, /** * set the layer name * @param {string} newName - the new name */ set: function (newName) { this._name = newName; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBase.prototype, "loaded", { /** * Check if the layer is loaded * @type {boolean} */ get: function () { return this._loaded; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBase.prototype, "source", { /** * get the layer source * @type {*} */ get: function () { return this.getSource(); }, enumerable: true, configurable: true }); LayerBase.prototype.getSource = function () { return this._source; }; Object.defineProperty(LayerBase.prototype, "zIndex", { /** * get the z index */ get: function () { return this._zIndex; }, /** * set the z index */ set: function (newZ) { this._zIndex = newZ; }, enumerable: true, configurable: true }); LayerBase.prototype.setZIndex = function (newZ) { }; Object.defineProperty(LayerBase.prototype, "olLayer", { /** * the the ol layer */ get: function () { return this.getOlLayer(); }, enumerable: true, configurable: true }); LayerBase.prototype.getOlLayer = function () { return this._olLayer; }; return LayerBase; }()); exports.LayerBase = LayerBase; nm.LayerBase = LayerBase; exports.default = LayerBase; /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var provide_1 = __webpack_require__(0); var nm = provide_1.default('util.checkDefined'); /** * check if the input is undefined or null * @param input - input pointer * @returns true undefined or null */ function undefinedOrNull(input) { "use strict"; return (typeof input === 'undefined' || input === null); } exports.undefinedOrNull = undefinedOrNull; nm.undefinedOrNull = undefinedOrNull; /** * check if the input is defined and not null * @param input - input pointer * @returns true defined and not null */ function definedAndNotNull(input) { "use strict"; return !(undefinedOrNull(input)); } exports.definedAndNotNull = definedAndNotNull; nm.definedAndNotNull = definedAndNotNull; /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); /** * Created by gavorhes on 12/7/2015. */ var LayerBase_1 = __webpack_require__(8); var esriToOl = __webpack_require__(16); var mapPopup_1 = __webpack_require__(4); var provide_1 = __webpack_require__(0); var ol = __webpack_require__(2); var $ = __webpack_require__(1); var nm = provide_1.default('layers'); /** * esri mapserver layer * @augments LayerBase */ var LayerEsriMapServer = (function (_super) { __extends(LayerEsriMapServer, _super); /** * The base layer for all others * @param {string} url - resource url * @param {object} [options] - config * @param {string} [options.id] - layer id * @param {string} [options.name=Unnamed Layer] - layer name * @param {number} [options.opacity=1] - opacity * @param {boolean} [options.visible=true] - default visible * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 * @param {object} [options.params={}] the get parameters to include to retrieve the layer * @param {number} [options.zIndex=0] the z index for the layer * @param {function} [options.loadCallback] function to call on load, context this is the layer object * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility * @param {boolean} [options.legendContent] additional content to add to the legend * @param {boolean} [options.addPopup=false] if a popup should be added * @param {undefined|Array<number>} [options.showLayers=undefined] if a popup should be added */ function LayerEsriMapServer(url, options) { if (options === void 0) { options = {}; } var _this = _super.call(this, url, options) || this; _this._source = new ol.source.TileArcGISRest({ url: _this.url == '' ? undefined : _this.url, params: typeof options.showLayers == 'undefined' ? undefined : { layers: 'show:' + options.showLayers.join(',') } }); _this._olLayer = new ol.layer.Tile({ source: _this._source, visible: _this.visible, opacity: _this.opacity, minResolution: _this._minResolution, maxResolution: _this._maxResolution }); _this._olLayer.setZIndex(_this._zIndex); options.addPopup = typeof options.addPopup == 'boolean' ? options.addPopup : false; _this._esriFormat = new ol.format.EsriJSON(); _this._popupRequest = null; _this.addLegendContent(); if (options.addPopup) { mapPopup_1.default.addMapServicePopup(_this); } return _this; } /** * add additional content to the legend * @param {string} [additionalContent=''] additional content for legend */ LayerEsriMapServer.prototype.addLegendContent = function (additionalContent) { var _this = this; var urlCopy = this.url; if (urlCopy[urlCopy.length - 1] !== '/') { urlCopy += '/'; } urlCopy += 'legend?f=pjson&callback=?'; $.get(urlCopy, {}, function (d) { var newHtml = esriToOl.makeMapServiceLegend(d); _super.prototype.addLegendContent.call(_this, newHtml); }, 'json'); }; LayerEsriMapServer.prototype.getPopupInfo = function (queryParams) { if (!this.visible) { return; } var urlCopy = this.url; if (urlCopy[urlCopy.length - 1] != '/') { urlCopy += '/'; } urlCopy += 'identify?callback=?'; var __this = this; if (this._popupRequest != null) { this._popupRequest.abort(); } this._popupRequest = $.get(urlCopy, queryParams, function (d) { for (var _i = 0, _a = d['results']; _i < _a.length; _i++) { var r = _a[_i]; var popupHtml = '<table class="esri-popup-table">'; for (var a in r['attributes']) { if (r['attributes'].hasOwnProperty(a)) { var attrVal = r['attributes'][a]; if (attrVal == null || attrVal.toString().toLowerCase() == 'null') { continue; } var attr = a; if (attr.length > 14) { attr = attr.slice(0, 11) + '...'; } popupHtml += "<tr><td>" + attr + "</td><td>" + attrVal + "</td></tr>"; } } popupHtml += '</table>'; mapPopup_1.default.addMapServicePopupContent(__this._esriFormat.readFeature(r), __this, popupHtml, r['layerName']); } }, 'json'); this._popupRequest.always(function () { __this._popupRequest = null; }); }; Object.defineProperty(LayerEsriMapServer.prototype, "source", { /** * * @returns {ol.source.TileArcGISRest} the vector source */ get: function () { return _super.prototype.getSource.call(this); }, enumerable: true, configurable: true }); Object.defineProperty(LayerEsriMapServer.prototype, "olLayer", { /** * * @returns the ol layer */ get: function () { return _super.prototype.getOlLayer.call(this); }, enumerable: true, configurable: true }); return LayerEsriMapServer; }(LayerBase_1.LayerBase)); exports.LayerEsriMapServer = LayerEsriMapServer; nm.LayerEsriMapServer = LayerEsriMapServer; exports.default = LayerEsriMapServer; /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var mapInteractionBase_1 = __webpack_require__(5); var checkDefined = __webpack_require__(9); var provide_1 = __webpack_require__(0); var makeGuid_1 = __webpack_require__(3); var $ = __webpack_require__(1); var nm = provide_1.default('olHelpers'); /** * assists with map move interactions, trigger callback functions * @augments MapInteractionBase */ var MapMoveCls = (function (_super) { __extends(MapMoveCls, _super); /** * constructor called implicitly */ function MapMoveCls() { var _this = _super.call(this, 'map move') || this; _this._arrLyrRequest = []; _this._arrLyrTimeout = []; _this._arrLayer = []; _this._lookupLayer = {}; _this._mapMoveCallbacks = []; _this._mapMoveCallbacksLookup = {}; _this._mapMoveCallbackDelays = []; _this._mapMoveCallbackContext = []; _this._mapMoveCallbackTimeout = []; _this._mapExtent = undefined; _this._zoomLevel = undefined; return _this; } /** * initialize the map move object * @param theMap - the ol map */ MapMoveCls.prototype.init = function (theMap) { var _this = this; _super.prototype.init.call(this, theMap); this.map.getView().on(['change:center', 'change:resolution'], function (e) { _this._updateMapExtent(); // trigger the layer updates for (var i = 0; i < _this._arrLayer.length; i++) { _this.triggerLyrLoad(_this._arrLayer[i], i, e.type); } // trigger the map callbacks for (var i = 0; i < _this._mapMoveCallbacks.length; i++) { _this.triggerMoveCallback(i, e.type); } }); }; MapMoveCls.prototype._updateMapExtent = function () { var theView = this.map.getView(); this._zoomLevel = theView.getZoom(); var extentArray = theView.calculateExtent(this.map.getSize()); this._mapExtent = { minX: extentArray[0], minY: extentArray[1], maxX: extentArray[2], maxY: extentArray[3] }; }; Object.defineProperty(MapMoveCls.prototype, "mapExtent", { /** * return the map extent */ get: function () { if (!this._mapExtent) { this._updateMapExtent(); } return this._mapExtent; }, enumerable: true, configurable: true }); /** * Trigger the layer load * @param lyr the layer being acted on * @param index index of the layer * @param eventType the event triggering the load, as 'change:center' or 'change:resolution' */ MapMoveCls.prototype.triggerLyrLoad = function (lyr, index, eventType) { if (checkDefined.undefinedOrNull(lyr) && checkDefined.undefinedOrNull(index)) { throw 'need to define lyr or index'; } else if (checkDefined.definedAndNotNull(lyr) && checkDefined.undefinedOrNull(index)) { index = this._arrLayer.indexOf(lyr); } else if (checkDefined.undefinedOrNull(lyr) && checkDefined.definedAndNotNull(index)) { lyr = this._arrLayer[index]; } // clear the timeout if (this._arrLyrTimeout[index] != null) { clearTimeout(this._arrLyrTimeout[index]); this._arrLyrTimeout[index] = null; } // abort if necessary and clear the request if (this._arrLyrRequest[index] != null && this._arrLyrRequest[index] != 4) { this._arrLyrRequest[index].abort(); this._arrLyrRequest[index] = null; } // dummy callback used if before load returns false var callbackFunc = function () { }; if (lyr.mapMoveBefore(this._zoomLevel, eventType)) { lyr.mapMoveMakeGetParams(this._mapExtent, this._zoomLevel); var __this_1 = this; callbackFunc = function () { function innerFunction(theLayer, theIndex) { var _innerThis = this; this._arrLyrRequest[theIndex] = $.get(theLayer.url, theLayer.mapMoveParams, function (d) { /** * @type {LayerBaseVector} */ theLayer.mapMoveCallback(d); theLayer.loadCallback(); }, 'json').fail(function (jqXHR) { if (jqXHR.statusText != 'abort') { console.log('failed'); console.log(theLayer.url); console.log(theLayer.mapMoveParams); } }).always(function () { _innerThis._arrLyrTimeout[theIndex] = null; _innerThis._arrLyrRequest[theIndex] = null; }); } innerFunction.call(__this_1, lyr, index); }; } else { lyr.clear(); } this._arrLyrTimeout[index] = setTimeout(callbackFunc, lyr.onDemandDelay); }; /** * trigger the map move call back at the given index * @param ind - the index of the layer * @param eventType=undefined the event triggering the load as 'change:center' or 'change:resolution' * @param functionId=undefined the function id used to reference the added callback function */ MapMoveCls.prototype.triggerMoveCallback = function (ind, eventType, functionId) { if (typeof ind == 'undefined' && typeof functionId == 'undefined') { throw 'either the function index or the id must be defined'; } if (typeof ind !== 'number') { ind = this._mapMoveCallbacks.indexOf(this._mapMoveCallbacksLookup[functionId]); } if (ind < 0) { console.log('function not found'); return; } // clear the timeout if (this._mapMoveCallbackTimeout[ind] != null) { clearTimeout(this._mapMoveCallbackTimeout[ind]); this._mapMoveCallbackTimeout[ind] = null; } var ctx = this._mapMoveCallbackContext[ind]; var theFunc = this._mapMoveCallbacks[ind]; var __this = this; var f = function () { if (ctx !== null) { theFunc.call(ctx, __this._mapExtent, __this._zoomLevel, eventType); } else { theFunc(__this._mapExtent, __this._zoomLevel, eventType); } }; this._mapMoveCallbackTimeout[ind] = setTimeout(f, this._mapMoveCallbackDelays[ind]); }; /** * Add a layer to the interaction * @param lyr - layer to add * @param triggerOnAdd - if the layer should be loaded on add */ MapMoveCls.prototype.addVectorLayer = function (lyr, triggerOnAdd) { if (triggerOnAdd === void 0) { triggerOnAdd = true; } if (this._arrLayer.indexOf(lyr) > -1) { console.log('already added ' + lyr.name + ' to map move'); return; } this._checkInit(); this._arrLyrRequest.push(null); this._arrLyrTimeout.push(null); this._arrLayer.push(lyr); this._lookupLayer[lyr.id] = lyr; triggerOnAdd = typeof triggerOnAdd == 'boolean' ? triggerOnAdd : true; if (triggerOnAdd) { if (this._mapExtent === undefined) { this._updateMapExtent(); } this.triggerLyrLoad(lyr, this._arrLayer.length - 1); } }; /** * add a callback to the map move event * @param func - callback function * @param context - the context to use for this function * @param delay=50 the delay before call load * @param triggerOnAdd if the layer should be loaded on add to mapMove * @param functionId optional id to reference the function later for outside triggering */ MapMoveCls.prototype.addCallback = function (func, context, delay, triggerOnAdd, functionId) { if (this._mapMoveCallbacks.indexOf(func) > -1) { console.log('this function already added to map move'); return; } this._checkInit(); if (!functionId) { functionId = makeGuid_1.default(); } this._mapMoveCallbacks.push(func); this._mapMoveCallbacksLookup[functionId] = functionId; this._mapMoveCallbackDelays.push(typeof delay == 'number' ? delay : 50); this._mapMoveCallbackContext.push(checkDefined.definedAndNotNull(context) ? context : null); this._mapMoveCallbackTimeout.push(null); triggerOnAdd = typeof triggerOnAdd == 'boolean' ? triggerOnAdd : true; if (triggerOnAdd) { if (this._mapExtent === undefined) { this._updateMapExtent(); } this.triggerMoveCallback(this._mapMoveCallbacks.length - 1); } }; return MapMoveCls; }(mapInteractionBase_1.default)); exports.MapMoveCls = MapMoveCls; nm.MapMoveCls = MapMoveCls; exports.default = MapMoveCls; /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Created by gavorhes on 11/3/2015. */ var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var mapInteractionBase_1 = __webpack_require__(5); var provide_1 = __webpack_require__(0); var ol = __webpack_require__(2); var $ = __webpack_require__(1); var nm = provide_1.default('olHelpers'); var FeatureLayerProperties = (function () { /** * * @param feature the feature * @param layer - the layer in the popup * @param layerIndex - index of the layer * @param selectionLayer - the ol selection layer * @param [esriLayerName=undefined] - esri layer name */ function FeatureLayerProperties(feature, layer, layerIndex, selectionLayer, esriLayerName) { this.feature = feature; this.layer = layer; this.layerIndex = layerIndex; this.selectionLayer = selectionLayer; this.popupContent = ''; this.esriLayerName = typeof esriLayerName == 'string' ? esriLayerName : undefined; } Object.defineProperty(FeatureLayerProperties.prototype, "layerName", { get: function () { if (typeof this.esriLayerName == 'string') { return this.esriLayerName; } else { return this.layer.name; } }, enumerable: true, configurable: true }); return FeatureLayerProperties; }()); exports.FeatureLayerProperties = FeatureLayerProperties; /** * map popup class * @augments MapInteractionBase */ var MapPopupCls = (function (_super) { __extends(MapPopupCls, _super); /** * Definition for openlayers style function * @callback olStyleFunction * ¶m feature the openlayers vector feature * $param */ /** * map popup constructor */ function MapPopupCls() { var _this = _super.call(this, 'map popup') || this; _this._arrPopupLayerIds = []; _this._arrPopupLayerNames = []; _this._arrPopupLayers = []; _this._arrPopupOlLayers = []; _this._arrPopupContentFunction = []; _this._$popupContainer = undefined; _this._$popupContent = undefined; _this._$popupCloser = undefined; _this._popupOverlay = undefined; _this._selectionLayers = []; _this._selectionLayerLookup = {}; _this._mapClickFunctions = []; //let a = function($jqueryContent){console.log($jqueryContent)}; //this._popupChangedLookup = {'a': a}; _this._popupChangedFunctions = []; _this._esriMapServiceLayers = []; _this._popupOpen = false; _this._popupCoordinate = null; _this._passThroughLayerFeatureArray = []; _this._currentPopupIndex = -1; _this._popupContentLength = 0; return _this; } /** * map popup initialization * @param {ol.Map} theMap - the ol map */ MapPopupCls.prototype.init = function (theMap) { var _this = this; _super.prototype.init.call(this, theMap); var $map; var target = this.map.getTarget(); if (typeof target == 'string') { $map = $('#' + target); } else { $map = $(target); } $map.append('<div class="ol-popup">' + '<span class="ol-popup-closer">X</span>' + '<div class="popup-content"></div>' + '</div>'); this._$popupContainer = $map.find('.ol-popup'); this._$popupContent = $map.find('.popup-content'); this._$popupCloser = $map.find('.ol-popup-closer'); var _ease = function (n) { return ol.easing.inAndOut(n); }; this._popupOverlay = new ol.Overlay({ element: this._$popupContainer[0], autoPan: true, autoPanAnimation: { duration: 250, source: theMap.getView().getCenter(), easing: _ease } }); this._map.addOverlay(this._popupOverlay); this._$popupCloser.click(function (evt) { _this.closePopup(); }); // display popup on click this._map.on('singleclick', function (evt) { _this.closePopup(); _this._popupCoordinate = evt['coordinate']; // esri map service layers if (_this._esriMapServiceLayers.length > 0) { var queryParams = { geometry: evt['coordinate'].join(','), geometryType: 'esriGeometryPoint', layers: 'all', sr: _this._map.getView().getProjection().getCode().split(':')[1], mapExtent: _this._map.getView().calculateExtent(_this._map.getSize()).join(','), imageDisplay: _this._map.getSize().join(',') + ',96', returnGeometry: true, tolerance: 15, f: 'pjson' }; for (var _i = 0, _a = _this._esriMapServiceLayers; _i < _a.length; _i++) { var l = _a[_i]; l.getPopupInfo(queryParams); } } var layerFeatureObjectArray = _this._featuresAtPixel(evt['pixel']); _this._passThroughLayerFeatureArray = []; _this._currentPopupIndex = -1; for (var i = 0; i < layerFeatureObjectArray.length; i++) { var featObj = layerFeatureObjectArray[i]; var props = featObj.feature.getProperties(); var popupContentResponse = _this._arrPopupContentFunction[featObj.layerIndex](props, _this._$popupContent); //skip if return was false if (popupContentResponse === false) { //continue; } else if (typeof popupContentResponse == 'string') { featObj.popupContent = popupContentResponse; _this._passThroughLayerFeatureArray.push(featObj); } else { featObj.selectionLayer.getSource().addFeature(featObj.feature); } } _this._popupContentLength = _this._passThroughLayerFeatureArray.length; _this._currentPopupIndex = -1; var popupHtml = '<div class="ol-popup-nav">'; popupHtml += '<span class="previous-popup ol-popup-nav-arrow">◀</span>'; popupHtml += '<span class="next-popup ol-popup-nav-arrow">▶</span>'; popupHtml += "<span class=\"current-popup-item-number\" style=\"font-weight: bold;\"></span>"; popupHtml += "<span> of </span>"; popupHtml += "<span class=\"popup-content-length\" style=\"font-weight: bold;\">" + _this._popupContentLength + "</span>"; popupHtml += "<span> - </span>"; popupHtml += "<span class=\"current-popup-layer-name\"></span>"; popupHtml += '</div>'; popupHtml += '<div class="ol-popup-inner">'; popupHtml += '</div>'; _this._$popupContent.html(popupHtml); _this._$popupContent.find('.previous-popup').click(function () { if (_this._popupContentLength == 1) { return; } if (_this._currentPopupIndex == 0) { _this._currentPopupIndex = _this._popupContentLength - 1; } else { _this._currentPopupIndex--; } _this._triggerFeatSelect(); }); var nextPopup = _this._$popupContent.find('.next-popup'); nextPopup.click(function () { if (_this._popupContentLength == 1 && _this._currentPopupIndex > -1) { return; } if (_this._currentPopupIndex == _this._popupContentLength - 1) { _this._currentPopupIndex = 0; } else { _this._currentPopupIndex++; } _this._triggerFeatSelect(); }); if (_this._popupContentLength > 0) { nextPopup.trigger('click'); _this._popupOverlay.setPosition(_this._popupCoordinate); _this._$popupContent.scrollTop(0); _this._popupOpen = true; } }); //change mouse cursor when over marker this._map.on('pointermove', function (evt) { if (evt['dragging']) { return; } var pixel = _this.map.getEventPixel(evt['originalEvent']); var hit = _this.map.hasFeatureAtPixel(pixel, function (lyrCandidate) { for (var _i = 0, _a = _this._arrPopupOlLayers; _i < _a.length; _i++) { var olLayer = _a[_i]; if (lyrCandidate == olLayer) { return true; } } return false; }); var mapElement = _this.map.getTargetElement(); mapElement.style.cursor = hit ? 'pointer' : ''; }); return true; }; /** * helper to select features * @private */ MapPopupCls.prototype._triggerFeatSelect = function () { var $currentPopupItemNumber = this._$popupContent.find('.current-popup-item-number'); var $innerPopup = this._$popupContent.find('.ol-popup-inner'); var $layerNameSpan = this._$popupContent.find('.current-popup-layer-name'); this.clearSelection(); var lyrFeatObj = this._passThroughLayerFeatureArray[this._currentPopupIndex]; $currentPopupItemNumber.html((this._currentPopupIndex + 1).toFixed()); $layerNameSpan.html(lyrFeatObj.layerName); $innerPopup.html(lyrFeatObj.popupContent); lyrFeatObj.selectionLayer.getSource().addFeature(lyrFeatObj.feature); for (var _i = 0, _a = this._popupChangedFunctions; _i < _a.length; _i++) { var f = _a[_i]; f(this._$popupContent); } }; /** * * @param feature - the ol feature * @param {LayerEsriMapServer} lyr - the map server layer * @param {string} popupContent - popup content * @param {string} esriName - esri layer name */ MapPopupCls.prototype.addMapServicePopupContent = function (feature, lyr, popupContent, esriName) { var featLayerObject = new FeatureLayerProperties(feature, lyr, this._popupContentLength, this._selectionLayerLookup[lyr.id], esriName); featLayerObject.popupContent = popupContent; this._passThroughLayerFeatureArray.push(featLayerObject); this._popupContentLength++; $('.popup-content-length').html(this._popupContentLength.toFixed()); if (!this._popupOpen) { this._$popupContent.find('.next-popup').trigger('click'); this._popupOverlay.setPosition(this._popupCoordinate); this._$popupContent.scrollTop(0); this._popupOpen = true; } }; /** * * @param pixel - the ol pixel * @returns feature layer properties * @private */ MapPopupCls.prototype._featuresAtPixel = function (pixel) { var _this = this; var layerFeatureObjectArray = []; this.map.forEachFeatureAtPixel(pixel, function (feature, layer) { var lyrIndex = _this._arrPopupOlLayers.indexOf(layer); if (lyrIndex > -1) { layerFeatureObjectArray.push(new FeatureLayerProperties(feature, _this._arrPopupLayers[lyrIndex], lyrIndex, _this._selectionLayers[lyrIndex])); } }); return layerFeatureObjectArray; }; MapPopupCls.prototype.closePopup = function () { this._checkInit(); this._popupOpen = false; this._popupOverlay.setPosition(undefined); this._$popupCloser[0].blur(); this.clearSelection(); this._$popupContent.html(''); return false; }; ; /** * * @param chgFunction - popup change function */ MapPopupCls.prototype.addPopupChangedFunction = function (chgFunction) { this._popupChangedFunctions.push(chgFunction); }; /** * * @param {LayerBase|*} lyr - the layer being acted on * @param {object} [selectionStyle={}] the selection style configuration * @param {string} [selectionStyle.color=rgba(255,170,0,0.5)] the selection color * @param {number} [selectionStyle.width=10] the selection width for linear features * @param {object|function} [selectionStyle.olStyle=undefined] an openlayers style object or function * @returns the new selection layer * @private */ MapPopupCls.prototype._addPopupLayer = function (lyr, selectionStyle) { this._checkInit(); selectionStyle = selectionStyle || {}; selectionStyle.color = selectionStyle.color || 'rgba(255,170,0,0.5)'; selectionStyle.width = selectionStyle.width || 10; var theStyle; if (selectionStyle.olStyle) { theStyle = selectionStyle.olStyle; } else { theStyle = new ol.style.Style({ stroke: new ol.style.Stroke({ color: selectionStyle.color, width: selectionStyle.width }), image: new ol.style.Circle({ radius: 7, fill: new ol.style.Fill({ color: selectionStyle.color }), stroke: new ol.style.Stroke({ color: selectionStyle.color, width: 1 }) }), fill: new ol.style.Fill({ color: selectionStyle.color }) }); } var selectionLayer = new ol.layer.Vector({ source: new ol.source.Vector(), style: theStyle }); selectionLayer.setZIndex(100); this._selectionLayers.push(selectionLayer); this._selectionLayerLookup[lyr.id] = selectionLayer; this.map.addLayer(selectionLayer); return selectionLayer; }; /** * Add popup to the map * @param {LayerBase|*} lyr The layer that the popup with act on * @param {popupCallback} popupContentFunction - popup content function that makes popup info * @param {object} [selectionStyle={}] the selection style configuration * @param {string} [selectionStyle.color=rgba(255,170,0,0.5)] the selection color * @param {number} [selectionStyle.width=10] the selection width for linear features * @param {object|function} [selectionStyle.olStyle=undefined] an openlayers style object or function * @returns {object} a reference to the ol selection layer */ MapPopupCls.prototype.addVectorPopup = function (lyr, popupContentFunction, selectionStyle) { var selectionLayer = this._addPopupLayer(lyr, selectionStyle); this._arrPopupLayerIds.push(lyr.id); this._arrPopupLayerNames.push(lyr.name); this._arrPopupLayers.push(lyr); this._arrPopupOlLayers.push(lyr.olLayer); this._arrPopupContentFunction.push(popupContentFunction); return selectionLayer; }; ; /** * * @param {LayerBase} lyr - layer */ MapPopupCls.prototype.removeVectorPopup = function (lyr) { var idx = this._arrPopupLayerIds.indexOf(lyr.id); if (idx > -1) { this._arrPopupLayerIds.splice(idx, 1); this._arrPopupLayerNames.splice(idx, 1); this._arrPopupLayers.splice(idx, 1); this._arrPopupOlLayers.splice(idx, 1); this._arrPopupContentFunction.splice(idx, 1); this._selectionLayers.splice(idx, 1); delete this._selectionLayerLookup[lyr.id]; } }; /** * * @param {LayerEsriMapServer} lyr - map server layer * @param {object} [selectionStyle={}] the selection style configuration * @param {string} [selectionStyle.color=rgba(255,170,0,0.5)] the selection color * @param {number} [selectionStyle.width=10] the selection width for linear features * @param {object|function} [selectionStyle.olStyle=undefined] an openlayers style object or function * @returns {object} a reference to the ol selection layer */ MapPopupCls.prototype.addMapServicePopup = function (lyr, selectionStyle) { var selectionLayer = this._addPopupLayer(lyr, selectionStyle); this._esriMapServiceLayers.push(lyr); return selectionLayer; }; MapPopupCls.prototype.clearSelection = function () { this._checkInit(); for (var i = 0; i < this._selectionLayers.length; i++) { this._selectionLayers[i].getSource().clear(); } for (var _i = 0, _a = this._mapClickFunctions; _i < _a.length; _i++) { var f = _a[_i]; f(); } }; ; /** * Add a function to be called when the map is clicked but before any popups are implemented * @param {function} func - the map click function */ MapPopupCls.prototype.addMapClickFunction = function (func) { this._mapClickFunctions.push(func); }; return MapPopupCls; }(mapInteractionBase_1.default)); exports.MapPopupCls = MapPopupCls; nm.MapPopupCls = MapPopupCls; exports.default = MapPopupCls; /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Created by gavorhes on 12/15/2015. */ Object.defineProperty(exports, "__esModule", { value: true }); var provide_1 = __webpack_require__(0); var ol = __webpack_require__(2); var $ = __webpack_require__(1); var nm = provide_1.default('olHelpers'); /** * Sets up a map with some default parameters and initializes * mapMove and mapPopup * * @param [options={}] config options * @param [options.divId=map] map div id * @param [options.center={}] center config object * @param [options.center.x=-10018378] center x, web mercator x or lon * @param [options.center.y=5574910] center y, web mercator y or lat * @param [options.zoom=7] zoom level * @param [options.minZoom=undefined] min zoom * @param [options.maxZoom=undefined] max zoom * @param [options.baseSwitcher=true] if add base map switcher * @param [options.fullScreen=false] if add base map switcher * @returns the ol map */ function quickMapBase(options) { options = options || {}; options.divId = options.divId || 'map'; options.center = options.center || { x: -10018378, y: 5574910 }; options.zoom = typeof options.zoom == 'number' ? options.zoom : 7; options.baseSwitcher = typeof options.baseSwitcher == 'boolean' ? options.baseSwitcher : true; options.fullScreen = typeof options.fullScreen == 'boolean' ? options.fullScreen : false; var $mapDiv = $('#' + options.divId); $mapDiv.css('position', 'relative'); var osmLayer = new ol.layer.Tile({ source: new ol.source.OSM() }); // let satLayer = new ol.layer.Tile({visible: false, source: new ol.source.MapQuest({layer: 'sat'})}); var osmCss = "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQAAADQ1NDk5OURFREtLS1FHSFlZWGJRVGJiYWdmZWxsbHRmaXBpanN0c3V0dHp5eX5+fIVzd4F3eeV0jud5juZ8k4aHhomHhoyGh5eGj5OVlJiVlZiYl5qZmJydnKOTlaKZmqKdnaOioaqqqKuzsbOvrrSysLa3tbW4uLm6ub27ub+/vbGXwbCZwbCgxLKlxrOqyLStybO3yrSxyrWzzbW2y7a1zbK4y7W6zbW8y760yrTAzbTFzrPKzrLOzrTJzrTOzr7CwbXC0LXK0LTO0L3I0bPQz7TQz7PS0bXQ0LnR0brW1bzT0r7U077V1Lzc2dqNqteUsdyXscaquuOHneaGmueHnOeJnuiBleiKn+eNoOiOoOWUpOiRo+iSpeiUpeqYpumaqOmdrPSynemgruSqtOmisOmlsuuqtequuOW1vOuxu+uxvOq1ve+xvPK0pvW3o/W5pfO5qvS7qfCwvMOuwc2/wNenxNyyzNe/0Nq31Nq51dy72Oy3wOu4wOu+xey4wO+6xO2+xfTAr/TCsvfFtPHLvvTJuMPDwMfHxcXKyc3DxMvFyMvLyM3PzcDV08DV1MTX1cbY1s7X1sjZ1sra2Mnd3M7b2c7c2tfH1tnB1t7F2d7M29fX1tLY1tDd2tHe3NTf3NnS19rZ1tva2Nnf3t3d28rh3tXg3Nnh3tzj393k39ni4N7k4N7n5uXDyOfLz+zAxu3CyOzEyezKzeDJ3eLM3uvP0u3P0ePf2+7R0u7Q1u/U0+7U1ezc0+7a2e/d2+3f3vbFzvLOwfHN0PPQw/TUx/LWyvLYzPDQ1fPe0ubc4vve4uHh3+nh3+/h2u/h3vHj2vHl3uHm4eTn4uDp5ebo4+Xo5ODq6ebq6OTv6+nl4+/j4O7l4e7n5ujp4+np5Ozq5e7s5urt6O7t6Orw6u7x6u3x7vPj5PDl4fDo4vDq5fDt5vDu6PDv7PTv6fDx6vHx7fH17fXw6fXy7fb07/bz8fT18vn38vr39fr48/r59Pr6+P3++//+/gAAALNTSk0AAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGHRFWHRTb2Z0d2FyZQBwYWludC5uZXQgNC4wLjlsM35OAAAFNElEQVRIS1VVCZxVUxi/9l0UIUT2bMnY43bVI2c0Y01kSWIaS0j2JEtkN41piomZrPPKQ2aQ7JKImOZlnm2493TJzDufuU1Zi+v/fee+mZ//793vnPOd7zvfes5zDBEZkBBjAcIjb+Iiotqgdhat8AMK0vl7/R9N7GiWtshqIr+EZ5gYKibyUsXY1l/mfFpssvUlWQ0FkU3gy4+RB/+kwYcO8pRSnldcOU/r2lAHARSwk2ORgEmOdC1EsuRiYSqMPwwroMIraZk5V2fYJQjCKfZrRmh3gSAZi2i4b7wSylWu8EqZwS59JkFUaW96JbNSc+CEUmt4rorwuZmWdDaoc+uZETuQlTCU5xYzR7muUnVUVo+BcRhre/VwUpasgJwhH7JkYIYA0sNxhmCwUK+lw6vCKBZehw01dEiyw4Q4aE0Z4ahDhKaFQsGnJ2BgqKoTBsNjFy0SlW6whRAZTdm8DBJmkBZhDi1j4xJQBk6ywrWUTymaCxac8lROcdauRGzQSNtA7EHUYhXyEwhhgjFUqRuO+rauhF1awFpzCsmwUbjIFBR0u1bKtyGpulW/H/cVVzkyGaIWTIR9pFAV6GK2gPMXMX8gPk9zzxXgI1kimcAltEYr+cjio1imlKpEa9rOipLm+p+CZ6Bw//qd1/f/O+GwMxbSLpyoZEcwkyh2jIks+3hmdd2jWUw4scxNysnHxU7nSspTRcJjCZGL3IsjsYJMMg5mwgx7gaIOLBFCogAgBBoNa9w+DE6I+Bs7FTgwwrJbHjWDgpYo2KwtBTcYEDuloC9geQw+k2RGnPGpTaOlq7AS+YICUz4DZVaX2TiNDhuYfTtY4geLi0IoCm3XccwM9hx4kU28StQEljDs3ZEpFGA+8dKzLmV9ymIwF5FOGn2GdJM8KLHDJbXyiYVMG9MRTLiXGGg2QKaxM3khPSRrwM9zEIardxU2w/EiA0gOeYKHzDR0V7/QGV3lKIA9ktrDArxO3gdA+k6SKoBiVwcm7NjZb9+Hnztg282TuHVZ9LOISFNt9MgyCetZVczSxnyDbl17Penq6mqpg1IhRaEO2aVLUO4/r17H8tTv6f13h71dduvZI3Y+uMdWksNSauLovJw5hsqiPIUvt0ku7/iBeUR3sksmomYWtRbAjbiLfv2lX9/V7LVG4uYnUZXhQ7f2OPCZEx9wrYWTcePEQqPEML8pl4mMdr/jlXlvHiRiJ2+MSTFY4TTSYStuvz2R/JXh+PPeGXm055J+3/YDWuNu3R3DArPutyg0ZgykMVDU9Ndm22+wYalr2rse48CnsTIFcMn73vfhNrktx1EUcZnPv6ah3Yy5cDTRdBEoGoBeah71dqFyjZDJLkWk3N3v4uuktssjWpzciMPxQeHj8nMKzcGuB0tAyzFhdCKOYWv4HwOQVwIxLG99a6uvH3sJCyO3h+k4EZ+G7+xj5f4XXksoaGrdMRzSc8ARA8+cdOuk2x6fffNNt5x+Ro1omPlrT/CQDlcNlpx4NBIWXhkx7Y3Zp3ofNR7Uv89Om/beW0TLIynHv3vs1VsOFpSWSXvfuPUf9BrRFyxgXdHoKJnQFegPOovvzz59ntrzye240ig8UQ3lDI2VqwagrKIQcLXNFL3wglN2OHdBQ6/vI3kENDVBwRb3k1XtczFbjWn4EzMYi7CF3129+JTYuRSdrGuS92g5dpqn6qXoJQs5xmL8p+Wt4hLbt0mx2OLNZR2bbPy8zJNQGFM/f/CfXZekRYFjGCWjIJpM+WiCzGBPWHhoyaAsjRT/B2Gy5yzYJkwUAAAAAElFTkSuQmCC')"; var aerialCss = "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQALBgIMDQgOBwQOEQcTBwUSCwoVDAwdBw8ZDgUREwYUGAYZFQYZGgkTFQoVGQsZFAwZHBMeDhIbFBEbHAwWIA4bIREcIQ4hCQwjFw4lHBgkDB8sDxUiExIiGhAoGxohFRshGRorHQcrKQsiIQwmKgooJA0pKQ81Jw8yLRMiIxImKxUrJREuKhslJB0rIhooKRUuMBMyLhkwJhozKh48LxUzMRM9MBwzMiUvFCMtGiMwEiwzFCgzHDI+GSIsISkvJSQxIiM2LiY5Jic+Lyk0JSo0Ky49JSs9KSU1NSM7NCs2NS8+NDM1JzU9Ljg7IDJCHS1DLSNAMitCMSxIOjREITZLIDZJKDlFIjpFKztKJT1LKzJBMzpHMD1JMjpKPD1RKjlQNC1DQj5QQEA8MEJGJkBKJUJNK0lLLEJMMkVMPEpONENSLUdZL0pTLkpaLkRUMkRSPEVZMktUM0pVOklZMklZNEpcNU1ZMk1ZNUxfMk5dNkxcOVFUM1RUOFJbNVFZOVNYPVFdOVJdPFVaOVVaPVVdOlVdPVpaNlpdO0phN01hOlBiN1NhPFNoP1piPWFbPmRjPENOQEtPSURTQkJVS0xVQk1VSkxbQkxcS0heUVFXRFRcQlJfTFxeQlpeS05lQk1kSFRjQVRjSlZpQ1tkQlxlSlxpRF1rSVVnUVtlU1llXF9tU1xoXlxwSl9ramRfQmJlQ2FhSWFlSWFlTmVlSWRmTGFoQWFpRWFsRmVpRWVtRmNsSmtlRGpqRmpsS2BmWGRsUmFrW2ptUmZyR2RxTGpxTWVyU2RyW2d5V2tzUmt0WW15VG15WXFuTHNtVnFxTXF4T3h0TnJzUnJ1XHJ4VXN6Wnp0VHx1W315VXp8XGR0YGx0YHVzZXJ0aHR9ZXV+aHl9YHOCXXqBXXeCYHyCY3iEaHyIYn+JaXqKcYB5WIN6Y4SCXoCDZIGEaYCIZoOLa4iCaImJbIOOdYuMco6OeIuVcpOKbZKPc5aQb5eXe5ufg6KjhAAAAAAAAAAAAAAAAOGCeQgAAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGHRFWHRTb2Z0d2FyZQBwYWludC5uZXQgNC4wLjlsM35OAAAH80lEQVRISy1WbXQUVxm+6wqnk3Zmpxl2FG2EGg92C8GDlWptVTwa+uF3xcKmDfFzCUzDsJNsunXipglJXJbrtJWmwZNSnHD3jojRgUIm2UumIZ0JZ7JByrALbMWW0IBW8aRa4+cf76TeX3Nm3uc+z/s+7/vugl4r/aMTrT4e1pPTqnnmJNn5AyUzRnrRle/qE33dsvrBtAQVoxtpZNK3zSzYjUjviWO2Ag+R77dl7W36n/1Ep9KBPG/S+Py0PkjU/gPKQGqwTHryiWYFAXSvMairsio7SjyNsnCzh0qKImV9/7mhfHQZx2yN1O+7rXUm33MUPaboOkAJHaoIdXfJj2xWeyD8jMFEXkvIu5qzpU988gWB5zl+GS+sFe55trEVPdWZB2miq8bBVkNFO2R0qnrfkiXhcJhtDNXE6tbW97/s9O9/7ZfVhx86/CwrROpfvvxboMqeLsuqPr1j44qEwDNMOBximUiYoU8sw7BC/a7T72uEnyJDlGxZ9KcglZRyuqqrv/tSZErgOI4NgRBTIw9EmHAoFGZZnp6aGaJ2GTxfxYs8kKVUQh7WB5hQeC3LsUxoxVKW14l3BX2WcoUYPiZyLLe8teZ+iuT4GGhvV5KpKWkpyzxEr2MZgQ1xdRjfRBoH+2k6lIHjKTHPPBo8CSJISqqq4wGGOcWylIGlgvgNX1Gd8vF5f+IUIwb30ng+Gg2QfBRIMvy0jG8SVkYo4N0zvUXVRztbJ/L6xL7lUZEXBEHkuZqlS6gEAUgKJurnhFtfpACOYd8b/hVbJPqwi44a6KA0sPVjIi/SIyxb3u8KlAJ0S8jRVgrlW+nVHPdrhiXCxu42d86ByksDc80P3MkJFBFQ8Ho1lQegpWJRWFGsDsRwwv7pIyvuQW0ZkrX6NDVFbqcvaQI8vbyqzt5AARrsbKx5yhQEGs+wPO56bOK+0rcwMrOKkpUbZWYxV04UeZZv/cBKFhRL6Qdv9y4LfEDA7/thg7tTmv1a5/GnO0wl0dQg80wglZaHUmxRvjwAHOfyN0mxrpqLUpcjsK3NHYMo4R1o6eho2ZyIb2FoeOC3ILK8kZ2HQMOuWywGXUkJBCeTbYFS0+ym1h2/6UgmvnrvKYZZtIEXGf75C2cIAp5LHNd71x7uPoTjakrWH9e3KFpaatjUvJUysFw0KrLMYMW2lTg4PeUQx6kJEALvxXEmCdVyPLHtCSjBhc01XCjIgafxou+PE6KC1dhxSCwoBCc+N4P3btM84pmdSSjJnjO/nvY4LQfVyz5/I+v6IwjUOMjy+MVCxIbKupTJaEktp7cTKU42Pvjh2m/8cSpC6aPsaX/MHSuUQLVVsIa4RUTs/r/BVAexNdjdnsNG7j/rV93xheLMzKnFrPeTEQchCyCcKb25aAIn7lrAertrZwyNXM8N6zfWrFo3d2SmOEcF83x/r+OOFgrAHYWF7cELjhV7UQo/6WAIUVl9JFl8a//HZ66VpbY3I9QKZqPru77lA+iOWAIr0hKxHCmmr0othSyeIl5y3qt4xT8gSNrKEZozs8Els67rgsLOZ+ygzwMfbtNhobfgzpEyGnz7htPtzUi6PuOoj7K0WF/MXiUFxwGajRD1hjYXHXI9p406qOyinp5/tiWcDHY0jIu4n64Qfq7kliB2gemag9QbOia0PbbDMbd43SHuvxFxrAocxins7MX5Kqbe1QixKBxoV4//PfAgGCu+Rlm4SvZizyDH+0reDHp92iO0BuX3bCfItl0PEwvYLqpwXG2MHlGsQ4S8pMJZv1JGmHiEoHQDdOjwmVlEP/nE9ADKjI8xLI0OOGITfy0SbeG/C2jKUDGSlDhM9I3IpK9iup6XnbRNC7yqueNsJCCIiXzdQhnaGN+46umnEdy5U5UbUJ48LFM9GkJo8BdDOiAZ7ZIQbKhYLMqvhU2wmNxjEAsS2AI7y4nWF64duePbk7YV3zvAVLEMD9AxJRNa3KDUibV7DjnkuprMEYjScFNcaR2ceP2u9R/5k1052Ryme5phAFRswlHjAudiP4dOy7CaxLgdJh9vUlU1702/+LPa1U9fvPi9qlA4XEUBJc3dFlpsR457IDl1iPqLp7o81NQgyV19iYU38uTiv975Pd3SiwQcsGjx+v4/6fl5T7EOOMTCtpbKxfemsQq/3olQZcminADAAI0cuGLHaHOFxbuGvRk/Z9u7CULqoVR6NE0yx1avj30oRhc/jWUoIALGxkz0dg1Dl9iaI7LqOOXKsXJFwjiuEAi70Jra2nW1PL08zLBhZsMABpW5csI7TPfew9ipFKcn5k1i+1KyCWKjC3W/8dF1d666+RaabBVTFTHacjoojBNDh0NDxk+IPTlwfqJkWpbnpFHXIbLbmpxEQ3ff/Z0g/mauXsoln9wDRjy/NHsQFw3P6vWuTJ43/+FZrk2cvAFRipCKdfD9y2+pjRj78s0KdCUDKJvdV91ChngV38T20TM+gghjpJaPlpFr2xbEz5g4A/NGt5rNwdwmYGeeeMXBSLHHUIc+6RsojRH9VTUm3/mLf/64b470XvoxoTKhlMBQ2jMEzo2PjxdGMppmn1RM24bWFJqaQv4BcuJa2Sam7Zokq1ldCsz06NCBHrhwqVQYpfFj42NZexz1EW9SR/kT58nEeQKJb2fPXjjp0u/YUkwHEgLeOnf2nOuf1TRTM02CLKLTPy60/x1CCztqn7Ev+BdsC3m+30decQvW/wBNTwU+CfUQAQAAAABJRU5ErkJggg==')"; if (options.baseSwitcher) { // let switcherContent = '<div class="base-map-switcher" title="Toggle Base Layer" style="'; // switcherContent += 'position: absolute; top: 70px; left: 4px; border: solid black 1px; '; // switcherContent += `height: 50px; width: 50px; z-index: 10; border-radius: 4px; background: ${aerialCss};`; // switcherContent += '"></div>'; // $mapDiv.append(switcherContent); // // $mapDiv.find('.base-map-switcher').click(function() { // "use strict"; // osmLayer.setVisible(!osmLayer.getVisible()); // satLayer.setVisible(!satLayer.getVisible()); // // if (osmLayer.getVisible()){ // $(this).css('background', aerialCss); // } else { // $(this).css('background', osmCss); // } // }); } if (options.zoom < 0 || options.zoom > 28) { throw 'zoom out of range'; } if (options.center.x >= -180 && options.center.x <= 180 && options.center.y >= -90 && options.center.y <= 90) { var p = new ol.geom.Point([options.center.x, options.center.y]); new ol.proj.Projection({ code: "EPSG:4326" }); p.transform(new ol.proj.Projection({ code: "EPSG:4326" }), new ol.proj.Projection({ code: "EPSG:3857" })); var coordinates = p.getCoordinates(); options.center.x = coordinates[0]; options.center.y = coordinates[1]; } var controls = ol.control.defaults({ attributionOptions: { collapsible: false } }); var view = new ol.View({ center: [options.center.x, options.center.y], zoom: options.zoom, minZoom: options.minZoom, maxZoom: options.maxZoom }); var map = new ol.Map({ layers: [osmLayer], target: options.divId, controls: controls, view: view }); if (options.fullScreen) { map.addControl(new ol.control.FullScreen({})); } return map; } exports.quickMapBase = quickMapBase; nm.quickMapBase = quickMapBase; exports.default = quickMapBase; /***/ }), /* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Created by gavorhes on 12/14/2015. */ Object.defineProperty(exports, "__esModule", { value: true }); var provide_1 = __webpack_require__(0); var nm = provide_1.default('olHelpers.zoomResolutionConvert'); var _zoomResLookup = [ 156543.03392804097, 78271.51696402048, 39135.75848201024, 19567.87924100512, 9783.93962050256, 4891.96981025128, 2445.98490512564, 1222.99245256282, 611.49622628141, 305.748113140705, 152.8740565703525, 76.43702828517625, 38.21851414258813, 19.109257071294063, 9.554628535647032, 4.777314267823516, 2.388657133911758, 1.194328566955879, 0.5971642834779395, 0.29858214173896974, 0.14929107086948487, 0.07464553543474244, 0.03732276771737122, 0.01866138385868561, 0.009330691929342804, 0.004665345964671402, 0.002332672982335701, 0.0011663364911678506, 0.0005831682455839253 //28 ]; /** * Get the resolution given the zoom level * @param {number} zoomLevel - the zoom level * @returns {number|*} the map resolution */ function zoomToResolution(zoomLevel) { "use strict"; if (typeof zoomLevel == 'number') { if (zoomLevel % 1 === 0 && zoomLevel >= 0 && zoomLevel <= 28) { return _zoomResLookup[zoomLevel]; } else { console.log("invalid zoom level provided: " + zoomLevel); return undefined; } } else { return undefined; } } exports.zoomToResolution = zoomToResolution; nm.zoomToResolution = zoomToResolution; /** * Get resolution from the zoom level * @param {number} resolution - the resolution * @returns {number|*} the zoom level */ function resolutionToZoom(resolution) { for (var i = 0; i < _zoomResLookup.length; i++) { if (resolution >= _zoomResLookup[i]) { return i; } } return 0; } exports.resolutionToZoom = resolutionToZoom; nm.resolutionToZoom = resolutionToZoom; /***/ }), /* 15 */ /***/ (function(module, exports) { module.exports = jquery-ui; /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); /** * Created by gavorhes on 1/4/2016. */ var provide_1 = __webpack_require__(0); var ol = __webpack_require__(2); var nm = provide_1.default('olHelpers.esriToOlStyle'); /** * This callback is displayed as part of the Requester class. * @callback styleFunc * @param {ol.Feature} feat - openlayers feature * @param {number} resolution - map resolution */ /** * * @param {Array<number>} colorArray - input color array * @param {number} opacity - the opacity 0 to 1 * @returns {string} rgba string * @private */ function _colorArrayToRgba(colorArray, opacity) { "use strict"; return "rgba(" + colorArray[0] + "," + colorArray[1] + "," + colorArray[2] + "," + opacity + ")"; } /** * escape html charcters * @param {string} str - input string * @returns {string} escaped string */ function htmlEscape(str) { return String(str) .replace(/&/g, '&') .replace(/"/g, '"') .replace(/'/g, ''') .replace(/</g, '<') .replace(/>/g, '>'); } nm.htmlEscape = htmlEscape; var CommonSymbol = (function () { /** * * @param symbolObj * @param {number} opacity */ function CommonSymbol(symbolObj, opacity) { this.symbolObj = symbolObj; this.opacity = opacity; this.olStyle = undefined; this.legendHtml = ''; } return CommonSymbol; }()); var PointSymbol = (function (_super) { __extends(PointSymbol, _super); function PointSymbol(symbolObj, opacity) { var _this = _super.call(this, symbolObj, opacity) || this; switch (_this.symbolObj.type) { case 'esriSMS': var innerColor = _colorArrayToRgba(_this.symbolObj.color, _this.opacity); var outerColor = _colorArrayToRgba(_this.symbolObj.outline.color, _this.opacity); var outlineWidth = _this.symbolObj.outline.width; var radius = _this.symbolObj.size; _this.olStyle = new ol.style.Style({ image: new ol.style.Circle({ radius: radius, fill: new ol.style.Fill({ color: innerColor }), stroke: new ol.style.Stroke({ color: outerColor, width: outlineWidth }) }) }); _this.legendHtml = "<span class=\"legend-layer-icon\" style=\"color: " + innerColor + "\">●</span>"; break; case 'esriPMS': _this.olStyle = new ol.style.Style({ image: new ol.style.Icon({ src: "data:image/png;base64," + _this.symbolObj['imageData'] }) }); _this.legendHtml = "<img class=\"legend-layer-icon\" height=\"17\" src=\"data:image/png;base64," + _this.symbolObj['imageData'] + "\">"; break; default: console.log(_this.symbolObj); alert('Point symbol does not handle symbol type: ' + _this.symbolObj['type']); } return _this; } return PointSymbol; }(CommonSymbol)); var LineSymbol = (function (_super) { __extends(LineSymbol, _super); function LineSymbol(symbolObj, opacity) { var _this = _super.call(this, symbolObj, opacity) || this; switch (_this.symbolObj.type) { case 'esriSLS': var innerColor = _colorArrayToRgba(_this.symbolObj.color, _this.opacity); var lineWidth = _this.symbolObj.width; _this.olStyle = new ol.style.Style({ stroke: new ol.style.Stroke({ color: innerColor, //lineDash: [4], width: lineWidth }) }); _this.legendHtml = "<span class=\"legend-layer-icon\" "; _this.legendHtml += "style=\""; _this.legendHtml += "background-color: " + innerColor + ";"; _this.legendHtml += "width: 40px;"; _this.legendHtml += "height: 4px;"; _this.legendHtml += "position: relative;"; _this.legendHtml += "display: inline-block;"; _this.legendHtml += "top: -1px;"; _this.legendHtml += "\"></span>"; break; default: console.log(_this.symbolObj); alert('Line symbol does not handle symbol type: ' + _this.symbolObj['type']); } return _this; } return LineSymbol; }(CommonSymbol)); var PolygonSymbol = (function (_super) { __extends(PolygonSymbol, _super); function PolygonSymbol(symbolObj, opacity) { var _this = _super.call(this, symbolObj, opacity) || this; switch (_this.symbolObj['type']) { case 'esriSFS': var innerColor = _colorArrayToRgba(_this.symbolObj.color, _this.opacity); var outerColor = _colorArrayToRgba(_this.symbolObj.outline.color, _this.opacity); var outlineWidth = _this.symbolObj.outline.width; _this.olStyle = new ol.style.Style({ stroke: new ol.style.Stroke({ color: outerColor, //lineDash: [4], width: outlineWidth }), fill: new ol.style.Fill({ color: innerColor }) }); _this.legendHtml = "<span class=\"legend-layer-icon\" "; _this.legendHtml += "style=\""; _this.legendHtml += "background-color: " + innerColor + ";"; _this.legendHtml += "border: solid " + outerColor + " 1px;"; _this.legendHtml += "width: 40px;"; _this.legendHtml += "height: 9px;"; _this.legendHtml += "position: relative;"; _this.legendHtml += "display: inline-block;"; _this.legendHtml += "top: 2px;"; _this.legendHtml += "\"></span>"; break; default: console.log(_this.symbolObj); alert('Polygon symbol does handle symbol type: ' + _this.symbolObj['type']); } return _this; } return PolygonSymbol; }(CommonSymbol)); var SymbolGenerator = (function () { function SymbolGenerator(esriResponse) { this.opacity = (100 - (esriResponse['drawingInfo']['transparency'] || 0)) / 100; this.renderer = esriResponse.drawingInfo.renderer; this.olStyle = undefined; this.legendHtml = ''; } return SymbolGenerator; }()); var SingleSymbol = (function (_super) { __extends(SingleSymbol, _super); /** * * @param {object} esriResponse - layer info * @param SymbolClass - the symbol class to use */ function SingleSymbol(esriResponse, SymbolClass) { var _this = _super.call(this, esriResponse) || this; _this.symbol = _this.renderer.symbol; var symbolObj = new SymbolClass(_this.symbol, _this.opacity); _this.olStyle = symbolObj.olStyle; _this.legendHtml = symbolObj.legendHtml; return _this; } return SingleSymbol; }(SymbolGenerator)); var UniqueValueSymbol = (function (_super) { __extends(UniqueValueSymbol, _super); /** * * @param {object} esriResponse - layer info * @param SymbolClass - the Symbol class definition */ function UniqueValueSymbol(esriResponse, SymbolClass) { var _this = _super.call(this, esriResponse) || this; _this.uniqueValueInfos = _this.renderer['uniqueValueInfos']; _this.propertyName = _this.renderer['field1']; _this.defaultSymbol = _this.renderer['defaultSymbol']; if (_this.defaultSymbol) { var symbolObj = new SymbolClass(_this.defaultSymbol, _this.opacity); _this.defaultStyle = symbolObj.olStyle; _this.defaultLabelHtml = "<span class=\"legend-layer-subitem\">" + htmlEscape(_this.renderer['defaultLabel']) + "</span>" + symbolObj.legendHtml; } else { _this.defaultStyle = undefined; _this.defaultLabelHtml = 'other'; } _this.valueArray = []; _this.labelArray = []; _this.legendArray = []; _this.propertyStyleLookup = {}; for (var _i = 0, _a = _this.uniqueValueInfos; _i < _a.length; _i++) { var uniqueVal = _a[_i]; _this.labelArray.push(uniqueVal['label']); _this.valueArray.push(uniqueVal['value']); var uniqueSym = new SymbolClass(uniqueVal.symbol, _this.opacity); _this.legendArray.push("<span class=\"legend-layer-subitem\">" + htmlEscape(uniqueVal['label']) + "</span>" + uniqueSym.legendHtml); _this.propertyStyleLookup[uniqueVal['value']] = uniqueSym.olStyle; } _this.olStyle = function (feature) { var checkProperties = feature.getProperties(); var checkProperty = checkProperties[_this.propertyName]; var returnValue; if (_this.propertyStyleLookup[checkProperty] !== undefined) { returnValue = [_this.propertyStyleLookup[checkProperty]]; } else { returnValue = [_this.defaultStyle]; } return returnValue; }; if (_this.defaultLabelHtml !== null) { _this.legendArray.push(_this.defaultLabelHtml); } _this.legendHtml = '<ul>'; for (var _b = 0, _c = _this.legendArray; _b < _c.length; _b++) { var h = _c[_b]; _this.legendHtml += "<li>" + h + "</li>"; } _this.legendHtml += '</ul>'; return _this; } return UniqueValueSymbol; }(SymbolGenerator)); /** * style and legend object * @typedef {object} styleAndLegend * @property {styleFunc} style - style function * @property {string} legend - legend content */ /** * * @param {object} esriResponse - layer info * @returns {styleAndLegend} style and legend object */ function makeFeatureServiceLegendAndSymbol(esriResponse) { "use strict"; var renderer = esriResponse.drawingInfo.renderer; var symbolLegendOut = null; switch (renderer.type) { case 'simple': switch (esriResponse.geometryType) { case 'esriGeometryPoint': symbolLegendOut = new SingleSymbol(esriResponse, PointSymbol); break; case 'esriGeometryPolyline': symbolLegendOut = new SingleSymbol(esriResponse, LineSymbol); break; case 'esriGeometryPolygon': symbolLegendOut = new SingleSymbol(esriResponse, PolygonSymbol); break; default: console.log(esriResponse); alert(esriResponse.geometryType + ' not handled'); } break; case 'uniqueValue': switch (esriResponse.geometryType) { case 'esriGeometryPoint': symbolLegendOut = new UniqueValueSymbol(esriResponse, PointSymbol); break; case 'esriGeometryPolyline': symbolLegendOut = new UniqueValueSymbol(esriResponse, LineSymbol); break; case 'esriGeometryPolygon': symbolLegendOut = new UniqueValueSymbol(esriResponse, PolygonSymbol); break; default: console.log(esriResponse); alert(esriResponse['geometryType'] + ' not handled'); } break; default: alert('not handled renderer type: ' + renderer['type']); } if (symbolLegendOut == null) { return { style: undefined, legend: '' }; } else { return { style: symbolLegendOut.olStyle, legend: symbolLegendOut.legendHtml }; } } exports.makeFeatureServiceLegendAndSymbol = makeFeatureServiceLegendAndSymbol; nm.makeFeatureServiceLegendAndSymbol = makeFeatureServiceLegendAndSymbol; /** * * @param {object} lyrObject - the layer as defined in the response * @param {boolean} [skipLayerNameAndExpander=false] use only icons * @returns {string} legend html */ function mapServiceLegendItem(lyrObject, skipLayerNameAndExpander) { if (skipLayerNameAndExpander === void 0) { skipLayerNameAndExpander = false; } skipLayerNameAndExpander = typeof skipLayerNameAndExpander == 'boolean' ? skipLayerNameAndExpander : false; var layerName = lyrObject['layerName']; var legendItems = lyrObject['legend']; var legendHtml = ''; if (!skipLayerNameAndExpander) { legendHtml += "<span class=\"legend-layer-subitem\">" + layerName + "</span>"; } if (legendItems.length == 1) { legendHtml = "<img class=\"legend-layer-icon\" height=\"17\" src=\"data:image/png;base64," + legendItems[0]['imageData'] + "\">"; } else { if (!skipLayerNameAndExpander) { legendHtml += '<span class="legend-items-expander" title="Expand/Collapse">▼</span>'; } legendHtml += '<ul>'; for (var i = 0; i < legendItems.length; i++) { legendHtml += "<li>"; legendHtml += "<span class=\"legend-layer-subitem\">" + htmlEscape(legendItems[i]['label']) + "</span>"; legendHtml += "<img class=\"legend-layer-icon\" height=\"17\" src=\"data:image/png;base64," + legendItems[i]['imageData'] + "\">"; legendHtml += "</li>"; } legendHtml += '</ul>'; } if (!skipLayerNameAndExpander) { legendHtml = "<span class=\"legend-layer-subitem\">" + layerName + "</span>" + legendHtml; } return legendHtml; } /** * make map service legent * @param {object} esriResponse - layer info * @returns {string} legend content */ function makeMapServiceLegend(esriResponse) { "use strict"; var newLegendHtml = ''; var layers = esriResponse['layers']; if (layers.length == 1) { newLegendHtml += mapServiceLegendItem(layers[0], true); } else { newLegendHtml += '<ul>'; for (var i = 0; i < layers.length; i++) { newLegendHtml += '<li>' + mapServiceLegendItem(layers[i]) + '</li>'; } newLegendHtml += '</ul>'; } return newLegendHtml; } exports.makeMapServiceLegend = makeMapServiceLegend; nm.makeMapServiceLegend = makeMapServiceLegend; /***/ }), /* 17 */, /* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Created by gavorhes on 11/2/2015. */ Object.defineProperty(exports, "__esModule", { value: true }); var provide_1 = __webpack_require__(0); var range_change_1 = __webpack_require__(19); var $ = __webpack_require__(1); var nm = provide_1.default('domUtil'); /** * @callback mediaCallback * @param {number} tm */ function timeToLocalDateString(tm) { "use strict"; var d = new Date(tm); var p1 = d.toLocaleTimeString().split(' '); var p2 = p1[0].split(':'); p2 = p2.slice(0, 2); return d.toLocaleDateString() + '<br>' + p2.join(':') + ' ' + p1[1]; } var MediaControl = (function () { /** * * @param element * @param changeFunc * @param mediaConfig */ function MediaControl(element, changeFunc, mediaConfig) { if (changeFunc === void 0) { changeFunc = function () { return; }; } if (mediaConfig === void 0) { mediaConfig = {}; } var _this = this; mediaConfig.min = typeof mediaConfig.min == 'number' ? mediaConfig.min : 0; mediaConfig.max = typeof mediaConfig.max == 'number' ? mediaConfig.max : 100; mediaConfig.val = typeof mediaConfig.val == 'number' ? mediaConfig.val : 0; mediaConfig.step = typeof mediaConfig.step == 'number' ? mediaConfig.step : 5; mediaConfig.playInterval = typeof mediaConfig.playInterval == 'number' ? mediaConfig.playInterval : 500; mediaConfig.showAsDate = typeof mediaConfig.showAsDate == 'boolean' ? mediaConfig.showAsDate : false; if (typeof element == 'string') { this._container = $('#' + element); } else if (typeof element['style'] !== 'undefined') { this._container = $(element); } else { this._container = element; } this._container.addClass('media-control-container'); this._playInterval = mediaConfig.playInterval; this._changeFunc = changeFunc; this._showAsDate = mediaConfig.showAsDate; this._currentValue = undefined; this._min = undefined; this._max = undefined; this._step = undefined; this._playing = false; var htmlStr = '<span class="media-player-button media-back"></span>' + '<span class="media-player-button media-play"></span>' + '<span class="media-player-button media-pause media-disabled"></span>' + '<span class="media-player-button media-stop media-disabled" ></span>' + '<span class="media-player-button media-ahead"></span>' + "<input type=\"range\">" + "<div class=\"media-control-value-label-container\">" + "<span class=\"media-control-value-label-min\"></span>" + "<span class=\"media-control-value-label-val\"></span>" + "<span class=\"media-control-value-label-max\"></span>" + "</div>"; this._container.append(htmlStr); // let btnPause = this._container.find('.media-pause'); var btnPlay = this._container.find('.media-play'); this._$btnStop = this._container.find('.media-stop'); var btnAhead = this._container.find('.media-ahead'); var btnBack = this._container.find('.media-back'); this._$slider = this._container.find('input[type=range]'); this._$valLabelMin = this._container.find('.media-control-value-label-min'); this._$valLabelVal = this._container.find('.media-control-value-label-val'); this._$valLabelMax = this._container.find('.media-control-value-label-max'); this.setMinMaxValueStep(mediaConfig.min, mediaConfig.max, mediaConfig.val, mediaConfig.step); range_change_1.rangeChange(this._$slider, function (newVal) { _this.currentValue = newVal; }, 100); var ___this = this; btnPlay.click(function () { var $this = $(this); $this.addClass('media-disabled'); ___this._$btnStop.removeClass('media-disabled'); btnAhead.addClass('media-locked'); btnBack.addClass('media-locked'); ___this._$slider.prop('disabled', true); ___this._playing = true; ___this._interval = setInterval(function () { ___this.currentValue += ___this._step; }, ___this._playInterval); }); this._$btnStop.click(function () { clearInterval(___this._interval); var $this = $(this); $this.addClass('media-disabled'); btnPlay.removeClass('media-disabled'); btnAhead.removeClass('media-locked'); btnBack.removeClass('media-locked'); ___this._$slider.prop('disabled', false); ___this._playing = false; }); btnAhead.click(function () { ___this.currentValue = ___this.currentValue + ___this._step; }); btnBack.click(function () { ___this.currentValue = ___this.currentValue - ___this._step; }); } MediaControl.prototype.stopPlaying = function () { if (this._playing) { this._$btnStop.trigger('click'); } }; Object.defineProperty(MediaControl.prototype, "playing", { get: function () { return this._playing; }, enumerable: true, configurable: true }); Object.defineProperty(MediaControl.prototype, "min", { get: function () { return this._min; }, enumerable: true, configurable: true }); Object.defineProperty(MediaControl.prototype, "max", { get: function () { return this._max; }, enumerable: true, configurable: true }); Object.defineProperty(MediaControl.prototype, "step", { get: function () { return this._step; }, enumerable: true, configurable: true }); Object.defineProperty(MediaControl.prototype, "currentValue", { get: function () { return this._currentValue; }, set: function (newValue) { if (newValue > this._max) { newValue = this._min; } else if (newValue < this._min) { newValue = this._max; } this._currentValue = newValue; this._$slider.val(this._currentValue.toFixed(2)); if (this._showAsDate) { this._$valLabelVal.html(timeToLocalDateString(this.currentValue)); } else { this._$valLabelVal.html(this.currentValue.toString()); } this._changeFunc(newValue); }, enumerable: true, configurable: true }); /** * set min and max value with step * @param {number} newMin the new min * @param {number} newMax the new mas * @param {number} [newValue=newMin] the value to set * @param {number} [newStep=(newMax-newMin)/20] step value */ MediaControl.prototype.setMinMaxValueStep = function (newMin, newMax, newValue, newStep) { this._min = newMin; this._max = newMax; newValue = typeof newValue == 'number' ? newValue : newMin; newStep = typeof newStep == 'number' ? newStep : (newMax - newMin) / 20; this._currentValue = newValue; this._step = newStep; this._$slider.prop('min', this.min.toString()); this._$slider.prop('max', this.max.toString()); this._$slider.prop('step', this.step.toString()); this._$slider.val(this.currentValue.toString()); if (this._showAsDate) { this._$valLabelMin.html(timeToLocalDateString(this._min)); this._$valLabelVal.html(timeToLocalDateString(this.currentValue)); this._$valLabelMax.html(timeToLocalDateString(this._max)); } else { this._$valLabelMin.html(this._min.toString()); this._$valLabelVal.html(this.currentValue.toString()); this._$valLabelMax.html(this._max.toString()); } }; Object.defineProperty(MediaControl.prototype, "changeFunction", { /** * * @param {mediaCallback} newFunc the callback on change */ set: function (newFunc) { this._changeFunc = newFunc; }, enumerable: true, configurable: true }); return MediaControl; }()); exports.MediaControl = MediaControl; nm.MediaControl = MediaControl; /***/ }), /* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var provide_1 = __webpack_require__(0); var nm = provide_1.default('domUtil'); var mouseIn = false; var mouseDown = false; var timeout = null; var dragged = false; var lastVal; /** * Created by gavorhes on 11/2/2015. */ function triggerCallback(callback, evt) { "use strict"; var val = parseFloat(this.value); var min = parseFloat(this.min); var max = parseFloat(this.max); var step = parseFloat(this.step); if (max - val < step) { val = max; } var percent = (val - min) / (max - min); if (typeof lastVal == 'number' && val == lastVal) { return; } lastVal = val; callback(val, percent, evt); } /** * Add a variety of listeners for range inputs applied to a common callback * @param $slider - jquery reference to the slider * @param {rangeChangeCallback} callback - the callback * @param {number} [changeTimeout=75] before the callback is called * @this {jQuery} * @returns {jQuery} the jQuery object */ function rangeChange($slider, callback, changeTimeout) { changeTimeout = typeof changeTimeout == 'number' ? changeTimeout : 75; $slider.mouseenter(function () { mouseIn = true; }); $slider.mouseleave(function () { mouseIn = false; mouseDown = false; }); $slider.mousedown(function () { mouseDown = true; }); $slider.mouseup(function () { mouseDown = false; }); $slider.mousemove( /** * * @param {object} evt - event properties * @this {HTMLElement} */ function (evt) { if (!(mouseIn && mouseDown)) { return; } dragged = true; if (lastVal == this['value']) { return; } lastVal = this['value']; if (timeout != null) { clearTimeout(timeout); } var _this = this; timeout = setTimeout(function () { triggerCallback.call(_this, callback, evt); timeout = null; }, changeTimeout); }); $slider.keyup( /** * * @param {object} evt - event properties */ function (evt) { if (evt.keyCode == 37 || evt.keyCode == 39) { triggerCallback.call(this, callback, evt); } }); $slider.change(function (evt) { if (dragged) { dragged = false; return; } triggerCallback.call(this, callback, evt); }); return this; } exports.rangeChange = rangeChange; nm.rangeChange = rangeChange; /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var LayerBase_1 = __webpack_require__(8); var mapMove_1 = __webpack_require__(6); var provide_1 = __webpack_require__(0); var ol = __webpack_require__(2); var $ = __webpack_require__(1); var nm = provide_1.default('layers'); /** * The Vector layer base * @augments LayerBase * @abstract */ var LayerBaseVector = (function (_super) { __extends(LayerBaseVector, _super); /** * The base vector layer * @param {string} url - pass an empty string to prevent default load and add from a json source * @param {object} options - config * @param {string} [options.id] - layer id * @param {string} [options.name=Unnamed Layer] - layer name * @param {number} [options.opacity=1] - opacity * @param {boolean} [options.visible=true] - default visible * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 * @param {object} [options.params={}] the get parameters to include to retrieve the layer * @param {number} [options.zIndex=0] the z index for the layer * @param {function} [options.loadCallback] function to call on load, context this is the layer object * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility * @param {boolean} [options.legendContent] additional content to add to the legend * * @param {boolean} [options.autoLoad=false] if the layer should auto load if not visible * @param {object} [options.style=undefined] the layer style, use openlayers default style if not defined * @param {boolean} [options.onDemand=false] if the layer should be loaded by extent on map move * @param {number} [options.onDemandDelay=300] delay before the map move callback should be called * @param {mapMoveMakeGetParams} [options.mapMoveMakeGetParams=function(lyr, extent, zoomLevel){}] function to create additional map move params * @param {MapMoveCls} [options.mapMoveObj=mapMove] alternate map move object for use with multi map pages * */ function LayerBaseVector(url, options) { if (options === void 0) { options = {}; } var _this = _super.call(this, url, options) || this; options = options; //prevent regular load if no url has been provided if (_this.url.trim() == '') { _this._loaded = true; } _this._style = typeof options.style == 'undefined' ? undefined : options.style; if (_this.visible) { _this._autoLoad = true; } else { _this._autoLoad = (typeof options['autoLoad'] == 'boolean' ? options['autoLoad'] : false); } _this._onDemand = typeof options.onDemand == 'boolean' ? options.onDemand : false; _this._onDemandDelay = typeof options.onDemandDelay == 'number' ? options.onDemandDelay : 300; if (options.mapMoveObj) { _this._mapMove = options.mapMoveObj; } else { _this._mapMove = _this._onDemand ? mapMove_1.default : undefined; } _this._mapMoveMakeGetParams = typeof options.mapMoveMakeGetParams == 'function' ? options.mapMoveMakeGetParams : function () { return {}; }; if (_this._onDemand) { _this._loaded = true; _this._mapMoveParams = {}; _this._mapMove.checkInit(); _this._mapMove.addVectorLayer(_this); } _this._source = new ol.source.Vector(); _this._olLayer = new ol.layer.Vector({ source: _this._source, visible: _this.visible, style: _this.style, minResolution: _this._minResolution, maxResolution: _this._maxResolution, renderOrder: options.renderOrder }); _this.olLayer.setZIndex(_this._zIndex); _this._projectionMap = null; _this._projection4326 = new ol.proj.Projection({ code: "EPSG:4326" }); return _this; } /** * dummy to be overridden * @param {object} featureCollection - geojson or esrijson object */ LayerBaseVector.prototype.addFeatures = function (featureCollection) { console.log('Layer vector base addFeatures is a placeholder and does nothing'); }; /** * Before call to map move callback, can prevent call by returning false * @param {number} zoom - zoom level * @param {string} [evtType=undefined] undefined for initial load, otherwise one of 'change:center', 'change:resolution' * @returns {boolean} if the call should proceed */ LayerBaseVector.prototype.mapMoveBefore = function (zoom, evtType) { if (this.minZoom !== undefined) { if (zoom < this.minZoom) { return false; } } if (this.maxZoom !== undefined) { if (zoom > this.maxZoom) { return false; } } return this.visible; }; /** * callback to generate the parameters passed in the get request * @param {object} extent - extent object * @param {number} extent.minX - minX * @param {number} extent.minY - minY * @param {number} extent.maxX - maxX * @param {number} extent.maxY - maxY * @param {number} zoomLevel - zoom level */ LayerBaseVector.prototype.mapMoveMakeGetParams = function (extent, zoomLevel) { this._mapMoveParams = {}; $.extend(this._mapMoveParams, this.params); $.extend(this._mapMoveParams, this._mapMoveMakeGetParams(this, extent, zoomLevel)); }; /** * callback function on map move * @param {object} d - the json response */ LayerBaseVector.prototype.mapMoveCallback = function (d) { if (this.source) { this._source.clear(); } }; /** * clear features in the layer */ LayerBaseVector.prototype.clear = function () { if (this._source) { this._source.clear(); } }; Object.defineProperty(LayerBaseVector.prototype, "onDemandDelay", { /** * get on demand delay in miliseconds */ get: function () { return this._onDemandDelay; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBaseVector.prototype, "autoLoad", { /** * get if the layer is autoloaded */ get: function () { return this._autoLoad; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBaseVector.prototype, "style", { /** * get the style definition */ get: function () { return this._style; }, /** * set the style * @param style - the style or function */ set: function (style) { this._style = style; this.olLayer.setStyle(this._style); }, enumerable: true, configurable: true }); Object.defineProperty(LayerBaseVector.prototype, "mapCrs", { /** * get the map CRS if it is defined by the map move object */ get: function () { return this.mapProj == null ? null : this.mapProj.getCode(); }, enumerable: true, configurable: true }); Object.defineProperty(LayerBaseVector.prototype, "mapProj", { get: function () { if (this._projectionMap != null) { return this._projectionMap; } if (this._mapMove) { this._projectionMap = this._mapMove.map.getView().getProjection(); return this._projectionMap; } else { return null; } }, enumerable: true, configurable: true }); Object.defineProperty(LayerBaseVector.prototype, "mapMove", { /** * get the map move object * @type {MapMoveCls|*} */ get: function () { return this._mapMove; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBaseVector.prototype, "mapMoveParams", { /** * map move params * @type {object} */ get: function () { return this._mapMoveParams; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBaseVector.prototype, "visible", { get: function () { return this._visible; }, /** * Set the layer visibility * @type {boolean} * @override */ set: function (visibility) { _super.prototype.setVisible.call(this, visibility); if (this._onDemand) { this.mapMove.triggerLyrLoad(this); } }, enumerable: true, configurable: true }); Object.defineProperty(LayerBaseVector.prototype, "source", { /** * get the layer vector source * @override */ get: function () { return this.getSource(); }, enumerable: true, configurable: true }); Object.defineProperty(LayerBaseVector.prototype, "features", { /** * array of ol features */ get: function () { return this.source.getFeatures(); }, enumerable: true, configurable: true }); Object.defineProperty(LayerBaseVector.prototype, "olLayer", { /** * */ get: function () { return _super.prototype.getOlLayer.call(this); }, enumerable: true, configurable: true }); LayerBaseVector.prototype.setZIndex = function (newZ) { this.olLayer.setZIndex(newZ); }; return LayerBaseVector; }(LayerBase_1.LayerBase)); exports.LayerBaseVector = LayerBaseVector; nm.LayerBaseVector = LayerBaseVector; exports.default = LayerBaseVector; /***/ }), /* 21 */, /* 22 */, /* 23 */, /* 24 */, /* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Created by gavorhes on 11/2/2015. */ var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var LayerBaseVector_1 = __webpack_require__(20); var esriToOl = __webpack_require__(16); var provide_1 = __webpack_require__(0); var ol = __webpack_require__(2); var $ = __webpack_require__(1); var nm = provide_1.default('layers'); /** * Base layer for esri vector layers * @augments LayerBaseVector */ var LayerBaseVectorEsri = (function (_super) { __extends(LayerBaseVectorEsri, _super); /** * The base vector layer * @param {string} url - url for source * @param {object} options - config * @param {string} [options.id] - layer id * @param {string} [options.name=Unnamed Layer] - layer name * @param {number} [options.opacity=1] - opacity * @param {boolean} [options.visible=true] - default visible * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 * @param {object} [options.params={}] the get parameters to include to retrieve the layer * @param {number} [options.zIndex=0] the z index for the layer * @param {function} [options.loadCallback] function to call on load, context this is the layer object * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility * @param {boolean} [options.legendContent] additional content to add to the legend * * @param {boolean} [options.autoLoad=false] if the layer should auto load if not visible * @param {object} [options.style=undefined] the layer style, use openlayers default style if not defined * @param {boolean} [options.onDemand=false] if the layer should be loaded by extent on map move * @param {number} [options.onDemandDelay=300] delay before the map move callback should be called * @param {MapMoveCls} [options.mapMoveObj=mapMove] alternate map move object for use with multi map pages * * @param {string} [options.where=1=1] the layer filter clause * @param {string} [options.outFields=*] comma separated list of output fields, defaults to all * @param {string} [options.format=pjson] the format the retrieve the data * @param {number} [options.outSR=3857] the output spatial reference, defaults to web mercator * @param {boolean} [options.useEsriStyle=false] if the map service style should be used * @param {boolean} [options.collapseLegend=false] if the legend should be initially collapsed * @param {number} [options.mapMoveMakeGetParams=function(extent, zoomLevel){}] function to create additional map move params */ function LayerBaseVectorEsri(url, options) { var _this = this; if (typeof options.params != 'object') { options.params = {}; } options.params['where'] = options.where || '1=1'; options.params['outFields'] = options.outFields || '*'; options.params['f'] = options.format || 'pjson'; options.params['outSR'] = options.outSR || 3857; _this = _super.call(this, url, options) || this; _this._outSR = _this.params['outSR']; _this._esriFormat = new ol.format.EsriJSON(); if (_this._url[_this._url.length - 1] !== '/') { _this._url += '/'; } _this._urlCopy = _this.url; _this._url += 'query?callback=?'; if (_this.autoLoad || _this.visible) { _this._load(); } _this._useEsriStyle = typeof options.useEsriStyle == 'boolean' ? options.useEsriStyle : false; if (_this._useEsriStyle) { _this.addLegendContent(); } return _this; } /** * add additional content to the legend * @param {string} [additionalContent=''] additional content to add to legend */ LayerBaseVectorEsri.prototype.addLegendContent = function (additionalContent) { var _this = this; if (!this._useEsriStyle) { _super.prototype.addLegendContent.call(this, additionalContent); } else { $.get(this._urlCopy + '?f=pjson&callback=?', {}, function (d) { if (d['subLayers'].length > 0) { alert('should only use single feature layers, not groups'); return; } var newStyleAndLegend = esriToOl.makeFeatureServiceLegendAndSymbol(d); _this.style = newStyleAndLegend.style; _super.prototype.addLegendContent.call(_this, newStyleAndLegend.legend); }, 'json'); } }; /** * add feature collection * @param {object} featureCollection - features as esrijson */ LayerBaseVectorEsri.prototype.addFeatures = function (featureCollection) { var feats = this._esriFormat.readFeatures(featureCollection); this.source.addFeatures(feats); }; /** * trigger load features * @protected * @returns {boolean} if already loaded */ LayerBaseVectorEsri.prototype._load = function () { var _this = this; if (_super.prototype._load.call(this)) { return true; } $.get(this._url, this.params, function (d) { _this.addFeatures(d); _this.loadCallback(_this); }, 'json').fail(function () { _this._loaded = false; }); return false; }; /** * callback to generate the parameters passed in the get request * @param {object} extent - extent object * @param {number} extent.minX - minX * @param {number} extent.minY - minY * @param {number} extent.maxX - maxX * @param {number} extent.maxY - maxY * @param {number} zoomLevel - zoom level */ LayerBaseVectorEsri.prototype.mapMoveMakeGetParams = function (extent, zoomLevel) { _super.prototype.mapMoveMakeGetParams.call(this, extent, zoomLevel); this.mapMoveParams['geometry'] = extent.minX + "," + extent.minY + "," + extent.maxX + "," + extent.maxY; this.mapMoveParams['geometryType'] = 'esriGeometryEnvelope'; this.mapMoveParams['spatialRel'] = 'esriSpatialRelIntersects'; this.mapMoveParams['spatialRel'] = 'esriSpatialRelIntersects'; this.mapMoveParams['inSR'] = 3857; if (this._outSR == 3857) { this.mapMoveParams['geometryPrecision'] = 1; } }; /** * Before call to map move callback, can prevent call by returning false * @param {number} zoom - zoom level * @param {string} [evtType=undefined] undefined for initial load, otherwise one of 'change:center', 'change:resolution' * @returns {boolean} if the call should proceed */ LayerBaseVectorEsri.prototype.mapMoveBefore = function (zoom, evtType) { return _super.prototype.mapMoveBefore.call(this, zoom, evtType); //if (super.mapMoveBefore(zoom, evtType)){ // //place holder for additional processing // return true; //} else { // return false; //} }; /** * callback function on map move * @param {object} d - the json response */ LayerBaseVectorEsri.prototype.mapMoveCallback = function (d) { _super.prototype.mapMoveCallback.call(this, d); this.source.addFeatures(this._esriFormat.readFeatures(d)); }; return LayerBaseVectorEsri; }(LayerBaseVector_1.LayerBaseVector)); exports.LayerBaseVectorEsri = LayerBaseVectorEsri; nm.LayerBaseVectorEsri = LayerBaseVectorEsri; exports.default = LayerBaseVectorEsri; /***/ }), /* 26 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Created by gavorhes on 11/4/2015. */ var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var LayerBaseXyzTile_1 = __webpack_require__(29); var RealEarthAnimateTile_1 = __webpack_require__(32); var provide_1 = __webpack_require__(0); var nm = provide_1.default('layers'); /** * Real earth tile * @augments LayerBaseXyzTile */ var LayerRealEarthTile = (function (_super) { __extends(LayerRealEarthTile, _super); /** * The base layer for all others * @param {object} options - config * @param {string} [options.id] - layer id * @param {string} [options.name=Unnamed Layer] - layer name * @param {number} [options.opacity=1] - opacity * @param {boolean} [options.visible=true] - default visible * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 * @param {object} [options.params={}] the get parameters to include to retrieve the layer * @param {number} [options.zIndex=0] the z index for the layer * @param {function} [options.loadCallback] function to call on load, context this is the layer object * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility * @param {boolean} [options.legendContent] additional content to add to the legend * * @param {string} options.products - the products to request * @param {boolean} [options.hasTimes=false] If the layer is time dependent, fixed set of dates * @param {boolean} [options.animate=false] if the layer should be animated */ function LayerRealEarthTile(options) { var _this = this; options.animate = typeof options.animate == 'boolean' ? options.animate : false; if (options.animate) { _this = _super.call(this, '', options) || this; _this._products = options.products; _this.animator = new RealEarthAnimateTile_1.default(_this, options.timeLoadCallback); _this.animator.timeInit(); } else { _this = _super.call(this, "http://realearth.ssec.wisc.edu/api/image?products=" + options.products + "&x={x}&y={y}&z={z}", options) || this; _this._products = options.products; } return _this; } LayerRealEarthTile.prototype.setLayerTime = function (theTime) { if (this.animator) { return this.animator.setLayerTime(theTime); } else { return false; } }; LayerRealEarthTile.prototype._load = function () { if (this.animator) { return false; } return _super.prototype._load.call(this); }; return LayerRealEarthTile; }(LayerBaseXyzTile_1.LayerBaseXyzTile)); exports.LayerRealEarthTile = LayerRealEarthTile; nm.LayerRealEarthTile = LayerRealEarthTile; exports.default = LayerRealEarthTile; /***/ }), /* 27 */, /* 28 */, /* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); /** * Created by gavorhes on 12/4/2015. */ var LayerBase_1 = __webpack_require__(8); var provide_1 = __webpack_require__(0); var ol = __webpack_require__(2); var nm = provide_1.default('layers'); /** * XYZ tile * @augments LayerBase */ var LayerBaseXyzTile = (function (_super) { __extends(LayerBaseXyzTile, _super); /** * The XYZ tile layer * @param {string} url - url for source * @param {object} options - config * @param {string} [options.id] - layer id * @param {string} [options.name=Unnamed Layer] - layer name * @param {number} [options.opacity=1] - opacity * @param {boolean} [options.visible=true] - default visible * @param {number} [options.minZoom=undefined] - min zoom level, 0 - 28 * @param {number} [options.maxZoom=undefined] - max zoom level, 0 - 28 * @param {object} [options.params={}] the get parameters to include to retrieve the layer * @param {number} [options.zIndex=0] the z index for the layer * @param {function} [options.loadCallback] function to call on load, context this is the layer object * @param {boolean} [options.legendCollapse=false] if the legend item should be initially collapsed * @param {boolean} [options.legendCheckbox=true] if the legend item should have a checkbox for visibility * @param {boolean} [options.legendContent] additional content to add to the legend * @param {boolean} [options.useEsriStyle=false] if the map service style should be used */ function LayerBaseXyzTile(url, options) { if (options === void 0) { options = {}; } var _this = _super.call(this, url, options) || this; _this._source = new ol.source.XYZ({ url: _this.url == '' ? undefined : _this.url }); _this._olLayer = new ol.layer.Tile({ source: _this._source, visible: _this.visible, opacity: _this.opacity, minResolution: _this._minResolution, maxResolution: _this._maxResolution }); _this._olLayer.setZIndex(_this._zIndex); return _this; } Object.defineProperty(LayerBaseXyzTile.prototype, "source", { /** * * @returns {ol.source.XYZ} the vector source */ get: function () { return this._source; }, enumerable: true, configurable: true }); Object.defineProperty(LayerBaseXyzTile.prototype, "olLayer", { /** * * @returns {ol.layer.Tile|ol.layer.Base|undefined} the ol layer */ get: function () { return this._olLayer; }, enumerable: true, configurable: true }); return LayerBaseXyzTile; }(LayerBase_1.LayerBase)); exports.LayerBaseXyzTile = LayerBaseXyzTile; nm.LayerBaseXyzTile = LayerBaseXyzTile; exports.default = LayerBaseXyzTile; /***/ }), /* 30 */, /* 31 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Created by gavorhes on 12/4/2015. */ var provide_1 = __webpack_require__(0); var mapPopup_1 = __webpack_require__(4); var $ = __webpack_require__(1); var nm = provide_1.default('mixin'); /** * The GMT offset time in minutes * @type {number} */ var offsetMinutes = (new Date()).getTimezoneOffset(); /** * Mixin to get the product times * Be sure to call getTimeInit after the mixin has been applied */ var RealEarthAnimate = (function () { function RealEarthAnimate(lyr, loadCallback) { this.lyr = lyr; this._products = lyr._products; if (loadCallback) { this.loadCallback = loadCallback; } else { this.loadCallback = function () { return; }; } } /** * Call this after the mixin has been applied */ RealEarthAnimate.prototype.timeInit = function () { var _this = this; this._rawDateStrings = []; this._localDates = []; this.localTimes = []; this._animateEnabled = true; // this._loaded = true; this._currentTime = undefined; this._currentIndex = undefined; $.get('http://realearth.ssec.wisc.edu/api/products', { products: this._products }, function (d) { if (d.length == 0) { console.log(_this._products + " layer not available or does not have times"); return; } d = d[0]; for (var i = 0; i < d['times'].length; i++) { _this._loadDates.call(_this, d['times'][i]); } _this.loadCallback.call(_this.lyr, _this.lyr); _this._loadLatest.call(_this); }, 'json'); }; /** * Given the raw time string, add to the arrays to keep track of dates and cache * @param {string} inString - input string to parse * @returns {string} the converted string * @protected */ RealEarthAnimate.prototype._loadDates = function (inString) { var yr = inString.slice(0, 4); var month = inString.slice(4, 6); var d = inString.slice(6, 8); var hr = inString.slice(9, 11); var mn = inString.slice(11, 13); var sec = inString.slice(13, 15); var rawDateStr = inString.replace('.', '_'); this._rawDateStrings.push(rawDateStr); var dteStr = month + "/" + d + "/" + yr + " " + hr + ":" + mn + ":" + sec; var newDte = new Date(dteStr); newDte.setMinutes(newDte.getMinutes() - offsetMinutes); this._localDates.push(newDte); this.localTimes.push(newDte.getTime()); return rawDateStr; }; /** * * @protected * @returns {boolean} if should continue */ RealEarthAnimate.prototype._loadLatest = function () { mapPopup_1.default.closePopup(); if (this.localTimes.length > 0) { this._currentIndex = this.localTimes.length - 1; return true; } else { return false; } }; /** * * @param {number} theTime - the time * @returns {boolean} true if new index, false if the same or below lowest value */ RealEarthAnimate.prototype.setLayerTime = function (theTime) { this._currentTime = theTime; var newIndex; if (theTime < this.localTimes[0]) { return false; } else if (theTime > this.localTimes[this.localTimes.length - 1]) { newIndex = this.localTimes.length - 1; } for (var i = 0; i < this.localTimes.length; i++) { if (this.localTimes[i] >= theTime) { newIndex = i; break; } } if (newIndex == this._currentIndex) { return false; } else { this._currentIndex = newIndex; mapPopup_1.default.closePopup(); return true; } }; return RealEarthAnimate; }()); exports.RealEarthAnimate = RealEarthAnimate; nm.RealEarthAnimate = RealEarthAnimate; exports.default = RealEarthAnimate; /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); /** * Created by gavorhes on 12/4/2015. */ var RealEarthAnimate_1 = __webpack_require__(31); var provide_1 = __webpack_require__(0); var nm = provide_1.default('mixin'); /** * Animate real earth tile * @augments RealEarthAnimate */ var RealEarthAnimateTile = (function (_super) { __extends(RealEarthAnimateTile, _super); function RealEarthAnimateTile(layer, loadCallback) { var _this = _super.call(this, layer, loadCallback) || this; _this._source = layer.source; _this._olLayer = layer.olLayer; return _this; } RealEarthAnimateTile.prototype.timeInit = function () { _super.prototype.timeInit.call(this); this._sourceUrls = []; }; RealEarthAnimateTile.prototype._loadDates = function (inString) { var rawDte = _super.prototype._loadDates.call(this, inString); var dteProductUrl = "http://realearth.ssec.wisc.edu/api/image?products=" + this._products + "_" + rawDte + "&x={x}&y={y}&z={z}"; this._sourceUrls.push(dteProductUrl); return ''; }; /** * @protected */ RealEarthAnimateTile.prototype._loadLatest = function () { if (_super.prototype._loadLatest.call(this)) { this._source.setUrl(this._sourceUrls[this._sourceUrls.length - 1]); } return true; }; RealEarthAnimateTile.prototype.setLayerTime = function (theTime) { if (_super.prototype.setLayerTime.call(this, theTime)) { if (this._olLayer.getZIndex() < 0) { this._olLayer.setZIndex(0); } this._source.setUrl(this._sourceUrls[this._currentIndex]); } else { this._olLayer.setZIndex(-1); } return true; }; return RealEarthAnimateTile; }(RealEarthAnimate_1.default)); nm.RealEarthAnimateTile = RealEarthAnimateTile; exports.default = RealEarthAnimateTile; /***/ }), /* 33 */, /* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var quickMap_1 = __webpack_require__(7); var LayerRealEarthTile_1 = __webpack_require__(26); var media_control_1 = __webpack_require__(18); var $ = __webpack_require__(1); var LayerBaseVectorEsri_1 = __webpack_require__(25); var LayerEsriMapServer_1 = __webpack_require__(10); __webpack_require__(15); var nexrhresStatic = new LayerRealEarthTile_1.default({ products: 'nexrhres', id: 'nexrhres-static', opacity: 0.6, animate: true, name: 'Hybrid Reflectivity', // maxZoom: 10, timeLoadCallback: function (f) { console.log(f); } }); var d = new Date(); var endTime = d.getTime(); d.setHours(d.getHours() - 4); var startTime = d.getTime(); var rangeStep = Math.round((endTime - startTime) / 8); var media = new media_control_1.MediaControl($('#control'), function (v) { nexrhresStatic.setLayerTime(v); }, { min: startTime, max: endTime, val: endTime, step: rangeStep, playInterval: 750, showAsDate: true }); var map = quickMap_1.quickMap(); map.addLayer(nexrhresStatic.olLayer); var coordinationLayer = new LayerBaseVectorEsri_1.LayerBaseVectorEsri('http://transportal.cee.wisc.edu/applications/arcgis2/rest/services/GLRTOC/GlrtocCoordination/MapServer/0', { visible: true, autoLoad: true, name: 'Coordination', useEsriStyle: true }); map.addLayer(coordinationLayer.olLayer); var oakRidgeLayers = [ ['Cameras', 'cameras33'], ['HAR', 'HAR33'], ['DMS', 'MessageSigns33'], //['State Summary', 'statesummary'], ['Traffic Control', 'TrafficControl33'], ['Traffic Detection', 'TrafficDetectionMulti'], ['Weather', 'Weather33'] ]; for (var i = 0; i < oakRidgeLayers.length; i++) { var oakRidgeLayer = new LayerEsriMapServer_1.LayerEsriMapServer("http://itsdpro.ornl.gov/arcgis/rest/services/ITSPublic/" + oakRidgeLayers[i][1] + "/MapServer", { id: oakRidgeLayers[i][1], name: oakRidgeLayers[i][0], visible: true, minZoom: 7, zIndex: 20, addPopup: true, legendCollapse: true }); map.addLayer(oakRidgeLayer.olLayer); } /***/ }) /******/ ]); //# sourceMappingURL=animate.js.map