Skip to content

Commit daf9c26

Browse files
authored
Merge pull request #601 from OpenGeoscience/fix-delete-polygon-stroke
Fix delete polygon with stroke
2 parents f09cd8e + 303f16e commit daf9c26

File tree

7 files changed

+26
-9
lines changed

7 files changed

+26
-9
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "geojs",
3-
"version": "0.10.0",
3+
"version": "0.10.1",
44
"description": "JavaScript Geo visualization and Analysis Library",
55
"homepage": "https://github.com/OpenGeoscience/geojs",
66
"main": "geo.js",

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
# built documents.
7474
#
7575
# The short X.Y version.
76-
version = '0.10.0'
76+
version = '0.10.1'
7777
# The full version, including alpha/beta/rc tags.
7878
release = version
7979

geo.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32103,6 +32103,14 @@ return /******/ (function(modules) { // webpackBootstrap
3210332103
m_features[i]._exit();
3210432104
m_this.dataTime().modified();
3210532105
m_this.modified();
32106+
}
32107+
}
32108+
32109+
// Loop through a second to time actually remove
32110+
// the given feature from the array because the
32111+
// `_exit` call above may mutate it.
32112+
for (i = 0; i < m_features.length; i += 1) {
32113+
if (m_features[i] === feature) {
3210632114
m_features.splice(i, 1);
3210732115
}
3210832116
}
@@ -47064,7 +47072,7 @@ return /******/ (function(modules) { // webpackBootstrap
4706447072
this._checkForStroke = function () {
4706547073
if (s_style('stroke') === false) {
4706647074
if (m_lineFeature && m_this.layer()) {
47067-
m_this.layer().removeFeature(m_lineFeature);
47075+
m_this.layer().deleteFeature(m_lineFeature);
4706847076
m_lineFeature = null;
4706947077
}
4707047078
return;
@@ -47144,7 +47152,7 @@ return /******/ (function(modules) { // webpackBootstrap
4714447152
////////////////////////////////////////////////////////////////////////////
4714547153
this._exit = function () {
4714647154
if (m_lineFeature && m_this.layer()) {
47147-
m_this.layer().removeFeature(m_lineFeature);
47155+
m_this.layer().deleteFeature(m_lineFeature);
4714847156
m_lineFeature = null;
4714947157
}
4715047158
s_exit();
@@ -47610,14 +47618,14 @@ return /******/ (function(modules) { // webpackBootstrap
4761047618
/* 229 */
4761147619
/***/ function(module, exports, __webpack_require__) {
4761247620

47613-
module.exports = ("0.10.0");
47621+
module.exports = ("0.10.1");
4761447622

4761547623

4761647624
/***/ },
4761747625
/* 230 */
4761847626
/***/ function(module, exports, __webpack_require__) {
4761947627

47620-
module.exports = ("49720649e1585e43d139e7de6cb40ad2aed89c05");
47628+
module.exports = ("f4a5a6af9b762c4261dd1e9cfeacd2df6e9b362d");
4762147629

4762247630

4762347631
/***/ },

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "geojs",
3-
"version": "0.10.0",
3+
"version": "0.10.1",
44
"description": "JavaScript Geo visualization and Analysis Library",
55
"homepage": "https://github.com/OpenGeoscience/geojs",
66
"license": "Apache-2.0",

src/featureLayer.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ var featureLayer = function (arg) {
6565
m_features[i]._exit();
6666
m_this.dataTime().modified();
6767
m_this.modified();
68+
}
69+
}
70+
71+
// Loop through a second to time actually remove
72+
// the given feature from the array because the
73+
// `_exit` call above may mutate it.
74+
for (i = 0; i < m_features.length; i += 1) {
75+
if (m_features[i] === feature) {
6876
m_features.splice(i, 1);
6977
}
7078
}

src/polygonFeature.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ var polygonFeature = function (arg) {
277277
this._checkForStroke = function () {
278278
if (s_style('stroke') === false) {
279279
if (m_lineFeature && m_this.layer()) {
280-
m_this.layer().removeFeature(m_lineFeature);
280+
m_this.layer().deleteFeature(m_lineFeature);
281281
m_lineFeature = null;
282282
}
283283
return;
@@ -357,7 +357,7 @@ var polygonFeature = function (arg) {
357357
////////////////////////////////////////////////////////////////////////////
358358
this._exit = function () {
359359
if (m_lineFeature && m_this.layer()) {
360-
m_this.layer().removeFeature(m_lineFeature);
360+
m_this.layer().deleteFeature(m_lineFeature);
361361
m_lineFeature = null;
362362
}
363363
s_exit();

tests/cases/polygonFeature.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ describe('geo.polygonFeature', function () {
4343
fillColor: function (d, idx, poly, polyidx) {
4444
return poly.fillColor !== undefined ? poly.fillColor : 'blue';
4545
},
46+
stroke: true,
4647
uniformPolygon: function (d) {
4748
return d.uniformPolygon !== undefined ? d.uniformPolygon : false;
4849
}

0 commit comments

Comments
 (0)