Skip to content

Commit

Permalink
Merge pull request #779 from OpenGeoscience/improve-line-updates
Browse files Browse the repository at this point in the history
Improve line updates
  • Loading branch information
manthey authored Feb 28, 2018
2 parents a54ed2b + 9cada43 commit ce723a7
Show file tree
Hide file tree
Showing 7 changed files with 320 additions and 195 deletions.
7 changes: 4 additions & 3 deletions src/canvas/lineFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ var registerFeature = require('../registry').registerFeature;
var lineFeature = require('../lineFeature');

/**
* Create a new instance of class lineFeature
* Create a new instance of class lineFeature.
*
* @class geo.canvas.lineFeature
* @extends geo.lineFeature
* @extends geo.canvas.object
* @param {geo.lineFeature.spec} arg
* @returns {geo.canvas.lineFeature}
*/
var canvas_lineFeature = function (arg) {
Expand All @@ -29,9 +29,10 @@ var canvas_lineFeature = function (arg) {

/**
* Render the data on the canvas.
*
* @protected
* @param {object} context2d the canvas context to draw in.
* @param {object} map the parent map object.
* @param {geo.map} map the parent map object.
*/
this._renderOnCanvas = function (context2d, map) {
var data = m_this.data(),
Expand Down
17 changes: 10 additions & 7 deletions src/d3/lineFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ var registerFeature = require('../registry').registerFeature;
var lineFeature = require('../lineFeature');

/**
* Create a new instance of class lineFeature
* Create a new instance of class lineFeature.
*
* @class geo.d3.lineFeature
* @extends geo.lineFeature
* @extends geo.d3.object
* @param {geo.lineFeature.spec} arg
* @returns {geo.d3.lineFeature}
*/
var d3_lineFeature = function (arg) {
Expand Down Expand Up @@ -35,17 +35,20 @@ var d3_lineFeature = function (arg) {
s_update = this._update;

/**
* Initialize
* Initialize.
*
* @param {geo.lineFeature.spec} arg The feature specification.
* @returns {this}
*/
this._init = function (arg) {
s_init.call(m_this, arg);
return m_this;
};

/**
* Build
* Build. Create the necessary elements to render lines.
*
* @override
* @returns {this}
*/
this._build = function () {
var data = m_this.data() || [],
Expand Down Expand Up @@ -109,9 +112,9 @@ var d3_lineFeature = function (arg) {
};

/**
* Update
* Update. Rebuild if necessary.
*
* @override
* @returns {this}
*/
this._update = function () {
s_update.call(m_this);
Expand Down
Loading

0 comments on commit ce723a7

Please sign in to comment.