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

refactor(cesium): reorganize featureconverter #853

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3765e4c
refactor(cesium): reorganize featureconverter
wallw-teal Dec 6, 2019
7188101
refactor(cesium): clean up txt file and fix tests
wallw-teal Jan 27, 2020
40f41d9
test(cesium): rename sync > primitive to match src change
wallw-teal Jan 28, 2020
ed96900
fix(cesium): fix label bug and add multi tracks
wallw-teal Jan 28, 2020
9673ec5
Merge remote-tracking branch 'origin/master' into refactor-cesium-fea…
wallw-teal Jan 28, 2020
7b6a5e0
test(cesium): add CESIUM_BASE_URL to fix headless tests
wallw-teal Jan 28, 2020
782aee8
Merge remote-tracking branch 'origin/master' into refactor-cesium-fea…
wallw-teal Jan 30, 2020
24e9b25
test(cesium): fix flaky timing test
wallw-teal Jan 30, 2020
5cc8256
style(csv): cleanup inadvertant comment
wallw-teal Jan 31, 2020
1ba6e67
fix(cesium): fix icon, baseline, and multi track errors
wallw-teal Feb 6, 2020
b990715
Merge remote-tracking branch 'origin/master' into perf-cesium-avoid-c…
wallw-teal Feb 13, 2020
b55cc8c
fix(cesium): intermidiate commit
wallw-teal Feb 25, 2020
7527875
refactor(cesium): use classes for converters
wallw-teal Feb 26, 2020
193a992
test(cesium): all items are now on root collection
wallw-teal Feb 27, 2020
a85bd65
fix(cesium): do not not modify altitude
wallw-teal Feb 28, 2020
4e9d422
fix(cesium): use proper appearance for lines
wallw-teal Mar 6, 2020
cf1575b
Merge remote-tracking branch 'origin/master' into refactor-cesium-fea…
wallw-teal Mar 6, 2020
1347876
feat(cesium): upgrade Cesium
wallw-teal Mar 7, 2020
344b667
fix(cesium): do not update when adding fills
wallw-teal Mar 9, 2020
2c616da
fix(cesium): use dash change detection
wallw-teal Mar 9, 2020
734380a
refactor(cesium): remove global isRoot_ flag
wallw-teal Mar 10, 2020
631c949
refactor(cesium): simplify with array.some
wallw-teal Mar 10, 2020
c89175b
fix(cesium): fix collection visibility
wallw-teal Mar 10, 2020
5746eb8
fix(cesium): use Image rather than ImageIcon.load
wallw-teal Mar 10, 2020
51355aa
refactor(cesium): split updateBillboard function
wallw-teal Mar 10, 2020
721293c
perf(cesium): improved memory usage for points
wallw-teal Mar 10, 2020
40ef402
fix(cesium): fix undefined color error
wallw-teal Mar 11, 2020
e4e22da
fix(cesium): properly detect added fills
wallw-teal Mar 13, 2020
1295847
fix(cesium): recalculate anchor and scale on load
wallw-teal Mar 16, 2020
b77b605
test(cesium): add more tests for LabelConverter
wallw-teal Mar 17, 2020
34e09f0
fix(cesium): added missing item to Cesium externs
wallw-teal Mar 17, 2020
0647999
test(cesium): add multi line tests
wallw-teal Apr 11, 2020
03fe48e
Merge remote-tracking branch 'origin/master' into refactor-cesium-fea…
wallw-teal Apr 17, 2020
7f1448e
fix(cesium): fix icon color changing to null
wallw-teal May 22, 2020
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
46 changes: 16 additions & 30 deletions externs/Cesium.externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1831,7 +1831,7 @@ Cesium.Appearance.prototype.translucent;
* @typedef {{
* asynchronous: (boolean|undefined),
* releaseGeometryInstances: (boolean|undefined),
* geometryInstances: !Cesium.GeometryInstance,
* geometryInstances: !(Cesium.GeometryInstance|Array<!Cesium.GeometryInstance>),
* show: (boolean|undefined),
* appearance: !Cesium.Appearance
* }}
Expand Down Expand Up @@ -1959,6 +1959,7 @@ Cesium.optionsGroundPolylinePrimitive;

/**
* @constructor
* @extends {Cesium.Geometry}
* @param {Cesium.optionsGroundPolylineGeometry=} opt_opts
*/
Cesium.GroundPolylineGeometry = function(opt_opts) {};
Expand Down Expand Up @@ -2366,30 +2367,22 @@ Cesium.ColorGeometryInstanceAttribute.toValue = function(color, opt_result) {};


/**
* @constructor
* @struct
*/
Cesium.optionsGeometryInstance = function() {};


/**
* @type {string}
*/
Cesium.optionsGeometryInstance.prototype.id;


