Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

716 - Remove full OL import #4409

Merged
merged 1 commit into from
Nov 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contribs/gmf/apps/desktop/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import gmfControllersAbstractDesktopController from 'gmf/controllers/AbstractDes
import appBase from '../appmodule.js';
import EPSG2056 from '@geoblocks/proj/src/EPSG_2056.js';
import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js';
import * as olBase from 'ol/index.js';
import {inherits as olUtilInherits} from 'ol/util.js';
import Raven from 'raven-js/src/raven.js';
import RavenPluginsAngular from 'raven-js/plugins/angular.js';

Expand Down Expand Up @@ -115,7 +115,7 @@ const exports = function($scope, $injector) {
}
};

olBase.inherits(exports, gmfControllersAbstractDesktopController);
olUtilInherits(exports, gmfControllersAbstractDesktopController);

exports.module = angular.module('Appdesktop', [
appBase.module.name,
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/apps/desktop_alt/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import ngeoRoutingModule from 'ngeo/routing/module.js';
import EPSG2056 from '@geoblocks/proj/src/EPSG_2056.js';
import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js';
import ngeoStatemanagerWfsPermalink from 'ngeo/statemanager/WfsPermalink.js';
import * as olBase from 'ol/index.js';
import {inherits as olUtilInherits} from 'ol/util.js';
import Raven from 'raven-js/src/raven.js';
import RavenPluginsAngular from 'raven-js/plugins/angular.js';

Expand Down Expand Up @@ -146,7 +146,7 @@ const exports = function($scope, $injector, ngeoFile, gettext, $q) {
}
};

olBase.inherits(exports, gmfControllersAbstractDesktopController);
olUtilInherits(exports, gmfControllersAbstractDesktopController);


/**
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/apps/iframe_api/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import gmfControllersAbstractAPIController from 'gmf/controllers/AbstractAPICont
import appBase from '../appmodule.js';
import EPSG2056 from '@geoblocks/proj/src/EPSG_2056.js';
import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js';
import * as olBase from 'ol/index.js';
import {inherits as olUtilInherits} from 'ol/util.js';
import Raven from 'raven-js/src/raven.js';
import RavenPluginsAngular from 'raven-js/plugins/angular.js';

Expand Down Expand Up @@ -54,7 +54,7 @@ const exports = function($scope, $injector) {
}
};

olBase.inherits(exports, gmfControllersAbstractAPIController);
olUtilInherits(exports, gmfControllersAbstractAPIController);

exports.module = angular.module('Appiframe_api', [
appBase.module.name,
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/apps/mobile/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'gmf/controllers/mobile.scss';
import appBase from '../appmodule.js';
import EPSG2056 from '@geoblocks/proj/src/EPSG_2056.js';
import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js';
import * as olBase from 'ol/index.js';
import {inherits as olUtilInherits} from 'ol/util.js';
import Raven from 'raven-js/src/raven.js';
import RavenPluginsAngular from 'raven-js/plugins/angular.js';

Expand Down Expand Up @@ -67,7 +67,7 @@ const exports = function($scope, $injector) {
}
};

olBase.inherits(exports, gmfControllersAbstractMobileController);
olUtilInherits(exports, gmfControllersAbstractMobileController);

exports.module = angular.module('Appmobile', [
appBase.module.name,
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/apps/mobile_alt/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import './sass/mobile_alt.scss';
import appBase from '../appmodule.js';
import EPSG2056 from '@geoblocks/proj/src/EPSG_2056.js';
import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js';
import * as olBase from 'ol/index.js';
import {inherits as olUtilInherits} from 'ol/util.js';
import olStyleFill from 'ol/style/Fill.js';
import olStyleRegularShape from 'ol/style/RegularShape.js';
import olStyleStroke from 'ol/style/Stroke.js';
Expand Down Expand Up @@ -104,7 +104,7 @@ const exports = function($scope, $injector) {
}
};

olBase.inherits(exports, gmfControllersAbstractMobileController);
olUtilInherits(exports, gmfControllersAbstractMobileController);


exports.module = angular.module('Appmobile_alt', [
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/apps/oeedit/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import gmfObjecteditingModule from 'gmf/objectediting/module.js';
import ngeoMiscToolActivate from 'ngeo/misc/ToolActivate.js';
import EPSG2056 from '@geoblocks/proj/src/EPSG_2056.js';
import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js';
import * as olBase from 'ol/index.js';
import {inherits as olUtilInherits} from 'ol/util.js';
import olCollection from 'ol/Collection.js';
import olLayerVector from 'ol/layer/Vector.js';
import olSourceVector from 'ol/source/Vector.js';
Expand Down Expand Up @@ -218,7 +218,7 @@ const exports = function($scope, $injector, $timeout) {
}
};

olBase.inherits(exports, gmfControllersAbstractDesktopController);
olUtilInherits(exports, gmfControllersAbstractDesktopController);

exports.module = angular.module('Appoeedit', [
appBase.module.name,
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/apps/oeview/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import './sass/oeview.scss';
import appBase from '../appmodule.js';
import EPSG2056 from '@geoblocks/proj/src/EPSG_2056.js';
import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js';
import * as olBase from 'ol/index.js';
import {inherits as olUtilInherits} from 'ol/util.js';
import Raven from 'raven-js/src/raven.js';
import RavenPluginsAngular from 'raven-js/plugins/angular.js';

Expand Down Expand Up @@ -109,7 +109,7 @@ const exports = function($scope, $injector) {
}
};

olBase.inherits(exports, gmfControllersAbstractDesktopController);
olUtilInherits(exports, gmfControllersAbstractDesktopController);

exports.module = angular.module('Appoeview', [
appBase.module.name,
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/src/controllers/AbstractAPIController.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import gmfControllersAbstractAppController from 'gmf/controllers/AbstractAppController.js';
import ngeoQueryBboxQueryComponent from 'ngeo/query/bboxQueryComponent.js';
import ngeoMapResizemap from 'ngeo/map/resizemap.js';
import * as olBase from 'ol/index.js';
import {inherits as olUtilInherits} from 'ol/util.js';
import * as olProj from 'ol/proj.js';
import * as olObj from 'ol/obj.js';
import olMap from 'ol/Map.js';
Expand Down Expand Up @@ -70,7 +70,7 @@ const exports = function(config, $scope, $injector) {
gmfControllersAbstractAppController.call(this, config, $scope, $injector);
};

olBase.inherits(exports, gmfControllersAbstractAppController);
olUtilInherits(exports, gmfControllersAbstractAppController);


exports.module = angular.module('GmfAbstractAPIControllerModule', [
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/src/controllers/AbstractDesktopController.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import gmfRasterComponent from 'gmf/raster/component.js';
import ngeoDrawFeatures from 'ngeo/draw/features.js';
import ngeoMiscToolActivate from 'ngeo/misc/ToolActivate.js';
import gmfImportModule from 'gmf/import/module.js';
import * as olBase from 'ol/index.js';
import {inherits as olUtilInherits} from 'ol/util.js';
import olCollection from 'ol/Collection.js';
import * as olEvents from 'ol/events.js';
import olLayerVector from 'ol/layer/Vector.js';
Expand Down Expand Up @@ -233,7 +233,7 @@ const exports = function(config, $scope, $injector) {
this.setDataPanelMaxResizableWidth_();
};

olBase.inherits(exports, gmfControllersAbstractAPIController);
olUtilInherits(exports, gmfControllersAbstractAPIController);

/**
* Set the data panel (on the left) maximum resizable width depending
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/src/controllers/AbstractMobileController.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import gmfMobileMeasureModule from 'gmf/mobile/measure/module.js';
import gmfMobileNavigationModule from 'gmf/mobile/navigation/module.js';
import gmfQueryWindowComponent from 'gmf/query/windowComponent.js';
import ngeoGeolocationMobile from 'ngeo/geolocation/mobile.js';
import * as olBase from 'ol/index.js';
import {inherits as olUtilInherits} from 'ol/util.js';
import * as olObj from 'ol/obj.js';
import * as olProj from 'ol/proj.js';
import olMap from 'ol/Map.js';
Expand Down Expand Up @@ -142,7 +142,7 @@ const exports = function(config, $scope, $injector) {
this.redirectUrl = $injector.get('redirectUrl');
};

olBase.inherits(exports, gmfControllersAbstractAppController);
olUtilInherits(exports, gmfControllersAbstractAppController);


/**
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/src/datasource/ExternalDataSourcesManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ngeoDatasourceFileGroup from 'ngeo/datasource/FileGroup.js';
import ngeoDatasourceOGC from 'ngeo/datasource/OGC.js';
import ngeoDatasourceOGCGroup from 'ngeo/datasource/OGCGroup.js';
import ngeoDatasourceWMSGroup from 'ngeo/datasource/WMSGroup.js';
import * as olBase from 'ol/index.js';
import {getUid as olUtilGetUid} from 'ol/util.js';
import {isEmpty} from 'ol/extent.js';
import * as olEvents from 'ol/events.js';
import olCollection from 'ol/Collection.js';
Expand Down Expand Up @@ -678,7 +678,7 @@ const exports = class {
* @export
*/
exports.getId = function(layer) {
return olBase.getUid(layer) + 1000000;
return olUtilGetUid(layer) + 1000000;
};


Expand Down
20 changes: 10 additions & 10 deletions contribs/gmf/src/datasource/Manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import ngeoFilterRuleHelper from 'ngeo/filter/RuleHelper.js';
import ngeoMapBackgroundLayerMgr from 'ngeo/map/BackgroundLayerMgr.js';
import ngeoMapLayerHelper from 'ngeo/map/LayerHelper.js';
import ngeoMiscWMSTime from 'ngeo/misc/WMSTime.js';
import * as olBase from 'ol/index.js';
import {getUid as olUtilGetUid} from 'ol/util.js';
import * as olEvents from 'ol/events.js';
import olLayerTile from 'ol/layer/Tile.js';
import * as olObj from 'ol/obj.js';
Expand Down Expand Up @@ -240,7 +240,7 @@ const exports = class {
if (layer == undefined) {
return;
}
const id = olBase.getUid(layer);
const id = olUtilGetUid(layer);
if (layerIds.indexOf(id) == -1) {
layers.push(layer);
layerIds.push(id);
Expand Down Expand Up @@ -416,7 +416,7 @@ const exports = class {
const gmfLayer = /** @type gmfThemes.GmfLayer */ (node);

// (2) Skip layer node if a data source with the same id exists
const id = olBase.getUid(gmfLayer);
const id = olUtilGetUid(gmfLayer);
if (this.dataSourcesCache_[id]) {
return;
}
Expand Down Expand Up @@ -583,7 +583,7 @@ const exports = class {
*/
addTreeCtrlToCache_(treeCtrl) {

const id = olBase.getUid(treeCtrl.node);
const id = olUtilGetUid(treeCtrl.node);
const dataSource = this.dataSourcesCache_[id];
googAsserts.assert(dataSource, 'DataSource should be set');
treeCtrl.setDataSource(dataSource);
Expand Down Expand Up @@ -666,7 +666,7 @@ const exports = class {
if (item.timeUpperValueWatcherUnregister) {
item.timeUpperValueWatcherUnregister();
}
delete this.treeCtrlCache_[olBase.getUid(item.treeCtrl.node)];
delete this.treeCtrlCache_[olUtilGetUid(item.treeCtrl.node)];
}

/**
Expand Down Expand Up @@ -718,7 +718,7 @@ const exports = class {
* @private
*/
getTreeCtrlCacheItem_(treeCtrl) {
return this.treeCtrlCache_[olBase.getUid(treeCtrl.node)] || null;
return this.treeCtrlCache_[olUtilGetUid(treeCtrl.node)] || null;
}

/**
Expand All @@ -729,7 +729,7 @@ const exports = class {
*/
getDataSourceLayer_(dataSource) {
dataSource = /** @type {!gmf.DataSource} */ (dataSource);
const id = olBase.getUid(dataSource.gmfLayer);
const id = olUtilGetUid(dataSource.gmfLayer);
const item = this.treeCtrlCache_[id];
if (item == undefined) {
return;
Expand Down Expand Up @@ -773,10 +773,10 @@ const exports = class {
if (dsLayer == undefined) {
continue;
}
if (olBase.getUid(dsLayer) == olBase.getUid(layer) &&
if (olUtilGetUid(dsLayer) == olUtilGetUid(layer) &&
dataSourceName === dataSource.name) {

const id = olBase.getUid(dataSource.gmfLayer);
const id = olUtilGetUid(dataSource.gmfLayer);
const item = this.treeCtrlCache_[id];
googAsserts.assert(item);
const treeCtrl = item.treeCtrl;
Expand Down Expand Up @@ -845,7 +845,7 @@ const exports = class {
*/
handleDataSourceTimeValueChange_(dataSource) {

const id = olBase.getUid(dataSource.gmfLayer);
const id = olUtilGetUid(dataSource.gmfLayer);
const item = this.treeCtrlCache_[id];
googAsserts.assert(item);
const wmsLayer = googAsserts.assert(item.wmsLayer);
Expand Down
6 changes: 3 additions & 3 deletions contribs/gmf/src/disclaimer/component.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @module gmf.disclaimer.component
*/
import * as olBase from 'ol/index.js';
import {getUid as olUtilGetUid} from 'ol/util.js';
import * as olEvents from 'ol/events.js';
import olLayerBase from 'ol/layer/Base.js';
import olLayerGroup from 'ol/layer/Group.js';
Expand Down Expand Up @@ -178,7 +178,7 @@ exports.Controller_.prototype.handleLayersRemove_ = function(evt) {
*/
exports.Controller_.prototype.registerLayer_ = function(layer) {

const layerUid = olBase.getUid(layer);
const layerUid = olUtilGetUid(layer);

if (layer instanceof olLayerGroup) {

Expand Down Expand Up @@ -226,7 +226,7 @@ exports.Controller_.prototype.registerLayer_ = function(layer) {
*/
exports.Controller_.prototype.unregisterLayer_ = function(layer) {

const layerUid = olBase.getUid(layer);
const layerUid = olUtilGetUid(layer);

if (layer instanceof olLayerGroup) {

Expand Down
6 changes: 3 additions & 3 deletions contribs/gmf/src/drawing/drawFeatureComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import ngeoMiscDecorate from 'ngeo/misc/decorate.js';
import ngeoMiscFeatureHelper from 'ngeo/misc/FeatureHelper.js';
import ngeoMiscToolActivate from 'ngeo/misc/ToolActivate.js';
import ngeoMiscToolActivateMgr from 'ngeo/misc/ToolActivateMgr.js';
import * as olBase from 'ol/index.js';
import {getUid as olUtilGetUid} from 'ol/util.js';
import * as olArray from 'ol/array.js';
import * as olEvents from 'ol/events.js';
import olCollection from 'ol/Collection.js';
Expand Down Expand Up @@ -406,8 +406,8 @@ exports.Controller_.prototype.unregisterInteractions_ = function() {
exports.Controller_.prototype.handleActiveChange_ = function(active) {

const keys = this.listenerKeys_;
const drawUid = ['draw-', olBase.getUid(this)].join('-');
const otherUid = ['other-', olBase.getUid(this)].join('-');
const drawUid = ['draw-', olUtilGetUid(this)].join('-');
const otherUid = ['other-', olUtilGetUid(this)].join('-');
const toolMgr = this.ngeoToolActivateMgr_;

if (active) {
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/src/drawing/featureStyleComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @module gmf.drawing.featureStyleComponent
*/
import googAsserts from 'goog/asserts.js';
import * as olBase from 'ol/index.js';
import {getUid as olUtilGetUid} from 'ol/util.js';
import * as olEvents from 'ol/events.js';
import ngeoFormatFeatureProperties from 'ngeo/format/FeatureProperties.js';

Expand Down Expand Up @@ -71,7 +71,7 @@ exports.Controller_ = function($scope, ngeoFeatureHelper) {
* @type {number}
* @export
*/
this.uid = olBase.getUid(this);
this.uid = olUtilGetUid(this);

/**
* @type {?ol.Feature}
Expand Down
6 changes: 3 additions & 3 deletions contribs/gmf/src/editing/Snapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import gmfLayertreeTreeManager from 'gmf/layertree/TreeManager.js';
import gmfThemeThemes from 'gmf/theme/Themes.js';
import googAsserts from 'goog/asserts.js';
import ngeoLayertreeController from 'ngeo/layertree/Controller.js';
import * as olBase from 'ol/index.js';
import {getUid as olUtilGetUid} from 'ol/util.js';
import * as olEvents from 'ol/events.js';
import olCollection from 'ol/Collection.js';
import olFormatWFS from 'ol/format/WFS.js';
Expand Down Expand Up @@ -219,7 +219,7 @@ exports.prototype.registerTreeCtrl_ = function(treeCtrl) {
if (snappingConfig) {
const wfsConfig = this.getWFSConfig_(treeCtrl);
if (wfsConfig) {
const uid = olBase.getUid(treeCtrl);
const uid = olUtilGetUid(treeCtrl);

const stateWatcherUnregister = this.rootScope_.$watch(
() => treeCtrl.getState(),
Expand Down Expand Up @@ -366,7 +366,7 @@ exports.prototype.getWFSConfig_ = function(treeCtrl) {
*/
exports.prototype.handleTreeCtrlStateChange_ = function(treeCtrl, newVal) {

const uid = olBase.getUid(treeCtrl);
const uid = olUtilGetUid(treeCtrl);
const item = this.cache_[uid];

// Note: a snappable treeCtrl can only be a leaf, therefore the only possible
Expand Down
Loading