Skip to content

Commit

Permalink
Merge pull request ngageoint#667 in WV/opensphere from ~ROTHM/opensph…
Browse files Browse the repository at this point in the history
…ere:THIN-12806 to master

* commit '079c36517fe29d9c5ed39247f9571170cab8d0f6':
  fix(build): address closure build errors
  • Loading branch information
rothmike committed Mar 19, 2019
2 parents dae46ab + 079c365 commit f1bbaf4
Show file tree
Hide file tree
Showing 49 changed files with 186 additions and 77 deletions.
2 changes: 1 addition & 1 deletion externs/os.externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ osx.map.CameraState;
* altitude: (number|undefined),
* center: (ol.Coordinate|undefined),
* duration: (number|undefined),
* flightMode: (os.FlightMode|undefined),
* flightMode: (os.map.FlightMode|undefined),
* positionCamera: (boolean|undefined),
* heading: (number|undefined),
* pitch: (number|undefined),
Expand Down
1 change: 0 additions & 1 deletion src/os/bearing/bearing.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
goog.provide('os.bearing');
goog.require('os.config.Settings');
goog.require('os.geo');
goog.require('os.net.Request');


Expand Down
14 changes: 10 additions & 4 deletions src/os/command/layerautorefreshcmd.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
goog.provide('os.command.LayerAutoRefresh');

goog.require('ol.source.Source');
goog.require('ol.source.UrlTile');
goog.require('os.command.ICommand');
goog.require('os.command.State');
goog.require('os.metrics');
goog.require('os.metrics.Metrics');
goog.require('os.source.Vector');