/**
* @type {!Cesium.Geometry}
* @typedef {{
* id: (!string|undefined),
* geometry: !Cesium.Geometry,
* attributes: (!Cesium.optionsGeometryInstanceAttribute|undefined),
* modelMatrix: (!Cesium.Matrix4|undefined)
* }}
*/
Cesium.optionsGeometryInstance.prototype.geometry;
Cesium.optionsGeometryInstance;


/**
* @type {!Cesium.Matrix4}
* @typedef {{
* color: Cesium.ColorGeometryInstanceAttribute
* }}
*/
Cesium.optionsGeometryInstance.prototype.modelMatrix;


Cesium.optionsGeometryInstanceAttribute;

/**
* @constructor
Expand All @@ -2398,24 +2391,17 @@ Cesium.optionsGeometryInstance.prototype.modelMatrix;
Cesium.GeometryInstanceAttribute;


/**
* @type {Cesium.GeometryInstanceAttribute| undefined}
*/
Cesium.optionsGeometryInstance.prototype.attributes;


/**
* @type {Cesium.ColorGeometryInstanceAttribute}
*/
Cesium.GeometryInstanceAttribute.prototype.color;



/**
* @constructor
* @param {Object} object
* @param {Cesium.optionsGeometryInstance} options
*/
Cesium.GeometryInstance = function(object) {};
Cesium.GeometryInstance = function(options) {};



