Skip to content

Commit

Permalink
Merge pull request #601 from OpenGeoscience/fix-delete-polygon-stroke
Browse files Browse the repository at this point in the history
Fix delete polygon with stroke
  • Loading branch information
jbeezley authored Jul 19, 2016
2 parents f09cd8e + 303f16e commit daf9c26
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "geojs",
"version": "0.10.0",
"version": "0.10.1",
"description": "JavaScript Geo visualization and Analysis Library",
"homepage": "https://github.com/OpenGeoscience/geojs",
"main": "geo.js",
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
# built documents.
#
# The short X.Y version.
version = '0.10.0'
version = '0.10.1'
# The full version, including alpha/beta/rc tags.
release = version

Expand Down
16 changes: 12 additions & 4 deletions geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -32103,6 +32103,14 @@ return /******/ (function(modules) { // webpackBootstrap
m_features[i]._exit();
m_this.dataTime().modified();
m_this.modified();
}
}

// Loop through a second to time actually remove
// the given feature from the array because the
// `_exit` call above may mutate it.
for (i = 0; i < m_features.length; i += 1) {
if (m_features[i] === feature) {
m_features.splice(i, 1);
}
}
Expand Down Expand Up @@ -47064,7 +47072,7 @@ return /******/ (function(modules) { // webpackBootstrap
this._checkForStroke = function () {
if (s_style('stroke') === false) {
if (m_lineFeature && m_this.layer()) {
m_this.layer().removeFeature(m_lineFeature);
m_this.layer().deleteFeature(m_lineFeature);
m_lineFeature = null;
}
return;
Expand Down Expand Up @@ -47144,7 +47152,7 @@ return /******/ (function(modules) { // webpackBootstrap
////////////////////////////////////////////////////////////////////////////
this._exit = function () {
if (m_lineFeature && m_this.layer()) {
m_this.layer().removeFeature(m_lineFeature);
m_this.layer().deleteFeature(m_lineFeature);
m_lineFeature = null;
}
s_exit();
Expand Down Expand Up @@ -47610,14 +47618,14 @@ return /******/ (function(modules) { // webpackBootstrap
/* 229 */
/***/ function(module, exports, __webpack_require__) {

module.exports = ("0.10.0");
module.exports = ("0.10.1");


/***/ },
/* 230 */
/***/ function(module, exports, __webpack_require__) {

module.exports = ("49720649e1585e43d139e7de6cb40ad2aed89c05");
module.exports = ("f4a5a6af9b762c4261dd1e9cfeacd2df6e9b362d");


/***/ },
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "geojs",
"version": "0.10.0",
"version": "0.10.1",
"description": "JavaScript Geo visualization and Analysis Library",
"homepage": "https://github.com/OpenGeoscience/geojs",
"license": "Apache-2.0",
Expand Down
8 changes: 8 additions & 0 deletions src/featureLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ var featureLayer = function (arg) {
m_features[i]._exit();
m_this.dataTime().modified();
m_this.modified();
}
}

// Loop through a second to time actually remove
// the given feature from the array because the
// `_exit` call above may mutate it.
for (i = 0; i < m_features.length; i += 1) {
if (m_features[i] === feature) {
m_features.splice(i, 1);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/polygonFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ var polygonFeature = function (arg) {
this._checkForStroke = function () {
if (s_style('stroke') === false) {
if (m_lineFeature && m_this.layer()) {
m_this.layer().removeFeature(m_lineFeature);
m_this.layer().deleteFeature(m_lineFeature);
m_lineFeature = null;
}
return;
Expand Down Expand Up @@ -357,7 +357,7 @@ var polygonFeature = function (arg) {
////////////////////////////////////////////////////////////////////////////
this._exit = function () {
if (m_lineFeature && m_this.layer()) {
m_this.layer().removeFeature(m_lineFeature);
m_this.layer().deleteFeature(m_lineFeature);
m_lineFeature = null;
}
s_exit();
Expand Down
1 change: 1 addition & 0 deletions tests/cases/polygonFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ describe('geo.polygonFeature', function () {
fillColor: function (d, idx, poly, polyidx) {
return poly.fillColor !== undefined ? poly.fillColor : 'blue';
},
stroke: true,
uniformPolygon: function (d) {
return d.uniformPolygon !== undefined ? d.uniformPolygon : false;
}
Expand Down

0 comments on commit daf9c26

Please sign in to comment.