From 5d9bfb9b30d0718b4cc94d0defe54067509fc74c Mon Sep 17 00:00:00 2001 From: Glenn Vorhes <gavorhes@wisc.edu> Date: Wed, 11 May 2016 18:47:38 -0500 Subject: [PATCH] make ol use import instead of require --- lib/jquery-plugin/rp-picker.js | 37 +++++++++++++----------- lib/jquery-plugin/ssa-corridor-picker.js | 10 ++++--- lib/layers/LayerBaseVector.js | 9 ++++-- lib/layers/LayerBaseVectorEsri.js | 8 +++-- lib/layers/LayerBaseVectorGeoJson.js | 7 +++-- lib/layers/LayerBaseXyzTile.js | 9 ++++-- lib/layers/LayerEsriMapServer.js | 11 ++++--- lib/layers/LayerItsInventory.js | 25 +++++++++------- lib/olHelpers/esriToOlStyle.js | 27 +++++++++-------- lib/olHelpers/mapPopupCls.js | 23 ++++++++------- lib/olHelpers/quickMapBase.js | 31 +++++++++++--------- package.json | 2 +- src/jquery-plugin/rp-picker.js | 2 +- src/jquery-plugin/ssa-corridor-picker.js | 2 +- src/layers/LayerBaseVector.js | 2 +- src/layers/LayerBaseVectorEsri.js | 2 +- src/layers/LayerBaseVectorGeoJson.js | 2 +- src/layers/LayerBaseXyzTile.js | 2 +- src/layers/LayerEsriMapServer.js | 2 +- src/layers/LayerItsInventory.js | 2 +- src/olHelpers/esriToOlStyle.js | 2 +- src/olHelpers/mapPopupCls.js | 4 ++- src/olHelpers/quickMapBase.js | 3 +- 23 files changed, 128 insertions(+), 96 deletions(-) diff --git a/lib/jquery-plugin/rp-picker.js b/lib/jquery-plugin/rp-picker.js index d0e4498..b180cf2 100644 --- a/lib/jquery-plugin/rp-picker.js +++ b/lib/jquery-plugin/rp-picker.js @@ -34,11 +34,14 @@ var _provide = require('../util/provide'); var _provide2 = _interopRequireDefault(_provide); +var _ol = require('../ol/ol'); + +var _ol2 = _interopRequireDefault(_ol); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var ol = require('../ol/ol'); var nm = (0, _provide2.default)('ssa'); /** @@ -164,33 +167,33 @@ var RpPicker = (function () { mapMoveObj: this._pickerMapMove, name: 'Reference Points', transform: { dataProjection: 'EPSG:3857', featureProjection: 'EPSG:3857' }, - style: new ol.style.Style({ - image: new ol.style.Circle({ + style: new _ol2.default.style.Style({ + image: new _ol2.default.style.Circle({ radius: 7, - fill: new ol.style.Fill({ color: 'rgba(0, 0, 255, 0.5)' }), - stroke: new ol.style.Stroke({ color: 'blue', width: 2 }) + fill: new _ol2.default.style.Fill({ color: 'rgba(0, 0, 255, 0.5)' }), + stroke: new _ol2.default.style.Stroke({ color: 'blue', width: 2 }) }) }) }); - this._rpSelectionLayer = new ol.layer.Vector({ - source: new ol.source.Vector(), - style: new ol.style.Style({ - image: new ol.style.Circle({ + this._rpSelectionLayer = new _ol2.default.layer.Vector({ + source: new _ol2.default.source.Vector(), + style: new _ol2.default.style.Style({ + image: new _ol2.default.style.Circle({ radius: 8, - fill: new ol.style.Fill({ color: 'rgba(255, 0, 0, 0.7)' }), - stroke: new ol.style.Stroke({ color: 'red', width: 2 }) + fill: new _ol2.default.style.Fill({ color: 'rgba(255, 0, 0, 0.7)' }), + stroke: new _ol2.default.style.Stroke({ color: 'red', width: 2 }) }) }) }); - this._rpOtherLayer = new ol.layer.Vector({ - source: new ol.source.Vector(), - style: new ol.style.Style({ - image: new ol.style.Circle({ + this._rpOtherLayer = new _ol2.default.layer.Vector({ + source: new _ol2.default.source.Vector(), + style: new _ol2.default.style.Style({ + image: new _ol2.default.style.Circle({ radius: 8, - fill: new ol.style.Fill({ color: 'rgba(0, 255, 0, 0.7)' }), - stroke: new ol.style.Stroke({ color: 'green', width: 2 }) + fill: new _ol2.default.style.Fill({ color: 'rgba(0, 255, 0, 0.7)' }), + stroke: new _ol2.default.style.Stroke({ color: 'green', width: 2 }) }) }) }); diff --git a/lib/jquery-plugin/ssa-corridor-picker.js b/lib/jquery-plugin/ssa-corridor-picker.js index 6fa052a..e07f531 100644 --- a/lib/jquery-plugin/ssa-corridor-picker.js +++ b/lib/jquery-plugin/ssa-corridor-picker.js @@ -34,14 +34,16 @@ var _provide = require('../util/provide'); var _provide2 = _interopRequireDefault(_provide); +var _ol = require('../ol/ol'); + +var _ol2 = _interopRequireDefault(_ol); + require('./rp-picker.js'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var ol = require('../ol/ol'); - var nm = (0, _provide2.default)('ssa'); function makeRpPickerContent(idx) { @@ -88,8 +90,8 @@ function layerConfigHelper(name, color, visible) { minZoom: 4, name: name, transform: { dataProjection: 'EPSG:3857', featureProjection: 'EPSG:3857' }, - style: new ol.style.Style({ - stroke: new ol.style.Stroke({ + style: new _ol2.default.style.Style({ + stroke: new _ol2.default.style.Stroke({ color: color, width: 5 }) diff --git a/lib/layers/LayerBaseVector.js b/lib/layers/LayerBaseVector.js index 3ee0b6b..98e79c4 100644 --- a/lib/layers/LayerBaseVector.js +++ b/lib/layers/LayerBaseVector.js @@ -26,6 +26,10 @@ var _provide = require('../util/provide'); var _provide2 = _interopRequireDefault(_provide); +var _ol = require('../ol/ol'); + +var _ol2 = _interopRequireDefault(_ol); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -34,7 +38,6 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var ol = require('../ol/ol'); var nm = (0, _provide2.default)('layers'); /** @@ -124,8 +127,8 @@ var LayerBaseVector = (function (_LayerBase) { _this._mapMove.addVectorLayer(_this); } - _this._source = new ol.source.Vector(); - _this.olLayer = new ol.layer.Vector({ + _this._source = new _ol2.default.source.Vector(); + _this.olLayer = new _ol2.default.layer.Vector({ source: _this._source, visible: _this.visible, style: _this.style, diff --git a/lib/layers/LayerBaseVectorEsri.js b/lib/layers/LayerBaseVectorEsri.js index 7f7f368..846eba9 100644 --- a/lib/layers/LayerBaseVectorEsri.js +++ b/lib/layers/LayerBaseVectorEsri.js @@ -28,6 +28,10 @@ var _provide = require('../util/provide'); var _provide2 = _interopRequireDefault(_provide); +var _ol = require('../ol/ol'); + +var _ol2 = _interopRequireDefault(_ol); + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -42,8 +46,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * Created by gavorhes on 11/2/2015. */ -var ol = require('../ol/ol'); - var nm = (0, _provide2.default)('layers'); /** @@ -100,7 +102,7 @@ var LayerBaseVectorEsri = (function (_LayerBaseVector) { var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(LayerBaseVectorEsri).call(this, url, options)); _this._outSR = _this.params['outSR']; - _this._esriFormat = new ol.format.EsriJSON(); + _this._esriFormat = new _ol2.default.format.EsriJSON(); if (_this._url[_this._url.length - 1] !== '/') { _this._url += '/'; diff --git a/lib/layers/LayerBaseVectorGeoJson.js b/lib/layers/LayerBaseVectorGeoJson.js index f001aa7..cd0b210 100644 --- a/lib/layers/LayerBaseVectorGeoJson.js +++ b/lib/layers/LayerBaseVectorGeoJson.js @@ -20,6 +20,10 @@ var _provide = require('../util/provide'); var _provide2 = _interopRequireDefault(_provide); +var _ol = require('../ol/ol'); + +var _ol2 = _interopRequireDefault(_ol); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -30,7 +34,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * Created by gavorhes on 11/2/2015. */ -var ol = require('../ol/ol'); var nm = (0, _provide2.default)('layers'); /** @@ -76,7 +79,7 @@ var LayerBaseVectorGeoJson = (function (_LayerBaseVector) { var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(LayerBaseVectorGeoJson).call(this, url, options)); - _this._geoJsonFormat = new ol.format.GeoJSON(); + _this._geoJsonFormat = new _ol2.default.format.GeoJSON(); _this._transform = options.transform || {}; _this._transform.dataProjection = _this._transform.dataProjection || "EPSG:4326"; diff --git a/lib/layers/LayerBaseXyzTile.js b/lib/layers/LayerBaseXyzTile.js index 5e12cfb..82d511c 100644 --- a/lib/layers/LayerBaseXyzTile.js +++ b/lib/layers/LayerBaseXyzTile.js @@ -24,6 +24,10 @@ var _provide = require('../util/provide'); var _provide2 = _interopRequireDefault(_provide); +var _ol = require('../ol/ol'); + +var _ol2 = _interopRequireDefault(_ol); + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -38,7 +42,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * Created by gavorhes on 12/4/2015. */ -var ol = require('../ol/ol'); var nm = (0, _provide2.default)('layers'); /** @@ -73,8 +76,8 @@ var LayerBaseXyzTile = (function (_LayerBase) { var _this2 = _possibleConstructorReturn(this, Object.getPrototypeOf(LayerBaseXyzTile).call(this, url, options)); - _this2._source = new ol.source.XYZ({ url: _this2.url == '' ? undefined : _this2.url }); - _this2.olLayer = new ol.layer.Tile({ + _this2._source = new _ol2.default.source.XYZ({ url: _this2.url == '' ? undefined : _this2.url }); + _this2.olLayer = new _ol2.default.layer.Tile({ source: _this2._source, visible: _this2.visible, opacity: _this2.opacity, diff --git a/lib/layers/LayerEsriMapServer.js b/lib/layers/LayerEsriMapServer.js index 08153c1..59f01c7 100644 --- a/lib/layers/LayerEsriMapServer.js +++ b/lib/layers/LayerEsriMapServer.js @@ -28,6 +28,10 @@ var _provide = require('../util/provide'); var _provide2 = _interopRequireDefault(_provide); +var _ol = require('../ol/ol'); + +var _ol2 = _interopRequireDefault(_ol); + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -40,7 +44,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * Created by gavorhes on 12/7/2015. */ -var ol = require('../ol/ol'); var nm = (0, _provide2.default)('layers'); /** @@ -75,9 +78,9 @@ var LayerEsriMapServer = (function (_LayerBase) { var _this2 = _possibleConstructorReturn(this, Object.getPrototypeOf(LayerEsriMapServer).call(this, url, options)); - _this2._source = new ol.source.TileArcGISRest({ url: _this2.url == '' ? undefined : _this2.url }); + _this2._source = new _ol2.default.source.TileArcGISRest({ url: _this2.url == '' ? undefined : _this2.url }); - _this2.olLayer = new ol.layer.Tile({ + _this2.olLayer = new _ol2.default.layer.Tile({ source: _this2._source, visible: _this2.visible, opacity: _this2.opacity, @@ -88,7 +91,7 @@ var LayerEsriMapServer = (function (_LayerBase) { options.addPopup = typeof options.addPopup == 'boolean' ? options.addPopup : false; - _this2._esriFormat = new ol.format.EsriJSON(); + _this2._esriFormat = new _ol2.default.format.EsriJSON(); _this2._popupRequest = null; _this2.addLegendContent(); diff --git a/lib/layers/LayerItsInventory.js b/lib/layers/LayerItsInventory.js index 978a93b..f54f6ba 100644 --- a/lib/layers/LayerItsInventory.js +++ b/lib/layers/LayerItsInventory.js @@ -28,6 +28,10 @@ var _provide = require('../util/provide'); var _provide2 = _interopRequireDefault(_provide); +var _ol = require('../ol/ol'); + +var _ol2 = _interopRequireDefault(_ol); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -40,7 +44,6 @@ function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.const * Created by gavorhes on 12/8/2015. */ -var ol = require('../ol/ol'); var nm = (0, _provide2.default)('layers'); function checkStyleNumber(itsIcon, itsLineStyle, itsIconConfig, itsLineConfig) { @@ -123,12 +126,12 @@ function defineStyle(itsIcon, itsLineStyle, itsIconConfig, itsLineConfig) { var _iconUrlRoot = 'http://transportal.cee.wisc.edu/its/inventory/icons/'; if (itsIcon) { - return new ol.style.Style({ - image: new ol.style.Icon({ src: _iconUrlRoot + itsIcon }) + return new _ol2.default.style.Style({ + image: new _ol2.default.style.Icon({ src: _iconUrlRoot + itsIcon }) }); } else if (itsLineStyle) { - return new ol.style.Style({ - stroke: new ol.style.Stroke({ + return new _ol2.default.style.Style({ + stroke: new _ol2.default.style.Stroke({ color: itsLineStyle.color, width: itsLineStyle.width }) @@ -147,8 +150,8 @@ function defineStyle(itsIcon, itsLineStyle, itsIconConfig, itsLineConfig) { } } - return [new ol.style.Style({ - image: new ol.style.Icon({ src: iconUrl }) + return [new _ol2.default.style.Style({ + image: new _ol2.default.style.Icon({ src: iconUrl }) })]; }; } else if (itsLineConfig) { @@ -167,8 +170,8 @@ function defineStyle(itsIcon, itsLineStyle, itsIconConfig, itsLineConfig) { } } - return [new ol.style.Style({ - stroke: new ol.style.Stroke({ + return [new _ol2.default.style.Style({ + stroke: new _ol2.default.style.Stroke({ color: colr, width: width }) @@ -386,10 +389,10 @@ var LayerItsInventory = (function (_LayerBaseVectorGeoJs) { key: 'mapMoveMakeGetParams', value: function mapMoveMakeGetParams(extent, zoomLevel) { _get(Object.getPrototypeOf(LayerItsInventory.prototype), 'mapMoveMakeGetParams', this).call(this, extent, zoomLevel); - var lowerLeft = new ol.geom.Point([extent.minX, extent.minY]); + var lowerLeft = new _ol2.default.geom.Point([extent.minX, extent.minY]); lowerLeft.transform(this.mapCrs, "EPSG:4326"); var lowerLeftCoordinates = lowerLeft.getCoordinates(); - var upperRight = new ol.geom.Point([extent.maxX, extent.maxY]); + var upperRight = new _ol2.default.geom.Point([extent.maxX, extent.maxY]); upperRight.transform(this.mapCrs, "EPSG:4326"); var upperRightCoordinates = upperRight.getCoordinates(); diff --git a/lib/olHelpers/esriToOlStyle.js b/lib/olHelpers/esriToOlStyle.js index e8ef5b9..da6cfbc 100644 --- a/lib/olHelpers/esriToOlStyle.js +++ b/lib/olHelpers/esriToOlStyle.js @@ -10,6 +10,10 @@ var _provide = require('../util/provide'); var _provide2 = _interopRequireDefault(_provide); +var _ol = require('../ol/ol'); + +var _ol2 = _interopRequireDefault(_ol); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } @@ -20,7 +24,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * Created by gavorhes on 1/4/2016. */ -var ol = require('../ol/ol'); var nm = (0, _provide2.default)('olHelpers.esriToOlStyle'); /** @@ -85,20 +88,20 @@ var PointSymbol = (function (_CommonSymbol) { var outlineWidth = _this2.symbolObj.outline.width; var radius = _this2.symbolObj.size; - _this2.olStyle = new ol.style.Style({ - image: new ol.style.Circle({ + _this2.olStyle = new _ol2.default.style.Style({ + image: new _ol2.default.style.Circle({ radius: radius, - fill: new ol.style.Fill({ + fill: new _ol2.default.style.Fill({ color: innerColor }), - stroke: new ol.style.Stroke({ color: outerColor, width: outlineWidth }) + stroke: new _ol2.default.style.Stroke({ color: outerColor, width: outlineWidth }) }) }); _this2.legendHtml = '<span class="legend-layer-icon" style="color: ' + innerColor + '">●</span>'; break; case 'esriPMS': - _this2.olStyle = new ol.style.Style({ - image: new ol.style.Icon({ src: 'data:image/png;base64,' + _this2.symbolObj['imageData'] }) + _this2.olStyle = new _ol2.default.style.Style({ + image: new _ol2.default.style.Icon({ src: 'data:image/png;base64,' + _this2.symbolObj['imageData'] }) }); _this2.legendHtml = '<img class="legend-layer-icon" height="17" src="data:image/png;base64,' + _this2.symbolObj['imageData'] + '">'; break; @@ -125,8 +128,8 @@ var LineSymbol = (function (_CommonSymbol2) { var innerColor = _colorArrayToRgba(_this3.symbolObj.color, _this3.opacity); var lineWidth = _this3.symbolObj.width; - _this3.olStyle = new ol.style.Style({ - stroke: new ol.style.Stroke({ + _this3.olStyle = new _ol2.default.style.Style({ + stroke: new _ol2.default.style.Stroke({ color: innerColor, //lineDash: [4], width: lineWidth @@ -167,13 +170,13 @@ var PolygonSymbol = (function (_CommonSymbol3) { var outerColor = _colorArrayToRgba(_this4.symbolObj.outline.color, _this4.opacity); var outlineWidth = _this4.symbolObj.outline.width; - _this4.olStyle = new ol.style.Style({ - stroke: new ol.style.Stroke({ + _this4.olStyle = new _ol2.default.style.Style({ + stroke: new _ol2.default.style.Stroke({ color: outerColor, //lineDash: [4], width: outlineWidth }), - fill: new ol.style.Fill({ + fill: new _ol2.default.style.Fill({ color: innerColor }) }); diff --git a/lib/olHelpers/mapPopupCls.js b/lib/olHelpers/mapPopupCls.js index 9ef60e8..1548f5b 100644 --- a/lib/olHelpers/mapPopupCls.js +++ b/lib/olHelpers/mapPopupCls.js @@ -26,6 +26,10 @@ var _provide = require('../util/provide'); var _provide2 = _interopRequireDefault(_provide); +var _ol = require('../ol/ol'); + +var _ol2 = _interopRequireDefault(_ol); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } @@ -34,7 +38,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var ol = require('../ol/ol'); var nm = (0, _provide2.default)('olHelpers'); var _FeatureLayerProperties = (function () { @@ -167,7 +170,7 @@ var MapPopupCls = (function (_MapInteractionBase) { this._$popupContent = $map.find('.popup-content'); this._$popupCloser = $map.find('.ol-popup-closer'); - this._popupOverlay = new ol.Overlay({ + this._popupOverlay = new _ol2.default.Overlay({ element: this._$popupContainer[0], autoPan: true, autoPanAnimation: { @@ -490,24 +493,24 @@ var MapPopupCls = (function (_MapInteractionBase) { if (selectionStyle.olStyle) { theStyle = selectionStyle.olStyle; } else { - theStyle = new ol.style.Style({ - stroke: new ol.style.Stroke({ + theStyle = new _ol2.default.style.Style({ + stroke: new _ol2.default.style.Stroke({ color: selectionStyle.color, width: selectionStyle.width }), - image: new ol.style.Circle({ + image: new _ol2.default.style.Circle({ radius: 7, - fill: new ol.style.Fill({ color: selectionStyle.color }), - stroke: new ol.style.Stroke({ color: selectionStyle.color, width: 1 }) + fill: new _ol2.default.style.Fill({ color: selectionStyle.color }), + stroke: new _ol2.default.style.Stroke({ color: selectionStyle.color, width: 1 }) }), - fill: new ol.style.Fill({ + fill: new _ol2.default.style.Fill({ color: selectionStyle.color }) }); } - var selectionLayer = new ol.layer.Vector({ - source: new ol.source.Vector(), + var selectionLayer = new _ol2.default.layer.Vector({ + source: new _ol2.default.source.Vector(), style: theStyle, zIndex: 100 }); diff --git a/lib/olHelpers/quickMapBase.js b/lib/olHelpers/quickMapBase.js index c515f25..d826f96 100644 --- a/lib/olHelpers/quickMapBase.js +++ b/lib/olHelpers/quickMapBase.js @@ -20,17 +20,12 @@ var _mapPopup = require('./mapPopup'); var _mapPopup2 = _interopRequireDefault(_mapPopup); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _ol = require('../ol/ol'); -/** - * Created by gavorhes on 3/25/2016. - */ +var _ol2 = _interopRequireDefault(_ol); -/** - * Created by gavorhes on 12/15/2015. - */ +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var ol = require('../ol/ol'); var nm = (0, _provide2.default)('olHelpers'); /** @@ -48,6 +43,14 @@ var nm = (0, _provide2.default)('olHelpers'); * @param {boolean} [options.baseSwitcher=true] if add base map switcher * @returns {ol.Map} the ol map */ +/** + * Created by gavorhes on 3/25/2016. + */ + +/** + * Created by gavorhes on 12/15/2015. + */ + function quickMapBase(options) { options = options || {}; options.divId = options.divId || 'map'; @@ -60,8 +63,8 @@ function quickMapBase(options) { var $mapDiv = (0, _jquery2.default)('#' + options.divId); $mapDiv.css('position', 'relative'); - var osmLayer = new ol.layer.Tile({ source: new ol.source.OSM() }); - var satLayer = new ol.layer.Tile({ visible: false, source: new ol.source.MapQuest({ layer: 'sat' }) }); + var osmLayer = new _ol2.default.layer.Tile({ source: new _ol2.default.source.OSM() }); + var satLayer = new _ol2.default.layer.Tile({ visible: false, source: new _ol2.default.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+E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JkBKJUJNK0lLLEJMMkVMPEpONENSLUdZL0pTLkpaLkRUMkRSPEVZMktUM0pVOklZMklZNEpcNU1ZMk1ZNUxfMk5dNkxcOVFUM1RUOFJbNVFZOVNYPVFdOVJdPFVaOVVaPVVdOlVdPVpaNlpdO0phN01hOlBiN1NhPFNoP1piPWFbPmRjPENOQEtPSURTQkJVS0xVQk1VSkxbQkxcS0heUVFXRFRcQlJfTFxeQlpeS05lQk1kSFRjQVRjSlZpQ1tkQlxlSlxpRF1rSVVnUVtlU1llXF9tU1xoXlxwSl9ramRfQmJlQ2FhSWFlSWFlTmVlSWRmTGFoQWFpRWFsRmVpRWVtRmNsSmtlRGpqRmpsS2BmWGRsUmFrW2ptUmZyR2RxTGpxTWVyU2RyW2d5V2tzUmt0WW15VG15WXFuTHNtVnFxTXF4T3h0TnJzUnJ1XHJ4VXN6Wnp0VHx1W315VXp8XGR0YGx0YHVzZXJ0aHR9ZXV+aHl9YHOCXXqBXXeCYHyCY3iEaHyIYn+JaXqKcYB5WIN6Y4SCXoCDZIGEaYCIZoOLa4iCaImJbIOOdYuMco6OeIuVcpOKbZKPc5aQb5eXe5ufg6KjhAAAAAAAAAAAAAAAAOGCeQgAAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGHRFWHRTb2Z0d2FyZQBwYWludC5uZXQgNC4wLjlsM35OAAAH80lEQVRISy1WbXQUVxm+6wqnk3Zmpxl2FG2EGg92C8GDlWptVTwa+uF3xcKmDfFzCUzDsJNsunXipglJXJbrtJWmwZNSnHD3jojRgUIm2UumIZ0JZ7JByrALbMWW0IBW8aRa4+cf76TeX3Nm3uc+z/s+7/vugl4r/aMTrT4e1pPTqnnmJNn5AyUzRnrRle/qE33dsvrBtAQVoxtpZNK3zSzYjUjviWO2Ag+R77dl7W36n/1Ep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uTJ43/+FZrk2cvAFRipCKdfD9y2+pjRj78s0KdCUDKJvdV91ChngV38T20TM+gghjpJaPlpFr2xbEz5g4A/NGt5rNwdwmYGeeeMXBSLHHUIc+6RsojRH9VTUm3/mLf/64b470XvoxoTKhlMBQ2jMEzo2PjxdGMppmn1RM24bWFJqaQv4BcuJa2Sam7Zokq1ldCsz06NCBHrhwqVQYpfFj42NZexz1EW9SR/kT58nEeQKJb2fPXjjp0u/YUkwHEgLeOnf2nOuf1TRTM02CLKLTPy60/x1CCztqn7Ev+BdsC3m+30decQvW/wBNTwU+CfUQAQAAAABJRU5ErkJggg==')"; @@ -92,20 +95,20 @@ function quickMapBase(options) { } 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]); + var p = new _ol2.default.geom.Point([options.center.x, options.center.y]); p.transform("EPSG:4326", "EPSG:3857"); var coordinates = p.getCoordinates(); options.center.x = coordinates[0]; options.center.y = coordinates[1]; } - return new ol.Map({ + return new _ol2.default.Map({ layers: [osmLayer, satLayer], target: options.divId, - controls: ol.control.defaults({ + controls: _ol2.default.control.defaults({ attributionOptions: { collapsible: false } }), - view: new ol.View({ + view: new _ol2.default.View({ center: [options.center.x, options.center.y], zoom: options.zoom, minZoom: options.minZoom, diff --git a/package.json b/package.json index 84a2b77..416b50f 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "lint": "eslint src/**/*.js", "jsdoc": "jsdoc -r -d doc src", "src2lib": "babel src --out-dir lib --ignore ol-build.js --presets es2015 --plugins add-module-exports & COPY /Y src\\ol\\ol-build.js lib\\ol\\ol-build.js", - "copy": "xcopy /y /s src ..\\..\\src" + "copy": "xcopy /y /s src ..\\..\\src\\" }, "author": "TOPS Lab", "license": "ISC", diff --git a/src/jquery-plugin/rp-picker.js b/src/jquery-plugin/rp-picker.js index a4aa182..db6df9d 100644 --- a/src/jquery-plugin/rp-picker.js +++ b/src/jquery-plugin/rp-picker.js @@ -5,7 +5,7 @@ import SortedFeatures from '../olHelpers/SortedFeatures'; import LayerBaseVectorGeoJson from '../layers/LayerBaseVectorGeoJson'; import LayerEsriMapServer from '../layers/LayerEsriMapServer'; import provide from '../util/provide'; -const ol = require('../ol/ol'); +import ol from '../ol/ol'; const nm = provide('ssa'); /** diff --git a/src/jquery-plugin/ssa-corridor-picker.js b/src/jquery-plugin/ssa-corridor-picker.js index 229f06a..ba3aa05 100644 --- a/src/jquery-plugin/ssa-corridor-picker.js +++ b/src/jquery-plugin/ssa-corridor-picker.js @@ -6,7 +6,7 @@ import LayerBaseVectorEsri from '../layers/LayerBaseVectorEsri'; import LayerBaseVectorGeoJson from '../layers/LayerBaseVectorGeoJson'; import LayerEsriMapServer from '../layers/LayerEsriMapServer'; import provide from '../util/provide'; -const ol = require('../ol/ol'); +import ol from '../ol/ol'; const nm = provide('ssa'); diff --git a/src/layers/LayerBaseVector.js b/src/layers/LayerBaseVector.js index 820c484..2825b49 100644 --- a/src/layers/LayerBaseVector.js +++ b/src/layers/LayerBaseVector.js @@ -2,7 +2,7 @@ import $ from '../jquery'; import LayerBase from './LayerBase'; import mapMove from '../olHelpers/mapMove'; import provide from '../util/provide'; -const ol = require('../ol/ol'); +import ol from '../ol/ol'; const nm = provide('layers'); /** diff --git a/src/layers/LayerBaseVectorEsri.js b/src/layers/LayerBaseVectorEsri.js index 786b4f7..b21cb25 100644 --- a/src/layers/LayerBaseVectorEsri.js +++ b/src/layers/LayerBaseVectorEsri.js @@ -7,7 +7,7 @@ import LayerBaseVector from './LayerBaseVector'; import * as esriToOl from '../olHelpers/esriToOlStyle'; import mapMove from '../olHelpers/mapMove'; import provide from '../util/provide'; -const ol = require('../ol/ol'); +import ol from '../ol/ol'; let nm = provide('layers'); diff --git a/src/layers/LayerBaseVectorGeoJson.js b/src/layers/LayerBaseVectorGeoJson.js index f975d7b..4af2f3e 100644 --- a/src/layers/LayerBaseVectorGeoJson.js +++ b/src/layers/LayerBaseVectorGeoJson.js @@ -5,7 +5,7 @@ import $ from '../jquery'; import LayerBaseVector from './LayerBaseVector'; import provide from '../util/provide'; -const ol = require('../ol/ol'); +import ol from '../ol/ol'; let nm = provide('layers'); /** diff --git a/src/layers/LayerBaseXyzTile.js b/src/layers/LayerBaseXyzTile.js index 823a0a4..cbe3da7 100644 --- a/src/layers/LayerBaseXyzTile.js +++ b/src/layers/LayerBaseXyzTile.js @@ -5,7 +5,7 @@ import $ from '../jquery'; import LayerBase from './LayerBase'; import * as esriToOl from '../olHelpers/esriToOlStyle'; import provide from '../util/provide'; -const ol = require('../ol/ol'); +import ol from '../ol/ol'; const nm = provide('layers'); /** diff --git a/src/layers/LayerEsriMapServer.js b/src/layers/LayerEsriMapServer.js index 8aabdee..2bb4181 100644 --- a/src/layers/LayerEsriMapServer.js +++ b/src/layers/LayerEsriMapServer.js @@ -6,7 +6,7 @@ import LayerBase from './LayerBase'; import * as esriToOl from '../olHelpers/esriToOlStyle'; import mapPopup from '../olHelpers/mapPopup'; import provide from '../util/provide'; -const ol = require('../ol/ol'); +import ol from '../ol/ol'; const nm = provide('layers'); /** diff --git a/src/layers/LayerItsInventory.js b/src/layers/LayerItsInventory.js index fbf27c9..1682ea9 100644 --- a/src/layers/LayerItsInventory.js +++ b/src/layers/LayerItsInventory.js @@ -7,7 +7,7 @@ import LayerBaseVectorGeoJson from './LayerBaseVectorGeoJson'; import mapMove from '../olHelpers/mapMove'; import mapPopup from '../olHelpers/mapPopup'; import provide from '../util/provide'; -const ol = require('../ol/ol'); +import ol from '../ol/ol'; let nm = provide('layers'); diff --git a/src/olHelpers/esriToOlStyle.js b/src/olHelpers/esriToOlStyle.js index 0b3cfa7..48bacdb 100644 --- a/src/olHelpers/esriToOlStyle.js +++ b/src/olHelpers/esriToOlStyle.js @@ -2,7 +2,7 @@ * Created by gavorhes on 1/4/2016. */ import provide from '../util/provide'; -const ol = require('../ol/ol'); +import ol from '../ol/ol'; const nm = provide('olHelpers.esriToOlStyle'); /** diff --git a/src/olHelpers/mapPopupCls.js b/src/olHelpers/mapPopupCls.js index e8891a1..a9647c0 100644 --- a/src/olHelpers/mapPopupCls.js +++ b/src/olHelpers/mapPopupCls.js @@ -6,7 +6,9 @@ import $ from '../jquery'; import MapInteractionBase from './mapInteractionBase'; import propertiesZoomStyle from '../olHelpers/propertiesZoomStyle'; import provide from '../util/provide'; -const ol = require('../ol/ol'); +import ol from '../ol/ol'; + + const nm = provide('olHelpers'); diff --git a/src/olHelpers/quickMapBase.js b/src/olHelpers/quickMapBase.js index 890eb6c..e40cff8 100644 --- a/src/olHelpers/quickMapBase.js +++ b/src/olHelpers/quickMapBase.js @@ -10,10 +10,9 @@ import $ from '../jquery'; import provide from '../util/provide'; import mapMove from './mapMove'; import mapPopup from './mapPopup'; -const ol = require('../ol/ol'); +import ol from '../ol/ol'; const nm = provide('olHelpers'); - /** * Sets up a map with some default parameters and initializes * mapMove and mapPopup -- GitLab