Expand Down Expand Up @@ -2688,7 +2674,7 @@ Cesium.Transforms.eastNorthUpToFixedFrame = function(origin, opt_ellipsoid, opt_
* @param {Cesium.Ellipsoid=} opt_ellipsoid .
* @param {Function=} opt_transform .
* @param {Cesium.Matrix4=} opt_result .
* @return {Cesium.Matrix4}
* @return {!Cesium.Matrix4}
*/
Cesium.Transforms.headingPitchRollToFixedFrame = function(origin, hpr, opt_ellipsoid, opt_transform, opt_result) {};

Expand Down
2 changes: 2 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = function(config) {
files: [
{pattern: '.build/modernizr.js', watched: false, included: true, served: true},
{pattern: '.build/xml-lexer.min.js', watched: false, included: true, served: true},
{pattern: '.build/webgl-mock.min.js', watched: false, included: true, served: true},
{pattern: resolver.resolveModulePath('opensphere-asm/dist/os-wasm.*', __dirname), watched: false, included: false, served: true},
{pattern: resolver.resolveModulePath('opensphere-asm/dist/os-asm.*', __dirname), watched: false, included: false, served: true},
{pattern: resolver.resolveModulePath('opensphere-asm/dist/os-load.js', __dirname), watched: false, included: true, served: true},
Expand Down Expand Up @@ -65,6 +66,7 @@ module.exports = function(config) {
{pattern: 'test/**/*.json', included: false},
{pattern: 'test/**/*.xml', included: false},
{pattern: 'test/resources/**/*', included: false},
{pattern: 'images/**/*', included: false},

// source files for the script loader
{pattern: 'src/**/*.js', watched: false, included: false, served: true},
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@
"pregen:xmllexer": "echo \"window.xmlLexer = require('xml-lexer');\" > .build/xml-lexer.require.js",
"gen:xmllexer": "browserify .build/xml-lexer.require.js -o .build/xml-lexer.min.js",
"postgen:xmllexer": "rm .build/xml-lexer.require.js",
"gentestlibs": "npm run gen:webgl-mock",
"gen:webgl-mock": "browserify vendor/webgl-mock/webgl-mock.require.js -o .build/webgl-mock.min.js",
"test:gcc": "os-compile .build/gcc-test-args.json",
"test:init": "npm run genlibs && npm run compile:resolve -- --exclude resources scss && npm run test:gcc",
"test:init": "npm run genlibs && npm run gentestlibs && npm run compile:resolve -- --exclude resources scss && npm run test:gcc",
"test:debug": "karma start --browsers Chrome --reporters dots",
"test:run": "karma start --single-run",
"test": "npm run test:init && npm run test:run",
Expand Down Expand Up @@ -281,6 +283,7 @@
"sass-lint": "^1.12.1",
"semantic-release": "^15.13.18",
"surge": "^0.20.4",
"webgl-mock": "^0.1.7",
"xmllint": "^0.1.1"
},
"dependencies": {
Expand Down
16 changes: 14 additions & 2 deletions src/os/mixin/featuremixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,26 @@ ol.Feature.prototype.setId = function(id) {
this.id_ = id;

if (this['id'] == null) {
this['id'] = ol.Feature.nextId;
ol.Feature.nextId++;
this['id'] = ol.Feature.nextId++;
}

this.changed();
};


/**
* @return {number} The unique feature ID per session
* @suppress {checkTypes}
*/
ol.Feature.prototype.getUid = function() {
if (this['id'] == null) {
this['id'] = ol.Feature.nextId++;
}

return this['id'];
};


/**
* Fire feature event that won't be handled by OL3. This is added so the event will be created in the same application
* context as the feature, allowing instanceof to work in Closure's internal event dispatcher.
Expand Down
2 changes: 0 additions & 2 deletions src/plugin/cesium/cesiumcamera.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ goog.inherits(plugin.cesium.Camera, olcs.Camera);

/**
* Replace the olcs camera with ours.
*
* @suppress {checkTypes} Because hacks.
*/
plugin.cesium.replaceCamera = function() {
olcs.Camera = plugin.cesium.Camera;
Expand Down
44 changes: 0 additions & 44 deletions src/plugin/cesium/cesiumplugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,50 +41,6 @@ goog.inherits(plugin.cesium.Plugin, os.plugin.AbstractPlugin);
plugin.cesium.Plugin.ID = 'cesium';


/**
* @typedef {{
* id: number,
* csPattern: (number|undefined)
* }}
*/
plugin.cesium.styleLineDashOption;


/**
* Line dash configurations for Cesium
* Patterns based on 16 bit number to make it look consistent between map engines
* @type {!Array<!plugin.cesium.styleLineDashOption>}
* @const
*/
plugin.cesium.LINE_STYLE_OPTIONS = [
{
id: 0,
csPattern: undefined // []
}, {
id: 1,
csPattern: parseInt('1111111111110000', 2) // [12, 4]
}, {
id: 2,
csPattern: parseInt('1111111100000000', 2) // [8, 8]
}, {
id: 3,
csPattern: parseInt('1111100011111000', 2) // [4, 4, 4, 4]
}, {
id: 4,
csPattern: parseInt('1111100000000000', 2) // [4, 12]
}, {
id: 5,
csPattern: parseInt('1110000011100000', 2) // [2, 6, 2, 6]
}, {
id: 6,
csPattern: parseInt('1111110000111000', 2) // [5, 5, 1, 5]
}, {
id: 7,
csPattern: parseInt('1111111110011100', 2) // [7, 4, 1, 4]
}
];


/**
* @inheritDoc
*/
Expand Down
3 changes: 1 addition & 2 deletions src/plugin/cesium/cesiumrenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ plugin.cesium.CesiumRenderer.prototype.isInitialized = function() {

/**
* @inheritDoc
* @suppress {accessControls|checkTypes}
* @suppress {accessControls}
*/
plugin.cesium.CesiumRenderer.prototype.initialize = function() {
if (!this.olCesium_ && this.map) {
Expand Down Expand Up @@ -223,7 +223,6 @@ plugin.cesium.CesiumRenderer.prototype.setEnabled = function(value) {

/**
* @inheritDoc
* @suppress {checkTypes}
*/
plugin.cesium.CesiumRenderer.prototype.getCamera = function() {
return this.olCesium_ ? /** @type {plugin.cesium.Camera} */ (this.olCesium_.getCamera()) : undefined;
Expand Down
9 changes: 2 additions & 7 deletions src/plugin/cesium/mixin/renderloopmixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ goog.require('os.time.TimelineEventType');


/**
* @suppress {accessControls|checkTypes}
* @suppress {accessControls}
*/
(function() {
var origEnable = olcs.AutoRenderLoop.prototype.enable;

/**
* Overridden to listen to <code>os.MapEvent.GL_REPAINT</code> events in addition
* to timeline show events for rendering the scene.
*
* @override
*/
olcs.AutoRenderLoop.prototype.enable = function() {
os.dispatcher.listen(os.MapEvent.GL_REPAINT, this.notifyRepaintRequired, false, this);
Expand All @@ -32,8 +30,6 @@ goog.require('os.time.TimelineEventType');
/**
* Overridden to unlisten to <code>os.MapEvent.GL_REPAINT</code> events in addition
* to timeline show events for rendering the scene.
*
* @override
*/
olcs.AutoRenderLoop.prototype.disable = function() {
os.dispatcher.unlisten(os.MapEvent.GL_REPAINT, this.notifyRepaintRequired, false, this);
Expand All @@ -45,7 +41,6 @@ goog.require('os.time.TimelineEventType');

var origNotify = olcs.AutoRenderLoop.prototype.notifyRepaintRequired;


var lastRepaintEventTime = 0;

/**
Expand All @@ -61,7 +56,7 @@ goog.require('os.time.TimelineEventType');
/**
* Overridden because we only care about mouse events if a button is down
*
* @override
* @param {Event=} opt_evt
*/
olcs.AutoRenderLoop.prototype.notifyRepaintRequired = function(opt_evt) {
if (opt_evt && opt_evt.type && opt_evt.type.indexOf('move') > -1) {
Expand Down
Loading