Expand Down Expand Up @@ -44,7 +49,7 @@ os.command.LayerAutoRefresh = function(layerId, value) {

/**
* Get the source from the layer id.
* @return {os.source.Vector|ol.source.UrlTile}
* @return {os.source.Vector|ol.source.Source|ol.source.UrlTile}
* @protected
*/
os.command.LayerAutoRefresh.prototype.getSource = function() {
Expand All @@ -56,7 +61,8 @@ os.command.LayerAutoRefresh.prototype.getSource = function() {
}

var source = layer.getSource();
if (!(source instanceof os.source.Vector || source instanceof ol.source.UrlTile) || !source.isRefreshEnabled()) {
if (!(source instanceof os.source.Vector || source instanceof ol.source.UrlTile) ||
!(/** @type {os.source.Vector|ol.source.UrlTile} */ (source).isRefreshEnabled())) {
this.state = os.command.State.ERROR;
this.details = 'Source for layer with id "' + this.layerId + '" does not support refresh.';
return null;
Expand All @@ -72,7 +78,7 @@ os.command.LayerAutoRefresh.prototype.getSource = function() {
os.command.LayerAutoRefresh.prototype.execute = function() {
this.state = os.command.State.EXECUTING;

var source = this.getSource();
var source = /** @type {os.source.Vector|ol.source.UrlTile} */ (this.getSource());
if (source) {
this.oldInterval = source.getRefreshInterval();

Expand All @@ -92,7 +98,7 @@ os.command.LayerAutoRefresh.prototype.execute = function() {
*/
os.command.LayerAutoRefresh.prototype.revert = function() {
this.state = os.command.State.REVERTING;
var source = this.getSource();
var source = /** @type {os.source.Vector|ol.source.UrlTile} */ (this.getSource());
if (source) {
source.setRefreshInterval(this.oldInterval);

Expand Down
3 changes: 2 additions & 1 deletion src/os/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ os.config.EventType = {
WILL_SAVE: 'willSave',
CLEARED: 'cleared',
SAVED: 'saved',
UPDATED: 'updated'
UPDATED: 'updated',
RELOADED: 'reloaded'
};


Expand Down
3 changes: 3 additions & 0 deletions src/os/config/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ goog.require('os.config.storage.ISettingsStorage');
goog.require('os.config.storage.SettingsStorageLoader');
goog.require('os.config.storage.SettingsStorageRegistry');
goog.require('os.events.SettingChangeEvent');
goog.require('os.metrics.Metrics');
goog.require('os.net.Request');
goog.require('os.object');
goog.require('os.storage');
Expand All @@ -41,6 +42,7 @@ goog.require('os.xt.Peer');
os.config.SettingsMessage;



/**
* Maintains application settings which are retrieved from different storage sources,
* (see {os.config.storage.SettingsStorageRegistry}), and merged to be accessible to the client. Also handles
Expand Down Expand Up @@ -321,6 +323,7 @@ os.config.Settings.prototype.onReload_ = function(config) {
}

this.toNotifyInternal_ = [];
this.dispatchEvent(new goog.events.Event(os.config.EventType.RELOADED));
};


Expand Down
1 change: 0 additions & 1 deletion src/os/config/storage/isettingsreadablestorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ os.config.storage.ISettingsReadableStorage.ID = 'os.config.storage.ISettingsRead
* @template T
*/
os.config.storage.ISettingsReadableStorage.prototype.getSettings;

21 changes: 18 additions & 3 deletions src/os/config/storage/settingsstorageregistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ goog.addSingletonGetter(os.config.storage.SettingsStorageRegistry);
os.config.storage.SettingsStorageRegistry.prototype.addStorage = function(storage, opt_index) {
goog.array.insertAt(this.availableReadStorages_, storage,
opt_index !== undefined ? opt_index : this.availableReadStorages_.length);
if (storage.writeType === os.config.storage.SettingsWritableStorageType.REMOTE) {
this.hasRemoteStorage = true;
if (os.implements(storage, os.config.storage.ISettingsWritableStorage.ID)) {
if ((/** @type {os.config.storage.ISettingsWritableStorage} */ (storage)).writeType ===
os.config.storage.SettingsWritableStorageType.REMOTE) {
this.hasRemoteStorage = true;
}
}
};

Expand Down Expand Up @@ -108,7 +111,8 @@ os.config.storage.SettingsStorageRegistry.prototype.updateWriteStorage_ = functi
for (var i = this.availableReadStorages_.length - 1; i >= 0; i--) {
var candidate = this.availableReadStorages_[i];
if (os.implements(candidate, os.config.storage.ISettingsWritableStorage.ID) &&
candidate.writeType === this.writeToType_ && candidate.canAccess) {
(/** @type {os.config.storage.ISettingsWritableStorage} */ (candidate)).writeType ===
this.writeToType_ && candidate.canAccess) {
writeTo = candidate;
break;
}
Expand Down Expand Up @@ -152,3 +156,14 @@ os.config.storage.SettingsStorageRegistry.prototype.getStoragesToClear = functio
}, this);
return /** @type {!Array.<!os.config.storage.ISettingsWritableStorage>} */ (writablesToClear);
};


/**
* Reset storage registry
*/
os.config.storage.SettingsStorageRegistry.prototype.reset = function() {
this.availableReadStorages_.length = 0;
this.writeToType_ = os.config.storage.SettingsWritableStorageType.LOCAL;
this.writeToStorage_ = null;
this.hasRemoteStorage = false;
};
1 change: 0 additions & 1 deletion src/os/data/areanode.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ goog.require('ol.events');
goog.require('os.command.AreaToggle');
goog.require('os.data.ISearchable');
goog.require('os.events.PropertyChangeEvent');
goog.require('os.feature');
goog.require('os.implements');
goog.require('os.structs.TriState');
goog.require('os.ui.menu.IMenuSupplier');
Expand Down
1 change: 1 addition & 0 deletions src/os/data/drawingfeaturenode.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
goog.provide('os.data.DrawingFeatureNode');

goog.require('os.mixin.object');
goog.require('os.ui.menu.IMenuSupplier');
goog.require('os.ui.menu.spatial');
goog.require('os.ui.node.drawingFeatureNodeUIDirective');
Expand Down
1 change: 1 addition & 0 deletions src/os/data/drawinglayernode.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ goog.require('os.data.DrawingFeatureNode');
goog.require('os.data.LayerNode');
goog.require('os.events.PropertyChangeEvent');
goog.require('os.fn');
goog.require('os.query.AreaManager');



Expand Down
1 change: 1 addition & 0 deletions src/os/data/layernode.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ goog.require('os.data.IExtent');
goog.require('os.data.ISearchable');
goog.require('os.events.PropertyChangeEvent');
goog.require('os.layer.LayerGroup');
goog.require('os.layer.Tile');
goog.require('os.layer.Vector');
goog.require('os.structs.TriState');
goog.require('os.ui.ILayerUIProvider');
Expand Down
6 changes: 4 additions & 2 deletions src/os/feature/feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ goog.require('ol.geom.Point');
goog.require('ol.geom.Polygon');
goog.require('ol.source.Vector');
goog.require('ol.source.VectorEventType');
goog.require('os');
goog.require('os.Fields');
goog.require('os.MapContainer');
goog.require('os.data.RecordField');
goog.require('os.geo');
goog.require('os.geom.Ellipse');
Expand Down Expand Up @@ -318,7 +320,7 @@ os.feature.createLineOfBearing = function(feature, opt_replace, opt_lobOpts) {
var center = ol.proj.toLonLat(geom.getFirstCoordinate(), os.map.PROJECTION);
var bearing = os.feature.getColumnValue(feature, opt_lobOpts.bearingColumn);
var length = opt_lobOpts.lengthType == 'column' ? // get from column unless manual
os.feature.getColumnValue(feature, opt_lobOpts.lengthColumn, 0) : 1;
os.feature.getColumnValue(feature, opt_lobOpts.lengthColumn, 0) : 1;
if (center && bearing != null && !isNaN(bearing) && length) {
// sanitize
bearing = bearing % 360;
Expand Down Expand Up @@ -394,7 +396,7 @@ os.feature.createLineOfBearing = function(feature, opt_replace, opt_lobOpts) {
lengthError = 1;
}
var cLengthError = os.math.convertUnits(lengthError, os.style.DEFAULT_UNITS, lengthErrorUnits) *
lengthErrorMultiplier;
lengthErrorMultiplier;
if (bearingError > 0 && bearingErrorMultiplier > 0) {
var plusPts = os.geo.interpolateArc(center, effectiveLength + cLengthError,
Math.min(bearingError * bearingErrorMultiplier * 2, 360), bearing);
Expand Down
1 change: 1 addition & 0 deletions src/os/file/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ goog.require('goog.net.jsloader');
goog.require('goog.userAgent');
goog.require('os.IPersistable');
goog.require('os.defines');
goog.require('os.file.mime.text');
goog.require('os.file.mime.zip');


Expand Down
4 changes: 1 addition & 3 deletions src/os/fn/fn.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ goog.provide('os.fn');
goog.require('ol.extent');
goog.require('ol.layer.Layer');
goog.require('os.extent');
goog.require('os.geo');


/**
Expand Down Expand Up @@ -39,7 +38,7 @@ os.fn.reduceExtentFromLayers = function(extent, layer) {

if (source instanceof ol.source.Vector ||
source instanceof ol.source.UrlTile) {
ex = source.getExtent();
ex = (/** @type {ol.source.Vector|ol.source.UrlTile} */ (source)).getExtent();
}
}

Expand Down Expand Up @@ -88,7 +87,6 @@ os.fn.mapFeatureToGeometry = function(feature) {
};



/**
* Map a tree node to a layer.
* @param {undefined|null|os.structs.ITreeNode} node The tree node.
Expand Down
4 changes: 2 additions & 2 deletions src/os/geo/geo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
goog.provide('os.geo');
goog.provide('os.geo.ParseConf');

goog.require('goog.math');
goog.require('goog.string');
goog.require('ol.geom.GeometryType');
goog.require('ol.geom.LineString');
Expand All @@ -10,6 +9,7 @@ goog.require('os.array');
goog.require('os.extent');
goog.require('os.geom.GeometryField');
goog.require('os.mixin.geometry');
goog.require('os.query.utils');


/**
Expand Down Expand Up @@ -2016,7 +2016,7 @@ os.geo.normalizePolygons = function(polys, opt_to) {
*/
os.geo.normalizeGeometryCoordinates = function(geometry, opt_to) {
if (geometry) {
if (geometry.get(os.geom.GeometryField.NORMALIZED) || os.query.isWorldQuery(geometry)) {
if (geometry.get(os.geom.GeometryField.NORMALIZED) || os.query.utils.isWorldQuery(geometry)) {
return false;
}

Expand Down
1 change: 1 addition & 0 deletions src/os/geo/jsts.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ os.geo.jsts.convertFromCoordinate = function(coord) {
};



/**
* Utility class to translate between OL3 and JSTS geometries. This was copied from JSTS so the instanceof calls would
* still work with compiled code.
Expand Down
1 change: 1 addition & 0 deletions src/os/geom/ellipse.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ goog.require('ol.geom.Polygon');
goog.require('os.geo');



/**
* Ellipse geometry.
*
Expand Down
5 changes: 3 additions & 2 deletions src/os/im/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ goog.require('os.alert.AlertEventSeverity');
goog.require('os.alertManager');
goog.require('os.events.EventType');
goog.require('os.im.IImporter');
goog.require('os.im.mapping.AltMapping');
goog.require('os.im.mapping.AltMappingId');
goog.require('os.implements');
goog.require('os.parse.AsyncParser');
goog.require('os.parse.IParser');
goog.require('os.thread.EventType');
Expand Down Expand Up @@ -553,7 +554,7 @@ os.im.Importer.prototype.addMapping_ = function(mapping) {
this.mappings = [mapping];
} else {
var endIndex = this.mappings.length - 1;
if (this.mappings[endIndex] instanceof os.im.mapping.AltMapping) {
if (os.implements(this.mappings[endIndex], os.im.mapping.AltMappingId)) {
// if alt mapping is already at the end, leave it there
this.mappings.splice(endIndex, 0, mapping);
} else {
Expand Down
4 changes: 3 additions & 1 deletion src/os/im/mapping/altmapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ goog.require('os.Fields');
goog.require('os.feature');
goog.require('os.geo');
goog.require('os.im.mapping');
goog.require('os.im.mapping.AltMappingId');
goog.require('os.im.mapping.MappingRegistry');
goog.require('os.im.mapping.RenameMapping');
goog.require('os.math');
goog.require('os.math.Units');



/**
* Altitude mapping.
* @extends {os.im.mapping.RenameMapping<ol.Feature>}
Expand Down Expand Up @@ -93,7 +95,7 @@ goog.inherits(os.im.mapping.AltMapping, os.im.mapping.RenameMapping);
* @type {string}
* @const
*/
os.im.mapping.AltMapping.ID = 'Altitude';
os.im.mapping.AltMapping.ID = os.im.mapping.AltMappingId;


// Register the mapping.
Expand Down
8 changes: 8 additions & 0 deletions src/os/im/mapping/altmappingid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
goog.provide('os.im.mapping.AltMappingId');


/**
* @type {string}
* @const
*/
os.im.mapping.AltMappingId = 'Altitude';
1 change: 0 additions & 1 deletion src/os/im/mapping/radiusmapping.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
goog.provide('os.im.mapping.RadiusMapping');
goog.require('os.Fields');
goog.require('os.geo');
goog.require('os.im.mapping.MappingRegistry');
goog.require('os.im.mapping.RenameMapping');
goog.require('os.math.Units');
Expand Down
1 change: 1 addition & 0 deletions src/os/layer/drawinglayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ goog.require('os.data.AreaNode');
goog.require('os.data.DrawingLayerNode');
goog.require('os.layer.ILayer');
goog.require('os.layer.Vector');
goog.require('os.mixin.layerbase');
goog.require('os.structs.ITreeNodeSupplier');


Expand Down
Loading

0 comments on commit f1bbaf4

Please sign in to comment.