geojs 1.8.7 → 1.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/geo.js +114 -85
- package/geo.lean.js +114 -85
- package/geo.lean.min.js +3 -3
- package/geo.min.js +2 -2
- package/package.json +1 -1
- package/src/geojsonReader.js +2 -0
- package/src/graphFeature.js +1 -1
- package/src/heatmapFeature.js +2 -1
- package/src/lineFeature.js +32 -14
- package/src/pixelmapFeature.js +1 -1
- package/src/polygonFeature.js +5 -4
- package/src/quadFeature.js +1 -1
- package/src/trackFeature.js +2 -2
- package/src/transform.js +1 -1
- package/src/util/common.js +11 -0
- package/src/vectorFeature.js +2 -1
- package/src/webgl/lineFeature.js +25 -10
- package/src/webgl/polygonFeature.js +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# GeoJS Change Log
|
|
2
2
|
|
|
3
|
+
## Version 1.8.10
|
|
4
|
+
|
|
5
|
+
### Improvements
|
|
6
|
+
|
|
7
|
+
- Added a uniformLine property to speed up line rendering ([#1211](../../pull/1211))
|
|
8
|
+
|
|
9
|
+
## Version 1.8.9
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
- Fix a bug introduced in #1207 ([#1210](../../pull/1210))
|
|
14
|
+
|
|
15
|
+
## Version 1.8.8
|
|
16
|
+
|
|
17
|
+
### Improvements
|
|
18
|
+
|
|
19
|
+
- Reduce polygon and position function calls ([#1208](../../pull/1208))
|
|
20
|
+
|
|
3
21
|
## Version 1.8.7
|
|
4
22
|
|
|
5
23
|
### Improvements
|
package/geo.js
CHANGED
|
@@ -11490,6 +11490,7 @@ var geojsonReader = function geojsonReader(arg) {
|
|
|
11490
11490
|
strokeOffset: 0,
|
|
11491
11491
|
lineCap: 'butt',
|
|
11492
11492
|
lineJoin: 'miter',
|
|
11493
|
+
uniformLine: true,
|
|
11493
11494
|
closed: false
|
|
11494
11495
|
}, arg.lineStyle),
|
|
11495
11496
|
polygonStyle: _objectSpread({
|
|
@@ -11499,7 +11500,8 @@ var geojsonReader = function geojsonReader(arg) {
|
|
|
11499
11500
|
stroke: true,
|
|
11500
11501
|
strokeColor: '#999999',
|
|
11501
11502
|
strokeWidth: 2,
|
|
11502
|
-
strokeOpacity: 1
|
|
11503
|
+
strokeOpacity: 1,
|
|
11504
|
+
uniformPolygon: true
|
|
11503
11505
|
}, arg.polygonStyle)
|
|
11504
11506
|
});
|
|
11505
11507
|
|
|
@@ -12042,9 +12044,7 @@ var graphFeature = function graphFeature(arg) {
|
|
|
12042
12044
|
|
|
12043
12045
|
}, arg.style === undefined ? {} : arg.style);
|
|
12044
12046
|
m_this.style(defaultStyle);
|
|
12045
|
-
m_this.nodes(
|
|
12046
|
-
return d;
|
|
12047
|
-
});
|
|
12047
|
+
m_this.nodes(util.identityFunction);
|
|
12048
12048
|
return m_this;
|
|
12049
12049
|
};
|
|
12050
12050
|
/**
|
|
@@ -12466,6 +12466,8 @@ var inherit = __webpack_require__(5699);
|
|
|
12466
12466
|
var feature = __webpack_require__(6837);
|
|
12467
12467
|
|
|
12468
12468
|
var transform = __webpack_require__(6853);
|
|
12469
|
+
|
|
12470
|
+
var util = __webpack_require__(4634);
|
|
12469
12471
|
/**
|
|
12470
12472
|
* Heatmap feature specification.
|
|
12471
12473
|
*
|
|
@@ -12544,10 +12546,7 @@ var heatmapFeature = function heatmapFeature(arg) {
|
|
|
12544
12546
|
m_gcsPosition,
|
|
12545
12547
|
s_init = this._init;
|
|
12546
12548
|
this.featureType = 'heatmap';
|
|
12547
|
-
|
|
12548
|
-
m_position = arg.position || function (d) {
|
|
12549
|
-
return d;
|
|
12550
|
-
};
|
|
12549
|
+
m_position = arg.position || util.identityFunction;
|
|
12551
12550
|
|
|
12552
12551
|
m_intensity = arg.intensity || function (d) {
|
|
12553
12552
|
return 1;
|
|
@@ -15144,6 +15143,9 @@ var util = __webpack_require__(4634);
|
|
|
15144
15143
|
* divided by the sine of half the angle between segments, then a bevel join
|
|
15145
15144
|
* is used instead. This is a single value that applies to all lines. If a
|
|
15146
15145
|
* function, it is called with `(data)`.
|
|
15146
|
+
* @property {boolean|function} [uniformLine=false] Boolean indicating if each
|
|
15147
|
+
* line has a uniform style (uniform stroke color, opacity, and width). Can
|
|
15148
|
+
* vary by line.
|
|
15147
15149
|
* @property {number|function} [antialiasing] Antialiasing distance in pixels.
|
|
15148
15150
|
* Values must be non-negative. A value greater than 1 will produce a
|
|
15149
15151
|
* visible gradient. This is a single value that applies to all lines.
|
|
@@ -15261,24 +15263,38 @@ var lineFeature = function lineFeature(arg) {
|
|
|
15261
15263
|
var data = m_this.data(),
|
|
15262
15264
|
line = m_this.line(),
|
|
15263
15265
|
widthFunc = m_this.style.get('strokeWidth'),
|
|
15266
|
+
widthVal = util.isFunction(m_this.style('strokeWidth')) ? undefined : widthFunc(),
|
|
15264
15267
|
posFunc = m_this.position(),
|
|
15265
15268
|
closedFunc = m_this.style.get('closed'),
|
|
15269
|
+
closedVal = util.isFunction(m_this.style('closed')) ? undefined : closedFunc(),
|
|
15270
|
+
uniformFunc = m_this.style.get('uniformLine'),
|
|
15271
|
+
uniformVal = util.isFunction(m_this.style('uniformLine')) ? undefined : uniformFunc(),
|
|
15266
15272
|
gcs = m_this.gcs(),
|
|
15267
|
-
mapgcs = m_this.layer().map().gcs()
|
|
15268
|
-
|
|
15269
|
-
|
|
15270
|
-
|
|
15271
|
-
|
|
15272
|
-
|
|
15273
|
-
|
|
15274
|
-
|
|
15275
|
-
|
|
15276
|
-
|
|
15277
|
-
|
|
15278
|
-
|
|
15273
|
+
mapgcs = m_this.layer().map().gcs(),
|
|
15274
|
+
onlyInvertedY = transform.onlyInvertedY(gcs, mapgcs);
|
|
15275
|
+
|
|
15276
|
+
for (var index = 0; index < data.length; index += 1) {
|
|
15277
|
+
var d = data[index];
|
|
15278
|
+
var closed = closedVal === undefined ? closedFunc(d, index) : closedVal;
|
|
15279
|
+
var last = void 0,
|
|
15280
|
+
lasti = void 0,
|
|
15281
|
+
lastr = void 0,
|
|
15282
|
+
lastr2 = void 0,
|
|
15283
|
+
first = void 0,
|
|
15284
|
+
min = void 0,
|
|
15285
|
+
max = void 0,
|
|
15286
|
+
width = void 0;
|
|
15287
|
+
var record = [];
|
|
15288
|
+
var uniform = uniformVal === undefined ? uniformFunc(d, index) : uniformVal;
|
|
15289
|
+
var lineRecord = line(d, index);
|
|
15290
|
+
|
|
15291
|
+
for (var j = 0; j < lineRecord.length; j += 1) {
|
|
15292
|
+
var current = lineRecord[j];
|
|
15279
15293
|
var p = posFunc(current, j, d, index);
|
|
15280
15294
|
|
|
15281
|
-
if (
|
|
15295
|
+
if (onlyInvertedY) {
|
|
15296
|
+
p.y = -p.y;
|
|
15297
|
+
} else if (gcs !== mapgcs) {
|
|
15282
15298
|
p = transform.transformCoordinates(gcs, mapgcs, p);
|
|
15283
15299
|
}
|
|
15284
15300
|
|
|
@@ -15312,7 +15328,11 @@ var lineFeature = function lineFeature(arg) {
|
|
|
15312
15328
|
max.y = p.y;
|
|
15313
15329
|
}
|
|
15314
15330
|
|
|
15315
|
-
|
|
15331
|
+
if (!uniform || !j) {
|
|
15332
|
+
width = widthVal === undefined ? widthFunc(current, j, d, index) : widthVal;
|
|
15333
|
+
}
|
|
15334
|
+
|
|
15335
|
+
var r = Math.ceil(width / 2) + 2;
|
|
15316
15336
|
|
|
15317
15337
|
if (max.r === undefined || r > max.r) {
|
|
15318
15338
|
max.r = r;
|
|
@@ -15344,7 +15364,7 @@ var lineFeature = function lineFeature(arg) {
|
|
|
15344
15364
|
i: j
|
|
15345
15365
|
};
|
|
15346
15366
|
}
|
|
15347
|
-
}
|
|
15367
|
+
}
|
|
15348
15368
|
|
|
15349
15369
|
if (closed && first && (last.x !== first.p.x || last.y !== first.p.y)) {
|
|
15350
15370
|
record.push({
|
|
@@ -15360,7 +15380,8 @@ var lineFeature = function lineFeature(arg) {
|
|
|
15360
15380
|
record.min = min;
|
|
15361
15381
|
record.max = max;
|
|
15362
15382
|
m_pointSearchInfo.push(record);
|
|
15363
|
-
}
|
|
15383
|
+
}
|
|
15384
|
+
|
|
15364
15385
|
return m_pointSearchInfo;
|
|
15365
15386
|
};
|
|
15366
15387
|
/**
|
|
@@ -15668,12 +15689,8 @@ var lineFeature = function lineFeature(arg) {
|
|
|
15668
15689
|
});
|
|
15669
15690
|
/* Set the reduced lines as the data and use simple accessors. */
|
|
15670
15691
|
|
|
15671
|
-
m_this.style('position',
|
|
15672
|
-
|
|
15673
|
-
});
|
|
15674
|
-
m_this.style('line', function (d) {
|
|
15675
|
-
return d;
|
|
15676
|
-
});
|
|
15692
|
+
m_this.style('position', util.identityFunction);
|
|
15693
|
+
m_this.style('line', util.identityFunction);
|
|
15677
15694
|
m_this.data(data);
|
|
15678
15695
|
return m_this;
|
|
15679
15696
|
};
|
|
@@ -15701,9 +15718,7 @@ var lineFeature = function lineFeature(arg) {
|
|
|
15701
15718
|
// Values of 2 and above appear smoothest.
|
|
15702
15719
|
antialiasing: 2.0,
|
|
15703
15720
|
closed: false,
|
|
15704
|
-
line:
|
|
15705
|
-
return d;
|
|
15706
|
-
},
|
|
15721
|
+
line: util.identityFunction,
|
|
15707
15722
|
position: function position(d) {
|
|
15708
15723
|
return Array.isArray(d) ? {
|
|
15709
15724
|
x: d[0],
|
|
@@ -23324,9 +23339,7 @@ var pixelmapFeature = function pixelmapFeature(arg) {
|
|
|
23324
23339
|
a: 1
|
|
23325
23340
|
};
|
|
23326
23341
|
},
|
|
23327
|
-
position:
|
|
23328
|
-
return d;
|
|
23329
|
-
}
|
|
23342
|
+
position: util.identityFunction
|
|
23330
23343
|
}, arg.style === undefined ? {} : arg.style);
|
|
23331
23344
|
|
|
23332
23345
|
if (arg.position !== undefined) {
|
|
@@ -24861,7 +24874,8 @@ var polygonFeature = function polygonFeature(arg) {
|
|
|
24861
24874
|
strokeStyle: linePolyStyle(polyStyle.strokeStyle),
|
|
24862
24875
|
strokeColor: linePolyStyle(polyStyle.strokeColor),
|
|
24863
24876
|
strokeOffset: linePolyStyle(polyStyle.strokeOffset),
|
|
24864
|
-
strokeOpacity: strokeOpacity
|
|
24877
|
+
strokeOpacity: strokeOpacity,
|
|
24878
|
+
uniformLine: linePolyStyle(polyStyle.uniformPolygon)
|
|
24865
24879
|
});
|
|
24866
24880
|
var data = m_this.data(),
|
|
24867
24881
|
posVal = m_this.style('position');
|
|
@@ -25022,12 +25036,8 @@ var polygonFeature = function polygonFeature(arg) {
|
|
|
25022
25036
|
});
|
|
25023
25037
|
/* Set the reduced polgons as the data and use simple accessors. */
|
|
25024
25038
|
|
|
25025
|
-
m_this.style('position',
|
|
25026
|
-
|
|
25027
|
-
});
|
|
25028
|
-
m_this.style('polygon', function (d) {
|
|
25029
|
-
return d;
|
|
25030
|
-
});
|
|
25039
|
+
m_this.style('position', util.identityFunction);
|
|
25040
|
+
m_this.style('polygon', util.identityFunction);
|
|
25031
25041
|
m_this.data(data);
|
|
25032
25042
|
return m_this;
|
|
25033
25043
|
};
|
|
@@ -25123,9 +25133,7 @@ var polygonFeature = function polygonFeature(arg) {
|
|
|
25123
25133
|
b: 1.0
|
|
25124
25134
|
},
|
|
25125
25135
|
strokeOpacity: 1.0,
|
|
25126
|
-
polygon:
|
|
25127
|
-
return d;
|
|
25128
|
-
},
|
|
25136
|
+
polygon: util.identityFunction,
|
|
25129
25137
|
position: function position(d) {
|
|
25130
25138
|
return Array.isArray(d) ? {
|
|
25131
25139
|
x: d[0],
|
|
@@ -26014,9 +26022,7 @@ var quadFeature = function quadFeature(arg) {
|
|
|
26014
26022
|
video: function video(d) {
|
|
26015
26023
|
return d.video;
|
|
26016
26024
|
},
|
|
26017
|
-
position:
|
|
26018
|
-
return d;
|
|
26019
|
-
}
|
|
26025
|
+
position: util.identityFunction
|
|
26020
26026
|
}, arg.style === undefined ? {} : arg.style);
|
|
26021
26027
|
|
|
26022
26028
|
if (arg.position !== undefined) {
|
|
@@ -27053,7 +27059,7 @@ module.exports = sceneObject;
|
|
|
27053
27059
|
* @constant
|
|
27054
27060
|
* @type {string}
|
|
27055
27061
|
*/
|
|
27056
|
-
module.exports = "
|
|
27062
|
+
module.exports = "e13f6d922451bb86544884283bfb31843f58bd60";
|
|
27057
27063
|
|
|
27058
27064
|
/***/ }),
|
|
27059
27065
|
|
|
@@ -32927,12 +32933,8 @@ var trackFeature = function trackFeature(arg) {
|
|
|
32927
32933
|
arg = arg || {};
|
|
32928
32934
|
s_init.call(m_this, arg);
|
|
32929
32935
|
var style = $.extend(true, {}, {
|
|
32930
|
-
track:
|
|
32931
|
-
|
|
32932
|
-
},
|
|
32933
|
-
position: function position(d) {
|
|
32934
|
-
return d;
|
|
32935
|
-
},
|
|
32936
|
+
track: util.identityFunction,
|
|
32937
|
+
position: util.identityFunction,
|
|
32936
32938
|
time: function time(d, i) {
|
|
32937
32939
|
return d.t !== undefined ? d.t : i;
|
|
32938
32940
|
}
|
|
@@ -33007,7 +33009,7 @@ var maxTransformCacheSize = 10;
|
|
|
33007
33009
|
/* A RegExp to detect if two transforms only different by the middle axis's
|
|
33008
33010
|
* direction. */
|
|
33009
33011
|
|
|
33010
|
-
var axisPattern = /^(.* |)
|
|
33012
|
+
var axisPattern = /^(.* |)\+axis=e(n|s)u(| .*)$/;
|
|
33011
33013
|
var affinePattern = /(^|\s)\+(s[1-3][1-3]|[xyz]off)=\S/;
|
|
33012
33014
|
/**
|
|
33013
33015
|
* This purpose of this class is to provide a generic interface for computing
|
|
@@ -38579,6 +38581,17 @@ var util = {
|
|
|
38579
38581
|
|
|
38580
38582
|
return value !== null && value !== undefined && (type === 'object' || type === 'function');
|
|
38581
38583
|
},
|
|
38584
|
+
|
|
38585
|
+
/**
|
|
38586
|
+
* Return the first value passed to the function. Using this function for
|
|
38587
|
+
* identity calls can allow some code to bypass making such a call entirely.
|
|
38588
|
+
*
|
|
38589
|
+
* @param {*} d Any value.
|
|
38590
|
+
* @returns {*} The passed value.
|
|
38591
|
+
*/
|
|
38592
|
+
identityFunction: function identityFunction(d) {
|
|
38593
|
+
return d;
|
|
38594
|
+
},
|
|
38582
38595
|
///////////////////////////////////////////////////////////////////////////
|
|
38583
38596
|
|
|
38584
38597
|
/*
|
|
@@ -39408,6 +39421,8 @@ module.exports = {
|
|
|
39408
39421
|
var inherit = __webpack_require__(5699);
|
|
39409
39422
|
|
|
39410
39423
|
var feature = __webpack_require__(6837);
|
|
39424
|
+
|
|
39425
|
+
var util = __webpack_require__(4634);
|
|
39411
39426
|
/**
|
|
39412
39427
|
* Object specification for a graph feature.
|
|
39413
39428
|
*
|
|
@@ -39534,9 +39549,7 @@ var vectorFeature = function vectorFeature(arg) {
|
|
|
39534
39549
|
y: 0,
|
|
39535
39550
|
z: 0
|
|
39536
39551
|
},
|
|
39537
|
-
delta:
|
|
39538
|
-
return d;
|
|
39539
|
-
},
|
|
39552
|
+
delta: util.identityFunction,
|
|
39540
39553
|
scale: null // size scaling factor (null -> renderer decides)
|
|
39541
39554
|
|
|
39542
39555
|
}, arg.style === undefined ? {} : arg.style);
|
|
@@ -39568,7 +39581,7 @@ module.exports = vectorFeature;
|
|
|
39568
39581
|
* @constant
|
|
39569
39582
|
* @type {string}
|
|
39570
39583
|
*/
|
|
39571
|
-
module.exports = "1.8.
|
|
39584
|
+
module.exports = "1.8.10";
|
|
39572
39585
|
|
|
39573
39586
|
/***/ }),
|
|
39574
39587
|
|
|
@@ -40801,7 +40814,6 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
|
|
|
40801
40814
|
v = vert[1],
|
|
40802
40815
|
target_gcs = m_this.gcs(),
|
|
40803
40816
|
map_gcs = m_this.layer().map().gcs(),
|
|
40804
|
-
simpleInverse = transform.onlyInvertedY(target_gcs, map_gcs),
|
|
40805
40817
|
pos,
|
|
40806
40818
|
posIdx3,
|
|
40807
40819
|
firstpos,
|
|
@@ -40821,6 +40833,9 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
|
|
|
40821
40833
|
strokeOffsetVal,
|
|
40822
40834
|
miterLimit = m_this.style.get('miterLimit')(data),
|
|
40823
40835
|
antialiasing = m_this.style.get('antialiasing')(data) || 0,
|
|
40836
|
+
uniformFunc = m_this.style.get('uniformLine'),
|
|
40837
|
+
uniformVal,
|
|
40838
|
+
uniform,
|
|
40824
40839
|
order = m_this.featureVertices(),
|
|
40825
40840
|
orderk0,
|
|
40826
40841
|
prevkey,
|
|
@@ -40851,6 +40866,7 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
|
|
|
40851
40866
|
strokeOffsetVal = util.isFunction(m_this.style('strokeOffset')) ? undefined : strokeOffsetFunc() || 0;
|
|
40852
40867
|
strokeOpacityVal = util.isFunction(m_this.style('strokeOpacity')) ? undefined : strokeOpacityFunc();
|
|
40853
40868
|
strokeWidthVal = util.isFunction(m_this.style('strokeWidth')) ? undefined : strokeWidthFunc();
|
|
40869
|
+
uniformVal = util.isFunction(m_this.style('uniformLine')) ? undefined : uniformFunc();
|
|
40854
40870
|
|
|
40855
40871
|
if (miterLimit !== undefined) {
|
|
40856
40872
|
/* We impose a limit no matter what, since otherwise the growth is
|
|
@@ -40865,6 +40881,7 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
|
|
|
40865
40881
|
if (!onlyStyle) {
|
|
40866
40882
|
var position = [],
|
|
40867
40883
|
posFunc = m_this.position();
|
|
40884
|
+
posFunc = posFunc === util.identityFunction ? null : posFunc;
|
|
40868
40885
|
lineItemList = new Array(data.length);
|
|
40869
40886
|
closed = new Array(data.length);
|
|
40870
40887
|
|
|
@@ -40880,9 +40897,9 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
|
|
|
40880
40897
|
numSegments += lineItem.length - 1;
|
|
40881
40898
|
|
|
40882
40899
|
for (j = 0; j < lineItem.length; j += 1) {
|
|
40883
|
-
pos = posFunc(lineItem[j], j, d, i);
|
|
40900
|
+
pos = posFunc ? posFunc(lineItem[j], j, d, i) : lineItem[j];
|
|
40884
40901
|
position.push(pos.x);
|
|
40885
|
-
position.push(
|
|
40902
|
+
position.push(pos.y);
|
|
40886
40903
|
position.push(pos.z || 0.0);
|
|
40887
40904
|
|
|
40888
40905
|
if (!j) {
|
|
@@ -40905,10 +40922,7 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
|
|
|
40905
40922
|
}
|
|
40906
40923
|
}
|
|
40907
40924
|
|
|
40908
|
-
|
|
40909
|
-
position = transform.transformCoordinates(target_gcs, map_gcs, position, 3);
|
|
40910
|
-
}
|
|
40911
|
-
|
|
40925
|
+
position = transform.transformCoordinates(target_gcs, map_gcs, position, 3);
|
|
40912
40926
|
m_origin = new Float32Array(m_this.style.get('origin')(position));
|
|
40913
40927
|
|
|
40914
40928
|
if (m_origin[0] || m_origin[1] || m_origin[2]) {
|
|
@@ -40961,6 +40975,7 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
|
|
|
40961
40975
|
continue;
|
|
40962
40976
|
}
|
|
40963
40977
|
|
|
40978
|
+
uniform = uniformVal === undefined ? uniformFunc(lineItem, i) : uniformVal;
|
|
40964
40979
|
d = data[i];
|
|
40965
40980
|
closedVal = closed[i];
|
|
40966
40981
|
firstPosIdx3 = posIdx3;
|
|
@@ -40990,13 +41005,27 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
|
|
|
40990
41005
|
v.next = j + 1 < lineItem.length ? posIdx3 + 3 : closedVal ? j !== lidx ? firstPosIdx3 + 3 : firstPosIdx3 + 6 - closedVal * 3 : posIdx3;
|
|
40991
41006
|
}
|
|
40992
41007
|
|
|
40993
|
-
|
|
40994
|
-
|
|
40995
|
-
|
|
41008
|
+
if (uniform && j > 0) {
|
|
41009
|
+
if (j === 1) {
|
|
41010
|
+
v.strokeWidth = vert[0].strokeWidth;
|
|
41011
|
+
v.strokeColor = vert[0].strokeColor;
|
|
41012
|
+
v.strokeOpacity = vert[0].strokeOpacity;
|
|
41013
|
+
}
|
|
41014
|
+
} else {
|
|
41015
|
+
v.strokeWidth = strokeWidthVal === undefined ? strokeWidthFunc(lineItemData, lidx, d, i) : strokeWidthVal;
|
|
41016
|
+
v.strokeColor = strokeColorVal === undefined ? strokeColorFunc(lineItemData, lidx, d, i) : strokeColorVal;
|
|
41017
|
+
v.strokeOpacity = strokeOpacityVal === undefined ? strokeOpacityFunc(lineItemData, lidx, d, i) : strokeOpacityVal;
|
|
41018
|
+
}
|
|
40996
41019
|
|
|
40997
41020
|
if (updateFlags) {
|
|
40998
41021
|
if (strokeOffsetVal !== 0) {
|
|
40999
|
-
|
|
41022
|
+
if (uniform && j > 0) {
|
|
41023
|
+
if (j === 1) {
|
|
41024
|
+
v.strokeOffset = vert[0].strokeOffset;
|
|
41025
|
+
}
|
|
41026
|
+
} else {
|
|
41027
|
+
v.strokeOffset = (strokeOffsetVal === undefined ? strokeOffsetFunc(lineItemData, lidx, d, i) : strokeOffsetVal) || 0;
|
|
41028
|
+
}
|
|
41000
41029
|
|
|
41001
41030
|
if (v.strokeOffset) {
|
|
41002
41031
|
/* we use 11 bits to store the offset, and we want to store values
|
|
@@ -43426,13 +43455,13 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
|
|
|
43426
43455
|
fillOpacityVal,
|
|
43427
43456
|
fillFunc,
|
|
43428
43457
|
fillVal,
|
|
43429
|
-
|
|
43458
|
+
uniformFunc,
|
|
43459
|
+
uniformVal,
|
|
43430
43460
|
uniform,
|
|
43431
43461
|
indices,
|
|
43432
43462
|
items = [],
|
|
43433
43463
|
target_gcs = m_this.gcs(),
|
|
43434
43464
|
map_gcs = m_this.layer().map().gcs(),
|
|
43435
|
-
simpleInverse = transform.onlyInvertedY(target_gcs, map_gcs),
|
|
43436
43465
|
numPts = 0,
|
|
43437
43466
|
geom = m_mapper.geometryData(),
|
|
43438
43467
|
color,
|
|
@@ -43455,14 +43484,17 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
|
|
|
43455
43484
|
fillOpacityVal = util.isFunction(m_this.style('fillOpacity')) ? undefined : fillOpacityFunc();
|
|
43456
43485
|
fillFunc = m_this.style.get('fill');
|
|
43457
43486
|
fillVal = util.isFunction(m_this.style('fill')) ? undefined : fillFunc();
|
|
43458
|
-
|
|
43487
|
+
uniformFunc = m_this.style.get('uniformPolygon');
|
|
43488
|
+
uniformVal = util.isFunction(m_this.style('uniformPolygon')) ? undefined : uniformFunc();
|
|
43459
43489
|
|
|
43460
43490
|
if (!onlyStyle) {
|
|
43461
43491
|
posFunc = m_this.style.get('position');
|
|
43492
|
+
posFunc = posFunc === util.identityFunction ? null : posFunc;
|
|
43462
43493
|
polyFunc = m_this.style.get('polygon');
|
|
43494
|
+
polyFunc = polyFunc === util.identityFunction ? null : polyFunc;
|
|
43463
43495
|
m_this.data().forEach(function (item, itemIndex) {
|
|
43464
43496
|
var polygon, outer, geometry, c;
|
|
43465
|
-
polygon = polyFunc(item, itemIndex);
|
|
43497
|
+
polygon = polyFunc ? polyFunc(item, itemIndex) : item;
|
|
43466
43498
|
|
|
43467
43499
|
if (!polygon) {
|
|
43468
43500
|
return;
|
|
@@ -43481,9 +43513,9 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
|
|
|
43481
43513
|
geometry = new Array(outer.length * 3);
|
|
43482
43514
|
|
|
43483
43515
|
for (i = d3 = 0; i < outer.length; i += 1, d3 += 3) {
|
|
43484
|
-
c = posFunc(outer[i], i, item, itemIndex);
|
|
43516
|
+
c = posFunc ? posFunc(outer[i], i, item, itemIndex) : outer[i];
|
|
43485
43517
|
geometry[d3] = c.x;
|
|
43486
|
-
geometry[d3 + 1] =
|
|
43518
|
+
geometry[d3 + 1] = c.y; // ignore the z values until we support them
|
|
43487
43519
|
|
|
43488
43520
|
geometry[d3 + 2] = 0; // c.z || 0;
|
|
43489
43521
|
}
|
|
@@ -43505,9 +43537,9 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
|
|
|
43505
43537
|
geometry.holes.push(d3 / 3);
|
|
43506
43538
|
|
|
43507
43539
|
for (i = 0; i < hole.length; i += 1, d3 += 3) {
|
|
43508
|
-
c = posFunc(hole[i], i, item, itemIndex);
|
|
43540
|
+
c = posFunc ? posFunc(hole[i], i, item, itemIndex) : hole[i];
|
|
43509
43541
|
geometry.vertices[d3] = c.x;
|
|
43510
|
-
geometry.vertices[d3 + 1] =
|
|
43542
|
+
geometry.vertices[d3 + 1] = c.y; // ignore the z values until we support them
|
|
43511
43543
|
|
|
43512
43544
|
geometry.vertices[d3 + 2] = 0; // c.z || 0;
|
|
43513
43545
|
}
|
|
@@ -43515,10 +43547,7 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
|
|
|
43515
43547
|
} // transform to map gcs
|
|
43516
43548
|
|
|
43517
43549
|
|
|
43518
|
-
|
|
43519
|
-
geometry.vertices = transform.transformCoordinates(target_gcs, map_gcs, geometry.vertices, geometry.dimensions);
|
|
43520
|
-
}
|
|
43521
|
-
|
|
43550
|
+
geometry.vertices = transform.transformCoordinates(target_gcs, map_gcs, geometry.vertices, geometry.dimensions);
|
|
43522
43551
|
record = {
|
|
43523
43552
|
// triangulate
|
|
43524
43553
|
triangles: earcut(geometry.vertices, geometry.holes, geometry.dimensions),
|
|
@@ -43564,7 +43593,7 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
|
|
|
43564
43593
|
item = items[k].item;
|
|
43565
43594
|
itemIndex = items[k].itemIndex;
|
|
43566
43595
|
original = items[k].original;
|
|
43567
|
-
uniform =
|
|
43596
|
+
uniform = uniformVal === undefined ? uniformFunc(item, itemIndex) : uniformVal;
|
|
43568
43597
|
opacity = fillOpacityVal;
|
|
43569
43598
|
|
|
43570
43599
|
if (uniform) {
|