geojs 1.6.2 → 1.6.6
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/.github/workflows/main.yml +1 -1
- package/.nvmrc +1 -0
- package/CHANGELOG.md +19 -1
- package/README.md +14 -9
- package/geo.js +821 -395
- package/geo.lean.js +820 -394
- package/geo.lean.min.js +3 -3
- package/geo.min.js +4 -4
- package/package.json +8 -10
- package/src/annotation.js +11 -7
- package/src/annotationLayer.js +13 -9
- package/src/camera.js +5 -5
- package/src/canvas/pixelmapFeature.js +187 -0
- package/src/choroplethFeature.js +1 -1
- package/src/domRenderer.js +2 -1
- package/src/featureLayer.js +1 -1
- package/src/fileReader.js +2 -2
- package/src/imageTile.js +2 -1
- package/src/isolineFeature.js +1 -1
- package/src/layer.js +4 -2
- package/src/lineFeature.js +3 -3
- package/src/map.js +17 -15
- package/src/mapInteractor.js +17 -17
- package/src/markerFeature.js +2 -2
- package/src/meshFeature.js +1 -1
- package/src/osmLayer.js +2 -0
- package/src/pixelmapFeature.js +52 -228
- package/src/pointFeature.js +1 -1
- package/src/polygonFeature.js +3 -3
- package/src/quadFeature.js +1 -1
- package/src/registry.js +2 -2
- package/src/svg/svgRenderer.js +3 -3
- package/src/tileCache.js +1 -1
- package/src/tileLayer.js +10 -10
- package/src/trackFeature.js +19 -19
- package/src/transform.js +8 -9
- package/src/typedef.js +2 -0
- package/src/ui/sliderWidget.js +1 -1
- package/src/util/clustering.js +3 -3
- package/src/util/color.js +1 -1
- package/src/util/common.js +7 -7
- package/src/util/throttle.js +1 -1
- package/src/vtkjs/pointFeature.js +1 -1
- package/src/webgl/index.js +2 -0
- package/src/webgl/lookupTable2D.js +122 -0
- package/src/webgl/markerFeature.js +1 -1
- package/src/webgl/pixelmapFeature.frag +47 -0
- package/src/webgl/pixelmapFeature.js +172 -0
- package/src/webgl/pointFeature.js +1 -1
- package/src/webgl/quadFeature.js +32 -1
- package/src/webgl/webglRenderer.js +1 -0
package/geo.lean.js
CHANGED
|
@@ -221,7 +221,7 @@ var annotation = function annotation(type, args) {
|
|
|
221
221
|
/**
|
|
222
222
|
* Get or set the name of this annotation.
|
|
223
223
|
*
|
|
224
|
-
* @param {string|undefined} arg If `undefined`, return the name, otherwise
|
|
224
|
+
* @param {string|undefined} [arg] If `undefined`, return the name, otherwise
|
|
225
225
|
* change it. When setting the name, the value is trimmed of
|
|
226
226
|
* whitespace. The name will not be changed to an empty string.
|
|
227
227
|
* @returns {this|string} The current name or this annotation.
|
|
@@ -398,7 +398,7 @@ var annotation = function annotation(type, args) {
|
|
|
398
398
|
/**
|
|
399
399
|
* Get or set the state of this annotation.
|
|
400
400
|
*
|
|
401
|
-
* @param {string|undefined} arg If `undefined`, return the state,
|
|
401
|
+
* @param {string|undefined} [arg] If `undefined`, return the state,
|
|
402
402
|
* otherwise change it. This should be one of the
|
|
403
403
|
* {@link geo.annotation.state} values.
|
|
404
404
|
* @returns {this|string} The current state or this annotation.
|
|
@@ -466,7 +466,7 @@ var annotation = function annotation(type, args) {
|
|
|
466
466
|
*/
|
|
467
467
|
|
|
468
468
|
|
|
469
|
-
this.processAction = function () {
|
|
469
|
+
this.processAction = function (evt) {
|
|
470
470
|
return undefined;
|
|
471
471
|
};
|
|
472
472
|
/**
|
|
@@ -1309,8 +1309,8 @@ var annotation = function annotation(type, args) {
|
|
|
1309
1309
|
*
|
|
1310
1310
|
* @param {object} m_this The current annotation instance.
|
|
1311
1311
|
* @param {function} s_actions The parent actions method.
|
|
1312
|
-
* @param {string}
|
|
1313
|
-
* the current state.
|
|
1312
|
+
* @param {string|undefined} state The state to return actions for. Defaults
|
|
1313
|
+
* to the current state.
|
|
1314
1314
|
* @param {string} name The name of this annotation.
|
|
1315
1315
|
* @param {Array} originalArgs arguments to original call
|
|
1316
1316
|
* @returns {geo.actionRecord[]} A list of actions.
|
|
@@ -1365,7 +1365,7 @@ function continuousVerticesProcessAction(m_this, evt, name) {
|
|
|
1365
1365
|
}
|
|
1366
1366
|
|
|
1367
1367
|
var cpp = layer.options('continuousPointProximity');
|
|
1368
|
-
var cpc = layer.options('
|
|
1368
|
+
var cpc = layer.options('continuousPointCollinearity');
|
|
1369
1369
|
var ccp = layer.options('continuousCloseProximity');
|
|
1370
1370
|
|
|
1371
1371
|
if (cpp || cpp === 0) {
|
|
@@ -1381,7 +1381,7 @@ function continuousVerticesProcessAction(m_this, evt, name) {
|
|
|
1381
1381
|
var dist = layer.displayDistance(vertices[vertices.length - 2], null, evt.mouse.map, 'display');
|
|
1382
1382
|
|
|
1383
1383
|
if (dist && dist > cpp) {
|
|
1384
|
-
// combine nearly
|
|
1384
|
+
// combine nearly collinear points
|
|
1385
1385
|
if (vertices.length >= (m_this._lastClickVertexCount || 1) + 3) {
|
|
1386
1386
|
var d01 = layer.displayDistance(vertices[vertices.length - 3], null, vertices[vertices.length - 2], null),
|
|
1387
1387
|
d12 = dist,
|
|
@@ -1429,6 +1429,11 @@ function continuousVerticesProcessAction(m_this, evt, name) {
|
|
|
1429
1429
|
* rectangle in edit mode.
|
|
1430
1430
|
*/
|
|
1431
1431
|
|
|
1432
|
+
/*
|
|
1433
|
+
* @typedef {object} geo.rectangleAnnotation.subspec
|
|
1434
|
+
* @typedef {geo.annotation.spec | geo.rectangleAnnotation.subspec} geo.rectangleAnnotation.spec
|
|
1435
|
+
*/
|
|
1436
|
+
|
|
1432
1437
|
/**
|
|
1433
1438
|
* Rectangle annotation class.
|
|
1434
1439
|
*
|
|
@@ -2894,9 +2899,9 @@ var textFeature = __webpack_require__(9757);
|
|
|
2894
2899
|
* @property {number} [continuousPointProximity=5] The minimum distance in
|
|
2895
2900
|
* display coordinates (pixels) between two adjacent points when dragging
|
|
2896
2901
|
* to create an annotation. `false` disables continuous drawing mode.
|
|
2897
|
-
* @property {number} [
|
|
2902
|
+
* @property {number} [continuousPointCollinearity=1.0deg] The minimum angle
|
|
2898
2903
|
* between a series of three points when dragging to not interpret them as
|
|
2899
|
-
*
|
|
2904
|
+
* collinear. Only applies if `continuousPointProximity` is not `false`.
|
|
2900
2905
|
* @property {number} [continuousCloseProximity=10] The minimum distance in
|
|
2901
2906
|
* display coordinates (pixels) to close a polygon or end drawing a line when
|
|
2902
2907
|
* dragging to create an annotation. `false` never closes at the end of a
|
|
@@ -3048,8 +3053,8 @@ var annotationLayer = function annotationLayer(arg) {
|
|
|
3048
3053
|
// continuous drawing modes.
|
|
3049
3054
|
continuousPointProximity: 5,
|
|
3050
3055
|
// in radians, minimum angle between continuous points to interpret them as
|
|
3051
|
-
// being
|
|
3052
|
-
|
|
3056
|
+
// being collinear
|
|
3057
|
+
continuousPointCollinearity: 1.0 * Math.PI / 180,
|
|
3053
3058
|
continuousCloseProximity: 10,
|
|
3054
3059
|
// in pixels, 0 is exact
|
|
3055
3060
|
finalPointProximity: 10,
|
|
@@ -3348,13 +3353,15 @@ var annotationLayer = function annotationLayer(arg) {
|
|
|
3348
3353
|
* @param {geo.annotation} annotation The annotation to add.
|
|
3349
3354
|
* @param {string|geo.transform|null} [gcs] `undefined` to use the interface
|
|
3350
3355
|
* gcs, `null` to use the map gcs, or any other transform.
|
|
3356
|
+
* @param {boolean} [update] If `false`, don't update the layer after adding
|
|
3357
|
+
* the annotation.
|
|
3351
3358
|
* @returns {this} The current layer.
|
|
3352
3359
|
* @fires geo.event.annotation.add_before
|
|
3353
3360
|
* @fires geo.event.annotation.add
|
|
3354
3361
|
*/
|
|
3355
3362
|
|
|
3356
3363
|
|
|
3357
|
-
this.addAnnotation = function (annotation, gcs) {
|
|
3364
|
+
this.addAnnotation = function (annotation, gcs, update) {
|
|
3358
3365
|
var pos = $.inArray(annotation, m_annotations);
|
|
3359
3366
|
|
|
3360
3367
|
if (pos < 0) {
|
|
@@ -3370,8 +3377,11 @@ var annotationLayer = function annotationLayer(arg) {
|
|
|
3370
3377
|
annotation._coordinates(transform.transformCoordinates(gcs, map.gcs(), annotation._coordinates()));
|
|
3371
3378
|
}
|
|
3372
3379
|
|
|
3373
|
-
|
|
3374
|
-
|
|
3380
|
+
if (update !== false) {
|
|
3381
|
+
m_this.modified();
|
|
3382
|
+
m_this.draw();
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3375
3385
|
m_this.geoTrigger(geo_event.annotation.add, {
|
|
3376
3386
|
annotation: annotation
|
|
3377
3387
|
});
|
|
@@ -3383,7 +3393,7 @@ var annotationLayer = function annotationLayer(arg) {
|
|
|
3383
3393
|
* Remove an annotation from the layer.
|
|
3384
3394
|
*
|
|
3385
3395
|
* @param {geo.annotation} annotation The annotation to remove.
|
|
3386
|
-
* @param {boolean} update If `false`, don't update the layer after removing
|
|
3396
|
+
* @param {boolean} [update] If `false`, don't update the layer after removing
|
|
3387
3397
|
* the annotation.
|
|
3388
3398
|
* @returns {boolean} `true` if an annotation was removed.
|
|
3389
3399
|
* @fires geo.event.annotation.remove
|
|
@@ -3597,7 +3607,7 @@ var annotationLayer = function annotationLayer(arg) {
|
|
|
3597
3607
|
* Return the current set of annotations as a geojson object. Alternately,
|
|
3598
3608
|
* add a set of annotations from a geojson object.
|
|
3599
3609
|
*
|
|
3600
|
-
* @param {string|
|
|
3610
|
+
* @param {string|object|File} [geojson] If present, add annotations based on
|
|
3601
3611
|
* the given geojson object. If `undefined`, return the current
|
|
3602
3612
|
* annotations as geojson. This may be a JSON string, a javascript
|
|
3603
3613
|
* object, or a File object.
|
|
@@ -4825,7 +4835,7 @@ var camera = function camera(spec) {
|
|
|
4825
4835
|
* Project a vector from world space into viewport (display) space. The
|
|
4826
4836
|
* resulting vector always has the last component (`w`) equal to 1.
|
|
4827
4837
|
*
|
|
4828
|
-
* @param {
|
|
4838
|
+
* @param {vec3|vec4} point The point in world coordinates.
|
|
4829
4839
|
* @returns {vec4} The point in display coordinates.
|
|
4830
4840
|
*/
|
|
4831
4841
|
|
|
@@ -4844,7 +4854,7 @@ var camera = function camera(spec) {
|
|
|
4844
4854
|
* Project a vector from viewport (display) space into world space. The
|
|
4845
4855
|
* resulting vector always has the last component (`w`) equal to 1.
|
|
4846
4856
|
*
|
|
4847
|
-
* @param {
|
|
4857
|
+
* @param {vec3|vec4} point The point in display coordinates.
|
|
4848
4858
|
* @returns {vec4} The point in world space coordinates.
|
|
4849
4859
|
*/
|
|
4850
4860
|
|
|
@@ -5157,7 +5167,7 @@ var camera = function camera(spec) {
|
|
|
5157
5167
|
/**
|
|
5158
5168
|
* Represent a glmatrix as a pretty-printed string.
|
|
5159
5169
|
* @param {mat4} mat A 4 x 4 matrix.
|
|
5160
|
-
* @param {number} prec The number of decimal places.
|
|
5170
|
+
* @param {number} [prec] The number of decimal places.
|
|
5161
5171
|
* @returns {string}
|
|
5162
5172
|
*/
|
|
5163
5173
|
|
|
@@ -5225,7 +5235,7 @@ var camera = function camera(spec) {
|
|
|
5225
5235
|
};
|
|
5226
5236
|
/**
|
|
5227
5237
|
* Supported projection types.
|
|
5228
|
-
* @enum
|
|
5238
|
+
* @enum {boolean}
|
|
5229
5239
|
*/
|
|
5230
5240
|
|
|
5231
5241
|
|
|
@@ -5236,7 +5246,7 @@ camera.projection = {
|
|
|
5236
5246
|
/**
|
|
5237
5247
|
* Default camera clipping bounds. Some features and renderers may rely on the
|
|
5238
5248
|
* far clip value being more positive than the near clip value.
|
|
5239
|
-
* @enum
|
|
5249
|
+
* @enum {number}
|
|
5240
5250
|
*/
|
|
5241
5251
|
|
|
5242
5252
|
camera.clipbounds = {
|
|
@@ -6350,6 +6360,10 @@ var inherit = __webpack_require__(5699);
|
|
|
6350
6360
|
var registerFeature = (__webpack_require__(4647).registerFeature);
|
|
6351
6361
|
|
|
6352
6362
|
var pixelmapFeature = __webpack_require__(6374);
|
|
6363
|
+
|
|
6364
|
+
var geo_event = __webpack_require__(5108);
|
|
6365
|
+
|
|
6366
|
+
var util = __webpack_require__(4634);
|
|
6353
6367
|
/**
|
|
6354
6368
|
* Create a new instance of class pixelmapFeature.
|
|
6355
6369
|
*
|
|
@@ -6373,6 +6387,216 @@ var canvas_pixelmapFeature = function canvas_pixelmapFeature(arg) {
|
|
|
6373
6387
|
var object = __webpack_require__(3160);
|
|
6374
6388
|
|
|
6375
6389
|
object.call(this);
|
|
6390
|
+
var m_quadFeature,
|
|
6391
|
+
s_exit = this._exit,
|
|
6392
|
+
m_this = this;
|
|
6393
|
+
/**
|
|
6394
|
+
* If the specified coordinates are in the rendered quad, use the basis
|
|
6395
|
+
* information from the quad to determine the pixelmap index value so that it
|
|
6396
|
+
* can be included in the `found` results.
|
|
6397
|
+
*
|
|
6398
|
+
* @param {geo.geoPosition} geo Coordinate.
|
|
6399
|
+
* @param {string|geo.transform|null} [gcs] Input gcs. `undefined` to use
|
|
6400
|
+
* the interface gcs, `null` to use the map gcs, or any other transform.
|
|
6401
|
+
* @returns {geo.feature.searchResult} An object with a list of features and
|
|
6402
|
+
* feature indices that are located at the specified point.
|
|
6403
|
+
*/
|
|
6404
|
+
|
|
6405
|
+
this.pointSearch = function (geo, gcs) {
|
|
6406
|
+
if (m_quadFeature && m_this.m_info) {
|
|
6407
|
+
var result = m_quadFeature.pointSearch(geo, gcs);
|
|
6408
|
+
|
|
6409
|
+
if (result.index.length === 1 && result.extra && result.extra[result.index[0]].basis) {
|
|
6410
|
+
var basis = result.extra[result.index[0]].basis,
|
|
6411
|
+
x,
|
|
6412
|
+
y,
|
|
6413
|
+
idx;
|
|
6414
|
+
x = Math.floor(basis.x * m_this.m_info.width);
|
|
6415
|
+
y = Math.floor(basis.y * m_this.m_info.height);
|
|
6416
|
+
|
|
6417
|
+
if (x >= 0 && x < m_this.m_info.width && y >= 0 && y < m_this.m_info.height) {
|
|
6418
|
+
idx = m_this.m_info.indices[y * m_this.m_info.width + x];
|
|
6419
|
+
result = {
|
|
6420
|
+
index: [idx],
|
|
6421
|
+
found: [m_this.data()[idx]]
|
|
6422
|
+
};
|
|
6423
|
+
return result;
|
|
6424
|
+
}
|
|
6425
|
+
}
|
|
6426
|
+
}
|
|
6427
|
+
|
|
6428
|
+
return {
|
|
6429
|
+
index: [],
|
|
6430
|
+
found: []
|
|
6431
|
+
};
|
|
6432
|
+
};
|
|
6433
|
+
/**
|
|
6434
|
+
* Compute information for this pixelmap image. It is wasteful to call this
|
|
6435
|
+
* if the pixelmap has already been prepared (it is invalidated by a change
|
|
6436
|
+
* in the image).
|
|
6437
|
+
*
|
|
6438
|
+
* @returns {geo.pixelmapFeature.info}
|
|
6439
|
+
*/
|
|
6440
|
+
|
|
6441
|
+
|
|
6442
|
+
this._preparePixelmap = function () {
|
|
6443
|
+
var i, idx, pixelData;
|
|
6444
|
+
|
|
6445
|
+
if (!util.isReadyImage(m_this.m_srcImage)) {
|
|
6446
|
+
return;
|
|
6447
|
+
}
|
|
6448
|
+
|
|
6449
|
+
m_this.m_info = {
|
|
6450
|
+
width: m_this.m_srcImage.naturalWidth,
|
|
6451
|
+
height: m_this.m_srcImage.naturalHeight,
|
|
6452
|
+
canvas: document.createElement('canvas')
|
|
6453
|
+
};
|
|
6454
|
+
m_this.m_info.canvas.width = m_this.m_info.width;
|
|
6455
|
+
m_this.m_info.canvas.height = m_this.m_info.height;
|
|
6456
|
+
m_this.m_info.context = m_this.m_info.canvas.getContext('2d');
|
|
6457
|
+
m_this.m_info.context.drawImage(m_this.m_srcImage, 0, 0);
|
|
6458
|
+
m_this.m_info.imageData = m_this.m_info.context.getImageData(0, 0, m_this.m_info.canvas.width, m_this.m_info.canvas.height);
|
|
6459
|
+
pixelData = m_this.m_info.imageData.data;
|
|
6460
|
+
m_this.m_info.indices = new Array(pixelData.length / 4);
|
|
6461
|
+
m_this.m_info.area = pixelData.length / 4;
|
|
6462
|
+
m_this.m_info.mappedColors = {};
|
|
6463
|
+
|
|
6464
|
+
for (i = 0; i < pixelData.length; i += 4) {
|
|
6465
|
+
idx = pixelData[i] + (pixelData[i + 1] << 8) + (pixelData[i + 2] << 16);
|
|
6466
|
+
m_this.m_info.indices[i / 4] = idx;
|
|
6467
|
+
|
|
6468
|
+
if (!m_this.m_info.mappedColors[idx]) {
|
|
6469
|
+
m_this.m_info.mappedColors[idx] = {
|
|
6470
|
+
first: i / 4
|
|
6471
|
+
};
|
|
6472
|
+
}
|
|
6473
|
+
|
|
6474
|
+
m_this.m_info.mappedColors[idx].last = i / 4;
|
|
6475
|
+
}
|
|
6476
|
+
|
|
6477
|
+
return m_this.m_info;
|
|
6478
|
+
};
|
|
6479
|
+
/**
|
|
6480
|
+
* Given the loaded pixelmap image, create a canvas the size of the image.
|
|
6481
|
+
* Compute a color for each distinct index and recolor the canvas based on
|
|
6482
|
+
* these colors, then draw the resultant image as a quad.
|
|
6483
|
+
*
|
|
6484
|
+
* @fires geo.event.pixelmap.prepared
|
|
6485
|
+
*/
|
|
6486
|
+
|
|
6487
|
+
|
|
6488
|
+
this._computePixelmap = function () {
|
|
6489
|
+
var data = m_this.data() || [],
|
|
6490
|
+
colorFunc = m_this.style.get('color'),
|
|
6491
|
+
i,
|
|
6492
|
+
idx,
|
|
6493
|
+
lastidx,
|
|
6494
|
+
color,
|
|
6495
|
+
pixelData,
|
|
6496
|
+
indices,
|
|
6497
|
+
mappedColors,
|
|
6498
|
+
updateFirst,
|
|
6499
|
+
updateLast = -1,
|
|
6500
|
+
update,
|
|
6501
|
+
prepared;
|
|
6502
|
+
|
|
6503
|
+
if (!m_this.m_info) {
|
|
6504
|
+
if (!m_this._preparePixelmap()) {
|
|
6505
|
+
return;
|
|
6506
|
+
}
|
|
6507
|
+
|
|
6508
|
+
prepared = true;
|
|
6509
|
+
}
|
|
6510
|
+
|
|
6511
|
+
mappedColors = m_this.m_info.mappedColors;
|
|
6512
|
+
updateFirst = m_this.m_info.area;
|
|
6513
|
+
|
|
6514
|
+
for (idx in mappedColors) {
|
|
6515
|
+
if (mappedColors.hasOwnProperty(idx)) {
|
|
6516
|
+
color = colorFunc(data[idx], +idx) || {};
|
|
6517
|
+
color = [(color.r || 0) * 255, (color.g || 0) * 255, (color.b || 0) * 255, color.a === undefined ? 255 : color.a * 255];
|
|
6518
|
+
mappedColors[idx].update = !mappedColors[idx].color || mappedColors[idx].color[0] !== color[0] || mappedColors[idx].color[1] !== color[1] || mappedColors[idx].color[2] !== color[2] || mappedColors[idx].color[3] !== color[3];
|
|
6519
|
+
|
|
6520
|
+
if (mappedColors[idx].update) {
|
|
6521
|
+
mappedColors[idx].color = color;
|
|
6522
|
+
updateFirst = Math.min(mappedColors[idx].first, updateFirst);
|
|
6523
|
+
updateLast = Math.max(mappedColors[idx].last, updateLast);
|
|
6524
|
+
}
|
|
6525
|
+
}
|
|
6526
|
+
}
|
|
6527
|
+
/* If nothing was updated, we are done */
|
|
6528
|
+
|
|
6529
|
+
|
|
6530
|
+
if (updateFirst >= updateLast) {
|
|
6531
|
+
return;
|
|
6532
|
+
}
|
|
6533
|
+
/* Update only the extent that has changed */
|
|
6534
|
+
|
|
6535
|
+
|
|
6536
|
+
pixelData = m_this.m_info.imageData.data;
|
|
6537
|
+
indices = m_this.m_info.indices;
|
|
6538
|
+
|
|
6539
|
+
for (i = updateFirst; i <= updateLast; i += 1) {
|
|
6540
|
+
idx = indices[i];
|
|
6541
|
+
|
|
6542
|
+
if (idx !== lastidx) {
|
|
6543
|
+
lastidx = idx;
|
|
6544
|
+
color = mappedColors[idx].color;
|
|
6545
|
+
update = mappedColors[idx].update;
|
|
6546
|
+
}
|
|
6547
|
+
|
|
6548
|
+
if (update) {
|
|
6549
|
+
pixelData[i * 4] = color[0];
|
|
6550
|
+
pixelData[i * 4 + 1] = color[1];
|
|
6551
|
+
pixelData[i * 4 + 2] = color[2];
|
|
6552
|
+
pixelData[i * 4 + 3] = color[3];
|
|
6553
|
+
}
|
|
6554
|
+
}
|
|
6555
|
+
/* Place the updated area into the canvas */
|
|
6556
|
+
|
|
6557
|
+
|
|
6558
|
+
m_this.m_info.context.putImageData(m_this.m_info.imageData, 0, 0, 0, Math.floor(updateFirst / m_this.m_info.width), m_this.m_info.width, Math.ceil((updateLast + 1) / m_this.m_info.width));
|
|
6559
|
+
/* If we haven't made a quad feature, make one now. The quad feature needs
|
|
6560
|
+
* to have the canvas capability. */
|
|
6561
|
+
|
|
6562
|
+
if (!m_quadFeature) {
|
|
6563
|
+
m_quadFeature = m_this.layer().createFeature('quad', {
|
|
6564
|
+
selectionAPI: false,
|
|
6565
|
+
gcs: m_this.gcs(),
|
|
6566
|
+
visible: m_this.visible(undefined, true)
|
|
6567
|
+
});
|
|
6568
|
+
m_this.dependentFeatures([m_quadFeature]);
|
|
6569
|
+
m_quadFeature.style({
|
|
6570
|
+
image: m_this.m_info.canvas,
|
|
6571
|
+
position: m_this.style.get('position')
|
|
6572
|
+
}).data([{}]).draw();
|
|
6573
|
+
}
|
|
6574
|
+
/* If we prepared the pixelmap and rendered it, send a prepared event */
|
|
6575
|
+
|
|
6576
|
+
|
|
6577
|
+
if (prepared) {
|
|
6578
|
+
m_this.geoTrigger(geo_event.pixelmap.prepared, {
|
|
6579
|
+
pixelmap: m_this
|
|
6580
|
+
});
|
|
6581
|
+
}
|
|
6582
|
+
};
|
|
6583
|
+
/**
|
|
6584
|
+
* Destroy. Deletes the associated quadFeature.
|
|
6585
|
+
*
|
|
6586
|
+
* @returns {this}
|
|
6587
|
+
*/
|
|
6588
|
+
|
|
6589
|
+
|
|
6590
|
+
this._exit = function () {
|
|
6591
|
+
if (m_quadFeature && m_this.layer()) {
|
|
6592
|
+
m_this.layer().deleteFeature(m_quadFeature);
|
|
6593
|
+
m_quadFeature = null;
|
|
6594
|
+
m_this.dependentFeatures([]);
|
|
6595
|
+
}
|
|
6596
|
+
|
|
6597
|
+
s_exit();
|
|
6598
|
+
return m_this;
|
|
6599
|
+
};
|
|
6376
6600
|
|
|
6377
6601
|
this._init(arg);
|
|
6378
6602
|
|
|
@@ -7395,7 +7619,7 @@ var choroplethFeature = function choroplethFeature(arg) {
|
|
|
7395
7619
|
/**
|
|
7396
7620
|
* Add a geojson polygon feature to the current layer.
|
|
7397
7621
|
*
|
|
7398
|
-
* @param {geojsonFeature} feature A geojson parsed feature.
|
|
7622
|
+
* @param {geo.geojsonFeature} feature A geojson parsed feature.
|
|
7399
7623
|
* @param {geo.geoColor} fillColor The fill color for the feature.
|
|
7400
7624
|
* @returns {geo.polygonFeature}
|
|
7401
7625
|
*/
|
|
@@ -7809,11 +8033,12 @@ var domRenderer = function domRenderer(arg) {
|
|
|
7809
8033
|
/**
|
|
7810
8034
|
* Initialize.
|
|
7811
8035
|
*
|
|
8036
|
+
* @param {object} [arg] Optional arguments.
|
|
7812
8037
|
* @returns {this}
|
|
7813
8038
|
*/
|
|
7814
8039
|
|
|
7815
8040
|
|
|
7816
|
-
this._init = function () {
|
|
8041
|
+
this._init = function (arg) {
|
|
7817
8042
|
var layer = m_this.layer().node();
|
|
7818
8043
|
|
|
7819
8044
|
if (!m_this.canvas() && layer && layer.length) {
|
|
@@ -9762,7 +9987,7 @@ var featureLayer = function featureLayer(arg) {
|
|
|
9762
9987
|
/**
|
|
9763
9988
|
* Get/Set drawables.
|
|
9764
9989
|
*
|
|
9765
|
-
* @param {geo.feature[]} val A list of features, or unspecified to return
|
|
9990
|
+
* @param {geo.feature[]} [val] A list of features, or unspecified to return
|
|
9766
9991
|
* the current feature list. If a list is provided, features are added or
|
|
9767
9992
|
* removed as needed.
|
|
9768
9993
|
* @returns {geo.feature[]|this} The current features associated with the
|
|
@@ -10346,7 +10571,7 @@ var object = __webpack_require__(3737);
|
|
|
10346
10571
|
* Object specification for a fileReader.
|
|
10347
10572
|
*
|
|
10348
10573
|
* @typedef {object} geo.fileReader.spec
|
|
10349
|
-
* @property {geo.featureLayer} layer The target feature layer.
|
|
10574
|
+
* @property {geo.featureLayer} [layer] The target feature layer.
|
|
10350
10575
|
*/
|
|
10351
10576
|
|
|
10352
10577
|
/**
|
|
@@ -10355,7 +10580,7 @@ var object = __webpack_require__(3737);
|
|
|
10355
10580
|
* @class
|
|
10356
10581
|
* @alias geo.fileReader
|
|
10357
10582
|
* @extends geo.object
|
|
10358
|
-
* @param {geo.fileReader.spec} arg
|
|
10583
|
+
* @param {geo.fileReader.spec} [arg]
|
|
10359
10584
|
* @returns {geo.fileReader}
|
|
10360
10585
|
*/
|
|
10361
10586
|
|
|
@@ -11833,7 +12058,8 @@ var tile = __webpack_require__(8418);
|
|
|
11833
12058
|
* @property {object} [size] The size of each tile.
|
|
11834
12059
|
* @property {number} [size.x=256] Width in pixels.
|
|
11835
12060
|
* @property {number} [size.y=256] Height in pixels.
|
|
11836
|
-
* @property {string} [crossDomain='anonymous'] Image CORS attribute.
|
|
12061
|
+
* @property {string} [crossDomain='anonymous'] Image CORS attribute. This is
|
|
12062
|
+
* used for the `crossorigin` property when loading images.
|
|
11837
12063
|
*/
|
|
11838
12064
|
|
|
11839
12065
|
/**
|
|
@@ -12997,7 +13223,7 @@ var isolineFeature = function isolineFeature(arg) {
|
|
|
12997
13223
|
* the generated labels. The viewport calculation is conservative, as the
|
|
12998
13224
|
* map could be rotated, changed size, or have other modifications.
|
|
12999
13225
|
*
|
|
13000
|
-
* @returns {
|
|
13226
|
+
* @returns {this}
|
|
13001
13227
|
*/
|
|
13002
13228
|
|
|
13003
13229
|
|
|
@@ -13605,7 +13831,7 @@ var layer = function layer(arg) {
|
|
|
13605
13831
|
/**
|
|
13606
13832
|
* Get root node of the layer.
|
|
13607
13833
|
*
|
|
13608
|
-
* @returns {
|
|
13834
|
+
* @returns {HTMLDivElement}
|
|
13609
13835
|
*/
|
|
13610
13836
|
|
|
13611
13837
|
|
|
@@ -13933,11 +14159,13 @@ var layer = function layer(arg) {
|
|
|
13933
14159
|
* Update layer.
|
|
13934
14160
|
*
|
|
13935
14161
|
* This is a stub that should be subclassed.
|
|
14162
|
+
*
|
|
14163
|
+
* @param {object} [arg] An object, possibly with an ``event`` key and value.
|
|
13936
14164
|
* @returns {this}
|
|
13937
14165
|
*/
|
|
13938
14166
|
|
|
13939
14167
|
|
|
13940
|
-
this._update = function () {
|
|
14168
|
+
this._update = function (arg) {
|
|
13941
14169
|
return m_this;
|
|
13942
14170
|
};
|
|
13943
14171
|
/**
|
|
@@ -14612,9 +14840,9 @@ var lineFeature = function lineFeature(arg) {
|
|
|
14612
14840
|
*
|
|
14613
14841
|
* @param {array} data A new data array.
|
|
14614
14842
|
* @param {number} [tolerance] The maximum variation allowed in map.gcs
|
|
14615
|
-
* units. A value of zero will only remove perfectly
|
|
14616
|
-
* not specified, this is set to a half display pixel at the map's
|
|
14617
|
-
* zoom level.
|
|
14843
|
+
* units. A value of zero will only remove perfectly collinear points.
|
|
14844
|
+
* If not specified, this is set to a half display pixel at the map's
|
|
14845
|
+
* current zoom level.
|
|
14618
14846
|
* @param {function} [posFunc=this.style.get('position')] The function to
|
|
14619
14847
|
* get the position of each vertex.
|
|
14620
14848
|
* @param {function} [lineFunc=this.style.get('line')] The function to get
|
|
@@ -15352,7 +15580,7 @@ var map = function map(arg) {
|
|
|
15352
15580
|
* view center. Rotation mostly ignores `clampBoundsX`, as the behavior
|
|
15353
15581
|
* feels peculiar otherwise.
|
|
15354
15582
|
*
|
|
15355
|
-
* @param {number} rotation Absolute angle in radians (positive is
|
|
15583
|
+
* @param {number} [rotation] Absolute angle in radians (positive is
|
|
15356
15584
|
* clockwise).
|
|
15357
15585
|
* @param {object} [origin] If specified, rotate about this origin.
|
|
15358
15586
|
* @param {geo.geoPosition} origin.geo The gcs coordinates of the
|
|
@@ -15710,7 +15938,7 @@ var map = function map(arg) {
|
|
|
15710
15938
|
* coordinate to convert.
|
|
15711
15939
|
* @param {string|geo.transform|null} [gcs] Output gcs. `undefined` to use
|
|
15712
15940
|
* the interface gcs, `null` to use the map gcs, or any other transform.
|
|
15713
|
-
* @returns {geo.geoPosition|geoPosition[]} GCS space coordinates.
|
|
15941
|
+
* @returns {geo.geoPosition|geo.geoPosition[]} GCS space coordinates.
|
|
15714
15942
|
*/
|
|
15715
15943
|
|
|
15716
15944
|
|
|
@@ -15852,11 +16080,12 @@ var map = function map(arg) {
|
|
|
15852
16080
|
/**
|
|
15853
16081
|
* Initialize the map.
|
|
15854
16082
|
*
|
|
16083
|
+
* @param {object} [arg] Optional arguments.
|
|
15855
16084
|
* @returns {this} The map object.
|
|
15856
16085
|
*/
|
|
15857
16086
|
|
|
15858
16087
|
|
|
15859
|
-
this._init = function () {
|
|
16088
|
+
this._init = function (arg) {
|
|
15860
16089
|
if (m_node === undefined || m_node === null) {
|
|
15861
16090
|
throw new Error('Map require DIV node');
|
|
15862
16091
|
}
|
|
@@ -16223,7 +16452,7 @@ var map = function map(arg) {
|
|
|
16223
16452
|
m_center = m_this.gcsToWorld({
|
|
16224
16453
|
x: p[0],
|
|
16225
16454
|
y: p[1]
|
|
16226
|
-
}, null
|
|
16455
|
+
}, null);
|
|
16227
16456
|
m_this.zoom(p[2], m_transition.zoomOrigin, true);
|
|
16228
16457
|
}
|
|
16229
16458
|
|
|
@@ -16463,7 +16692,7 @@ var map = function map(arg) {
|
|
|
16463
16692
|
* @param {number} rotation The requested rotation in clockwise radians.
|
|
16464
16693
|
* @param {string|geo.transform|null} [gcs] `undefined` to use the interface
|
|
16465
16694
|
* gcs, `null` to use the map gcs, or any other transform.
|
|
16466
|
-
* @param {boolean} ignoreDiscreteZoom If `true`, ignore the `discreteZoom`
|
|
16695
|
+
* @param {boolean} [ignoreDiscreteZoom] If `true`, ignore the `discreteZoom`
|
|
16467
16696
|
* option when determining the new view.
|
|
16468
16697
|
* @param {boolean} [ignoreClampBounds] If `true` and `clampBoundsX` or
|
|
16469
16698
|
* `clampBoundsY` is set, allow the bounds to be less clamped.
|
|
@@ -16715,11 +16944,11 @@ var map = function map(arg) {
|
|
|
16715
16944
|
* @param {boolean|null} [opts.attribution=null] If `null` or unspecified,
|
|
16716
16945
|
* include the attribution only if all layers are used. If false, never
|
|
16717
16946
|
* include the attribution. If `true`, always include it.
|
|
16718
|
-
* @param {
|
|
16947
|
+
* @param {HTMLElement[]|string[]} [opts.html] A list of additional HTML
|
|
16719
16948
|
* elements, selectors, or jQuery elements to render on top of the map.
|
|
16720
16949
|
* These are rendered in order, with the last one topmost.
|
|
16721
|
-
* @returns {
|
|
16722
|
-
* either a data URL or an `HTMLCanvasElement` with the result.
|
|
16950
|
+
* @returns {jQueryDeferred} A jQuery Deferred object. The done function
|
|
16951
|
+
* receives either a data URL or an `HTMLCanvasElement` with the result.
|
|
16723
16952
|
* @fires geo.event.screenshot.ready
|
|
16724
16953
|
*/
|
|
16725
16954
|
|
|
@@ -16928,7 +17157,7 @@ var map = function map(arg) {
|
|
|
16928
17157
|
/**
|
|
16929
17158
|
* Return the nearest valid zoom level to the requested zoom.
|
|
16930
17159
|
* @param {number} zoom A zoom level to adjust to current settings
|
|
16931
|
-
* @param {boolean} ignoreDiscreteZoom If `true`, ignore the `discreteZoom`
|
|
17160
|
+
* @param {boolean} [ignoreDiscreteZoom] If `true`, ignore the `discreteZoom`
|
|
16932
17161
|
* option when determining the new view.
|
|
16933
17162
|
* @returns {number} The zoom level clamped to the allowed zoom range and
|
|
16934
17163
|
* with other settings applied.
|
|
@@ -16972,10 +17201,11 @@ var map = function map(arg) {
|
|
|
16972
17201
|
* Draw a layer image to a canvas context. The layer's opacity and transform
|
|
16973
17202
|
* are applied. This is used as part of making a screenshot.
|
|
16974
17203
|
*
|
|
16975
|
-
* @param {
|
|
17204
|
+
* @param {CanvasRenderingContext2D} context The 2d canvas context to draw
|
|
17205
|
+
* into.
|
|
16976
17206
|
* @param {number} opacity The opacity in the range [0, 1].
|
|
16977
17207
|
* @param {object} elem A jQuery element that might have a transform.
|
|
16978
|
-
* @param {
|
|
17208
|
+
* @param {HTMLImageElement} img The image or canvas to draw to the canvas.
|
|
16979
17209
|
* @param {string} [mixBlendMode] the mix-blend-mode used to add this layer.
|
|
16980
17210
|
* @private
|
|
16981
17211
|
*/
|
|
@@ -17183,12 +17413,12 @@ var map = function map(arg) {
|
|
|
17183
17413
|
* Return a valid rotation angle.
|
|
17184
17414
|
*
|
|
17185
17415
|
* @param {number} rotation Proposed rotation.
|
|
17186
|
-
* @param {boolean} ignoreRotationFunc If truthy and rotations are allowed,
|
|
17416
|
+
* @param {boolean} [ignoreRotationFunc] If truthy and rotations are allowed,
|
|
17187
17417
|
* allow any rotation. Otherwise, the rotation is passed through the
|
|
17188
17418
|
* `allowRotation` function.
|
|
17189
|
-
* @param {boolean} noRangeLimit If falsy, ensure that the rotation is in
|
|
17190
|
-
* range [0, 2*PI). If it is very close to zero, it is snapped to
|
|
17191
|
-
* If true, the rotation can have any value.
|
|
17419
|
+
* @param {boolean} [noRangeLimit] If falsy, ensure that the rotation is in
|
|
17420
|
+
* the range [0, 2*PI). If it is very close to zero, it is snapped to
|
|
17421
|
+
* zero. If true, the rotation can have any value.
|
|
17192
17422
|
* @returns {number} the validated rotation
|
|
17193
17423
|
* @private
|
|
17194
17424
|
*/
|
|
@@ -19846,26 +20076,26 @@ var mapInteractor = function mapInteractor(args) {
|
|
|
19846
20076
|
* map in pixels relative to the map's div.
|
|
19847
20077
|
* @param {geo.screenPosition} [options.center] The position of a touch
|
|
19848
20078
|
* event center relative to the window.
|
|
19849
|
-
* @param {string} [button] One of `left`, `middle`, or `right` for
|
|
19850
|
-
* events.
|
|
19851
|
-
* @param {string} [modifiers] A space-separated list of metakeys
|
|
19852
|
-
* down on mouse events.
|
|
19853
|
-
* @param {geo.screenPosition} [wheelDelta] The amount the wheel
|
|
19854
|
-
* both directions for wheel events. One step is often 20 units
|
|
19855
|
-
*
|
|
19856
|
-
* @param {number} [wheelMode] The wheel delta mode. See
|
|
20079
|
+
* @param {string} [options.button] One of `left`, `middle`, or `right` for
|
|
20080
|
+
* mouse events.
|
|
20081
|
+
* @param {string} [options.modifiers] A space-separated list of metakeys
|
|
20082
|
+
* that are down on mouse events.
|
|
20083
|
+
* @param {geo.screenPosition} [options.wheelDelta] The amount the wheel
|
|
20084
|
+
* moved in both directions for wheel events. One step is often 20 units
|
|
20085
|
+
* of movement.
|
|
20086
|
+
* @param {number} [options.wheelMode] The wheel delta mode. See
|
|
19857
20087
|
* https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent .
|
|
19858
|
-
* @param {boolean} [touch] `truthy` if this is a touch event.
|
|
19859
|
-
* @param {number} [rotation] Touch event rotation in degrees.
|
|
19860
|
-
* @param {number} [scale] Touch event scale. Initial events should
|
|
19861
|
-
* scale of 1; subsequent events should increase or decrease this
|
|
19862
|
-
* simulate spread and pinch actions.
|
|
19863
|
-
* @param {number[]} [pointers] A list of pointer numbers involved in
|
|
19864
|
-
* touch event. Pointers are number from one up, so `[1]` is the first
|
|
20088
|
+
* @param {boolean} [options.touch] `truthy` if this is a touch event.
|
|
20089
|
+
* @param {number} [options.rotation] Touch event rotation in degrees.
|
|
20090
|
+
* @param {number} [options.scale] Touch event scale. Initial events should
|
|
20091
|
+
* have a scale of 1; subsequent events should increase or decrease this
|
|
20092
|
+
* to simulate spread and pinch actions.
|
|
20093
|
+
* @param {number[]} [options.pointers] A list of pointer numbers involved in
|
|
20094
|
+
* a touch event. Pointers are number from one up, so `[1]` is the first
|
|
19865
20095
|
* touch point, `[1, 2]` are two touch points, and `[2]` is when the first
|
|
19866
20096
|
* point was released but the second is still touching.
|
|
19867
|
-
* @param {string} [pointerType] `mouse` if this is a mouse action
|
|
19868
|
-
* than a touch action.
|
|
20097
|
+
* @param {string} [options.pointerType] `mouse` if this is a mouse action
|
|
20098
|
+
* rather than a touch action.
|
|
19869
20099
|
* @returns {mapInteractor}
|
|
19870
20100
|
*/
|
|
19871
20101
|
|
|
@@ -20500,7 +20730,7 @@ markerFeature.capabilities = {
|
|
|
20500
20730
|
markerFeature.primitiveShapes = pointFeature.primitiveShapes;
|
|
20501
20731
|
/**
|
|
20502
20732
|
* Marker symbols
|
|
20503
|
-
* @enum
|
|
20733
|
+
* @enum {number}
|
|
20504
20734
|
*/
|
|
20505
20735
|
|
|
20506
20736
|
markerFeature.symbols = {
|
|
@@ -20557,7 +20787,7 @@ markerFeature.symbols = {
|
|
|
20557
20787
|
});
|
|
20558
20788
|
/**
|
|
20559
20789
|
* Marker scale modes
|
|
20560
|
-
* @enum
|
|
20790
|
+
* @enum {number}
|
|
20561
20791
|
*/
|
|
20562
20792
|
|
|
20563
20793
|
markerFeature.scaleMode = {
|
|
@@ -20597,7 +20827,7 @@ var feature = __webpack_require__(6837);
|
|
|
20597
20827
|
* of these properties can be functions, which get passed `data`.
|
|
20598
20828
|
*
|
|
20599
20829
|
* @typedef {object} geo.meshFeature.meshSpec
|
|
20600
|
-
* @property {number[]|
|
|
20830
|
+
* @property {number[]|Array.<number[]>} [elements] If specified, a list of
|
|
20601
20831
|
* indices into the data array that form elements. If this is an array of
|
|
20602
20832
|
* arrays, each subarray must have at least either 3 values for triangular
|
|
20603
20833
|
* elements or 4 values for square elements. If this is a single array,
|
|
@@ -21595,6 +21825,8 @@ var quadFeature = __webpack_require__(5017);
|
|
|
21595
21825
|
* specified, use this as the layer opacity.
|
|
21596
21826
|
* @property {string} [source] If specified, use the predefined tile source
|
|
21597
21827
|
* (see {@link geo.osmLayer.tileSources}).
|
|
21828
|
+
* @property {string} [crossDomain='anonymous'] Image CORS attribute. This is
|
|
21829
|
+
* used for the `crossorigin` property when loading images.
|
|
21598
21830
|
*/
|
|
21599
21831
|
|
|
21600
21832
|
/**
|
|
@@ -21968,8 +22200,6 @@ var inherit = __webpack_require__(5699);
|
|
|
21968
22200
|
|
|
21969
22201
|
var feature = __webpack_require__(6837);
|
|
21970
22202
|
|
|
21971
|
-
var geo_event = __webpack_require__(5108);
|
|
21972
|
-
|
|
21973
22203
|
var util = __webpack_require__(4634);
|
|
21974
22204
|
/**
|
|
21975
22205
|
* Pixelmap feature specification.
|
|
@@ -22042,12 +22272,8 @@ var pixelmapFeature = function pixelmapFeature(arg) {
|
|
|
22042
22272
|
*/
|
|
22043
22273
|
|
|
22044
22274
|
var m_this = this,
|
|
22045
|
-
m_quadFeature,
|
|
22046
|
-
m_srcImage,
|
|
22047
|
-
m_info,
|
|
22048
22275
|
s_update = this._update,
|
|
22049
|
-
s_init = this._init
|
|
22050
|
-
s_exit = this._exit;
|
|
22276
|
+
s_init = this._init;
|
|
22051
22277
|
this.featureType = 'pixelmap';
|
|
22052
22278
|
/**
|
|
22053
22279
|
* Get/Set position accessor.
|
|
@@ -22084,7 +22310,7 @@ var pixelmapFeature = function pixelmapFeature(arg) {
|
|
|
22084
22310
|
if (val === undefined) {
|
|
22085
22311
|
return m_this.style('url');
|
|
22086
22312
|
} else if (val !== m_this.style('url')) {
|
|
22087
|
-
m_srcImage = m_info = undefined;
|
|
22313
|
+
m_this.m_srcImage = m_this.m_info = undefined;
|
|
22088
22314
|
m_this.style('url', val);
|
|
22089
22315
|
m_this.dataTime().modified();
|
|
22090
22316
|
m_this.modified();
|
|
@@ -22092,31 +22318,6 @@ var pixelmapFeature = function pixelmapFeature(arg) {
|
|
|
22092
22318
|
|
|
22093
22319
|
return m_this;
|
|
22094
22320
|
};
|
|
22095
|
-
/**
|
|
22096
|
-
* Get the maximum index value from the pixelmap. This is a value present in
|
|
22097
|
-
* the pixelmap.
|
|
22098
|
-
*
|
|
22099
|
-
* @returns {number} The maximum index value.
|
|
22100
|
-
*/
|
|
22101
|
-
|
|
22102
|
-
|
|
22103
|
-
this.maxIndex = function () {
|
|
22104
|
-
if (m_info) {
|
|
22105
|
-
/* This isn't just m_info.mappedColors.length - 1, since there
|
|
22106
|
-
* may be more data than actual indices. */
|
|
22107
|
-
if (m_info.maxIndex === undefined) {
|
|
22108
|
-
m_info.maxIndex = 0;
|
|
22109
|
-
|
|
22110
|
-
for (var idx in m_info.mappedColors) {
|
|
22111
|
-
if (m_info.mappedColors.hasOwnProperty(idx)) {
|
|
22112
|
-
m_info.maxIndex = Math.max(m_info.maxIndex, idx);
|
|
22113
|
-
}
|
|
22114
|
-
}
|
|
22115
|
-
}
|
|
22116
|
-
|
|
22117
|
-
return m_info.maxIndex;
|
|
22118
|
-
}
|
|
22119
|
-
};
|
|
22120
22321
|
/**
|
|
22121
22322
|
* Get/Set color accessor.
|
|
22122
22323
|
*
|
|
@@ -22138,46 +22339,57 @@ var pixelmapFeature = function pixelmapFeature(arg) {
|
|
|
22138
22339
|
return m_this;
|
|
22139
22340
|
};
|
|
22140
22341
|
/**
|
|
22141
|
-
*
|
|
22142
|
-
* information from the quad to determine the pixelmap index value so that it
|
|
22143
|
-
* can be included in the `found` results.
|
|
22342
|
+
* Update.
|
|
22144
22343
|
*
|
|
22145
|
-
* @
|
|
22146
|
-
* @param {string|geo.transform|null} [gcs] Input gcs. `undefined` to use
|
|
22147
|
-
* the interface gcs, `null` to use the map gcs, or any other transform.
|
|
22148
|
-
* @returns {geo.feature.searchResult} An object with a list of features and
|
|
22149
|
-
* feature indices that are located at the specified point.
|
|
22344
|
+
* @returns {this}
|
|
22150
22345
|
*/
|
|
22151
22346
|
|
|
22152
22347
|
|
|
22153
|
-
this.
|
|
22154
|
-
|
|
22155
|
-
var result = m_quadFeature.pointSearch(geo, gcs);
|
|
22348
|
+
this._update = function () {
|
|
22349
|
+
s_update.call(m_this);
|
|
22156
22350
|
|
|
22157
|
-
|
|
22158
|
-
|
|
22159
|
-
|
|
22160
|
-
y,
|
|
22161
|
-
idx;
|
|
22162
|
-
x = Math.floor(basis.x * m_info.width);
|
|
22163
|
-
y = Math.floor(basis.y * m_info.height);
|
|
22351
|
+
if (m_this.buildTime().timestamp() <= m_this.dataTime().timestamp() || m_this.updateTime().timestamp() < m_this.timestamp()) {
|
|
22352
|
+
m_this._build();
|
|
22353
|
+
}
|
|
22164
22354
|
|
|
22165
|
-
|
|
22166
|
-
|
|
22167
|
-
|
|
22168
|
-
|
|
22169
|
-
|
|
22170
|
-
|
|
22171
|
-
|
|
22355
|
+
m_this.updateTime().modified();
|
|
22356
|
+
return m_this;
|
|
22357
|
+
};
|
|
22358
|
+
/**
|
|
22359
|
+
* Get the maximum index value from the pixelmap. This is a value present in
|
|
22360
|
+
* the pixelmap.
|
|
22361
|
+
*
|
|
22362
|
+
* @returns {number} The maximum index value.
|
|
22363
|
+
*/
|
|
22364
|
+
|
|
22365
|
+
|
|
22366
|
+
this.maxIndex = function () {
|
|
22367
|
+
if (m_this.m_info) {
|
|
22368
|
+
/* This isn't just m_info.mappedColors.length - 1, since there
|
|
22369
|
+
* may be more data than actual indices. */
|
|
22370
|
+
if (m_this.m_info.maxIndex === undefined) {
|
|
22371
|
+
m_this.m_info.maxIndex = 0;
|
|
22372
|
+
|
|
22373
|
+
for (var idx in m_this.m_info.mappedColors) {
|
|
22374
|
+
if (m_this.m_info.mappedColors.hasOwnProperty(idx)) {
|
|
22375
|
+
m_this.m_info.maxIndex = Math.max(m_this.m_info.maxIndex, idx);
|
|
22376
|
+
}
|
|
22172
22377
|
}
|
|
22173
22378
|
}
|
|
22174
|
-
}
|
|
22175
22379
|
|
|
22176
|
-
|
|
22177
|
-
|
|
22178
|
-
found: []
|
|
22179
|
-
};
|
|
22380
|
+
return m_this.m_info.maxIndex;
|
|
22381
|
+
}
|
|
22180
22382
|
};
|
|
22383
|
+
/**
|
|
22384
|
+
* Given the loaded pixelmap image, create a canvas the size of the image.
|
|
22385
|
+
* Compute a color for each distinct index and recolor the canvas based on
|
|
22386
|
+
* these colors, then draw the resultant image as a quad.
|
|
22387
|
+
*
|
|
22388
|
+
* @fires geo.event.pixelmap.prepared
|
|
22389
|
+
*/
|
|
22390
|
+
|
|
22391
|
+
|
|
22392
|
+
this._computePixelmap = function () {};
|
|
22181
22393
|
/**
|
|
22182
22394
|
* Build. Fetches the image if necessary.
|
|
22183
22395
|
*
|
|
@@ -22192,12 +22404,12 @@ var pixelmapFeature = function pixelmapFeature(arg) {
|
|
|
22192
22404
|
* this a second time. */
|
|
22193
22405
|
m_this.buildTime().modified();
|
|
22194
22406
|
|
|
22195
|
-
if (!m_srcImage) {
|
|
22407
|
+
if (!m_this.m_srcImage) {
|
|
22196
22408
|
var src = m_this.style.get('url')();
|
|
22197
22409
|
|
|
22198
22410
|
if (util.isReadyImage(src)) {
|
|
22199
22411
|
/* we have an already loaded image, so we can just use it. */
|
|
22200
|
-
m_srcImage = src;
|
|
22412
|
+
m_this.m_srcImage = src;
|
|
22201
22413
|
|
|
22202
22414
|
m_this._computePixelmap();
|
|
22203
22415
|
} else if (src) {
|
|
@@ -22208,19 +22420,19 @@ var pixelmapFeature = function pixelmapFeature(arg) {
|
|
|
22208
22420
|
if (src instanceof Image) {
|
|
22209
22421
|
/* we have an unloaded image. Hook to the load and error callbacks
|
|
22210
22422
|
* so that when it is loaded we can use it. */
|
|
22211
|
-
m_srcImage = src;
|
|
22423
|
+
m_this.m_srcImage = src;
|
|
22212
22424
|
prev_onload = src.onload;
|
|
22213
22425
|
prev_onerror = src.onerror;
|
|
22214
22426
|
} else {
|
|
22215
22427
|
/* we were given a url, so construct a new image */
|
|
22216
|
-
m_srcImage = new Image(); // Only set the crossOrigin parameter if this is going across origins.
|
|
22428
|
+
m_this.m_srcImage = new Image(); // Only set the crossOrigin parameter if this is going across origins.
|
|
22217
22429
|
|
|
22218
22430
|
if (src.indexOf(':') >= 0 && src.indexOf('/') === src.indexOf(':') + 1) {
|
|
22219
|
-
m_srcImage.crossOrigin = m_this.style.get('crossDomain')() || 'anonymous';
|
|
22431
|
+
m_this.m_srcImage.crossOrigin = m_this.style.get('crossDomain')() || 'anonymous';
|
|
22220
22432
|
}
|
|
22221
22433
|
}
|
|
22222
22434
|
|
|
22223
|
-
m_srcImage.onload = function () {
|
|
22435
|
+
m_this.m_srcImage.onload = function () {
|
|
22224
22436
|
if (prev_onload) {
|
|
22225
22437
|
prev_onload.apply(m_this, arguments);
|
|
22226
22438
|
}
|
|
@@ -22229,7 +22441,7 @@ var pixelmapFeature = function pixelmapFeature(arg) {
|
|
|
22229
22441
|
|
|
22230
22442
|
|
|
22231
22443
|
if (m_this.style.get('url')() === src) {
|
|
22232
|
-
m_info = undefined;
|
|
22444
|
+
m_this.m_info = undefined;
|
|
22233
22445
|
|
|
22234
22446
|
m_this._computePixelmap();
|
|
22235
22447
|
}
|
|
@@ -22237,7 +22449,7 @@ var pixelmapFeature = function pixelmapFeature(arg) {
|
|
|
22237
22449
|
defer.resolve();
|
|
22238
22450
|
};
|
|
22239
22451
|
|
|
22240
|
-
m_srcImage.onerror = function () {
|
|
22452
|
+
m_this.m_srcImage.onerror = function () {
|
|
22241
22453
|
if (prev_onerror) {
|
|
22242
22454
|
prev_onerror.apply(m_this, arguments);
|
|
22243
22455
|
}
|
|
@@ -22249,199 +22461,15 @@ var pixelmapFeature = function pixelmapFeature(arg) {
|
|
|
22249
22461
|
m_this.layer().addPromise(m_this);
|
|
22250
22462
|
|
|
22251
22463
|
if (!(src instanceof Image)) {
|
|
22252
|
-
m_srcImage.src = src;
|
|
22464
|
+
m_this.m_srcImage.src = src;
|
|
22253
22465
|
}
|
|
22254
22466
|
}
|
|
22255
|
-
} else if (m_info) {
|
|
22467
|
+
} else if (m_this.m_info) {
|
|
22256
22468
|
m_this._computePixelmap();
|
|
22257
22469
|
}
|
|
22258
22470
|
|
|
22259
22471
|
return m_this;
|
|
22260
22472
|
};
|
|
22261
|
-
/**
|
|
22262
|
-
* Compute information for this pixelmap image. It is wasteful to call this
|
|
22263
|
-
* if the pixelmap has already been prepared (it is invalidated by a change
|
|
22264
|
-
* in the image).
|
|
22265
|
-
*
|
|
22266
|
-
* @returns {geo.pixelmapFeature.info}
|
|
22267
|
-
*/
|
|
22268
|
-
|
|
22269
|
-
|
|
22270
|
-
this._preparePixelmap = function () {
|
|
22271
|
-
var i, idx, pixelData;
|
|
22272
|
-
|
|
22273
|
-
if (!util.isReadyImage(m_srcImage)) {
|
|
22274
|
-
return;
|
|
22275
|
-
}
|
|
22276
|
-
|
|
22277
|
-
m_info = {
|
|
22278
|
-
width: m_srcImage.naturalWidth,
|
|
22279
|
-
height: m_srcImage.naturalHeight,
|
|
22280
|
-
canvas: document.createElement('canvas')
|
|
22281
|
-
};
|
|
22282
|
-
m_info.canvas.width = m_info.width;
|
|
22283
|
-
m_info.canvas.height = m_info.height;
|
|
22284
|
-
m_info.context = m_info.canvas.getContext('2d');
|
|
22285
|
-
m_info.context.drawImage(m_srcImage, 0, 0);
|
|
22286
|
-
m_info.imageData = m_info.context.getImageData(0, 0, m_info.canvas.width, m_info.canvas.height);
|
|
22287
|
-
pixelData = m_info.imageData.data;
|
|
22288
|
-
m_info.indices = new Array(pixelData.length / 4);
|
|
22289
|
-
m_info.area = pixelData.length / 4;
|
|
22290
|
-
m_info.mappedColors = {};
|
|
22291
|
-
|
|
22292
|
-
for (i = 0; i < pixelData.length; i += 4) {
|
|
22293
|
-
idx = pixelData[i] + (pixelData[i + 1] << 8) + (pixelData[i + 2] << 16);
|
|
22294
|
-
m_info.indices[i / 4] = idx;
|
|
22295
|
-
|
|
22296
|
-
if (!m_info.mappedColors[idx]) {
|
|
22297
|
-
m_info.mappedColors[idx] = {
|
|
22298
|
-
first: i / 4
|
|
22299
|
-
};
|
|
22300
|
-
}
|
|
22301
|
-
|
|
22302
|
-
m_info.mappedColors[idx].last = i / 4;
|
|
22303
|
-
}
|
|
22304
|
-
|
|
22305
|
-
return m_info;
|
|
22306
|
-
};
|
|
22307
|
-
/**
|
|
22308
|
-
* Given the loaded pixelmap image, create a canvas the size of the image.
|
|
22309
|
-
* Compute a color for each distinct index and recolor the canvas based on
|
|
22310
|
-
* these colors, then draw the resultant image as a quad.
|
|
22311
|
-
*
|
|
22312
|
-
* @fires geo.event.pixelmap.prepared
|
|
22313
|
-
*/
|
|
22314
|
-
|
|
22315
|
-
|
|
22316
|
-
this._computePixelmap = function () {
|
|
22317
|
-
var data = m_this.data() || [],
|
|
22318
|
-
colorFunc = m_this.style.get('color'),
|
|
22319
|
-
i,
|
|
22320
|
-
idx,
|
|
22321
|
-
lastidx,
|
|
22322
|
-
color,
|
|
22323
|
-
pixelData,
|
|
22324
|
-
indices,
|
|
22325
|
-
mappedColors,
|
|
22326
|
-
updateFirst,
|
|
22327
|
-
updateLast = -1,
|
|
22328
|
-
update,
|
|
22329
|
-
prepared;
|
|
22330
|
-
|
|
22331
|
-
if (!m_info) {
|
|
22332
|
-
if (!m_this._preparePixelmap()) {
|
|
22333
|
-
return;
|
|
22334
|
-
}
|
|
22335
|
-
|
|
22336
|
-
prepared = true;
|
|
22337
|
-
}
|
|
22338
|
-
|
|
22339
|
-
mappedColors = m_info.mappedColors;
|
|
22340
|
-
updateFirst = m_info.area;
|
|
22341
|
-
|
|
22342
|
-
for (idx in mappedColors) {
|
|
22343
|
-
if (mappedColors.hasOwnProperty(idx)) {
|
|
22344
|
-
color = colorFunc(data[idx], +idx) || {};
|
|
22345
|
-
color = [(color.r || 0) * 255, (color.g || 0) * 255, (color.b || 0) * 255, color.a === undefined ? 255 : color.a * 255];
|
|
22346
|
-
mappedColors[idx].update = !mappedColors[idx].color || mappedColors[idx].color[0] !== color[0] || mappedColors[idx].color[1] !== color[1] || mappedColors[idx].color[2] !== color[2] || mappedColors[idx].color[3] !== color[3];
|
|
22347
|
-
|
|
22348
|
-
if (mappedColors[idx].update) {
|
|
22349
|
-
mappedColors[idx].color = color;
|
|
22350
|
-
updateFirst = Math.min(mappedColors[idx].first, updateFirst);
|
|
22351
|
-
updateLast = Math.max(mappedColors[idx].last, updateLast);
|
|
22352
|
-
}
|
|
22353
|
-
}
|
|
22354
|
-
}
|
|
22355
|
-
/* If nothing was updated, we are done */
|
|
22356
|
-
|
|
22357
|
-
|
|
22358
|
-
if (updateFirst >= updateLast) {
|
|
22359
|
-
return;
|
|
22360
|
-
}
|
|
22361
|
-
/* Update only the extent that has changed */
|
|
22362
|
-
|
|
22363
|
-
|
|
22364
|
-
pixelData = m_info.imageData.data;
|
|
22365
|
-
indices = m_info.indices;
|
|
22366
|
-
|
|
22367
|
-
for (i = updateFirst; i <= updateLast; i += 1) {
|
|
22368
|
-
idx = indices[i];
|
|
22369
|
-
|
|
22370
|
-
if (idx !== lastidx) {
|
|
22371
|
-
lastidx = idx;
|
|
22372
|
-
color = mappedColors[idx].color;
|
|
22373
|
-
update = mappedColors[idx].update;
|
|
22374
|
-
}
|
|
22375
|
-
|
|
22376
|
-
if (update) {
|
|
22377
|
-
pixelData[i * 4] = color[0];
|
|
22378
|
-
pixelData[i * 4 + 1] = color[1];
|
|
22379
|
-
pixelData[i * 4 + 2] = color[2];
|
|
22380
|
-
pixelData[i * 4 + 3] = color[3];
|
|
22381
|
-
}
|
|
22382
|
-
}
|
|
22383
|
-
/* Place the updated area into the canvas */
|
|
22384
|
-
|
|
22385
|
-
|
|
22386
|
-
m_info.context.putImageData(m_info.imageData, 0, 0, 0, Math.floor(updateFirst / m_info.width), m_info.width, Math.ceil((updateLast + 1) / m_info.width));
|
|
22387
|
-
/* If we haven't made a quad feature, make one now. The quad feature needs
|
|
22388
|
-
* to have the canvas capability. */
|
|
22389
|
-
|
|
22390
|
-
if (!m_quadFeature) {
|
|
22391
|
-
m_quadFeature = m_this.layer().createFeature('quad', {
|
|
22392
|
-
selectionAPI: false,
|
|
22393
|
-
gcs: m_this.gcs(),
|
|
22394
|
-
visible: m_this.visible(undefined, true)
|
|
22395
|
-
});
|
|
22396
|
-
m_this.dependentFeatures([m_quadFeature]);
|
|
22397
|
-
m_quadFeature.style({
|
|
22398
|
-
image: m_info.canvas,
|
|
22399
|
-
position: m_this.style.get('position')
|
|
22400
|
-
}).data([{}]).draw();
|
|
22401
|
-
}
|
|
22402
|
-
/* If we prepared the pixelmap and rendered it, send a prepared event */
|
|
22403
|
-
|
|
22404
|
-
|
|
22405
|
-
if (prepared) {
|
|
22406
|
-
m_this.geoTrigger(geo_event.pixelmap.prepared, {
|
|
22407
|
-
pixelmap: m_this
|
|
22408
|
-
});
|
|
22409
|
-
}
|
|
22410
|
-
};
|
|
22411
|
-
/**
|
|
22412
|
-
* Update.
|
|
22413
|
-
*
|
|
22414
|
-
* @returns {this}
|
|
22415
|
-
*/
|
|
22416
|
-
|
|
22417
|
-
|
|
22418
|
-
this._update = function () {
|
|
22419
|
-
s_update.call(m_this);
|
|
22420
|
-
|
|
22421
|
-
if (m_this.buildTime().timestamp() <= m_this.dataTime().timestamp() || m_this.updateTime().timestamp() < m_this.timestamp()) {
|
|
22422
|
-
m_this._build();
|
|
22423
|
-
}
|
|
22424
|
-
|
|
22425
|
-
m_this.updateTime().modified();
|
|
22426
|
-
return m_this;
|
|
22427
|
-
};
|
|
22428
|
-
/**
|
|
22429
|
-
* Destroy. Deletes the associated quadFeature.
|
|
22430
|
-
*
|
|
22431
|
-
* @returns {this}
|
|
22432
|
-
*/
|
|
22433
|
-
|
|
22434
|
-
|
|
22435
|
-
this._exit = function () {
|
|
22436
|
-
if (m_quadFeature && m_this.layer()) {
|
|
22437
|
-
m_this.layer().deleteFeature(m_quadFeature);
|
|
22438
|
-
m_quadFeature = null;
|
|
22439
|
-
m_this.dependentFeatures([]);
|
|
22440
|
-
}
|
|
22441
|
-
|
|
22442
|
-
s_exit();
|
|
22443
|
-
return m_this;
|
|
22444
|
-
};
|
|
22445
22473
|
/**
|
|
22446
22474
|
* Initialize.
|
|
22447
22475
|
*
|
|
@@ -23172,7 +23200,7 @@ pointFeature.capabilities = {
|
|
|
23172
23200
|
};
|
|
23173
23201
|
/**
|
|
23174
23202
|
* Support primitive shapes
|
|
23175
|
-
* @enum
|
|
23203
|
+
* @enum {string}
|
|
23176
23204
|
*/
|
|
23177
23205
|
|
|
23178
23206
|
pointFeature.primitiveShapes = {
|
|
@@ -23898,9 +23926,9 @@ var polygonFeature = function polygonFeature(arg) {
|
|
|
23898
23926
|
*
|
|
23899
23927
|
* @param {array} data A new data array.
|
|
23900
23928
|
* @param {number} [tolerance] The maximum variation allowed in map.gcs
|
|
23901
|
-
* units. A value of zero will only remove perfectly
|
|
23902
|
-
* not specified, this is set to a half display pixel at the map's
|
|
23903
|
-
* zoom level.
|
|
23929
|
+
* units. A value of zero will only remove perfectly collinear points.
|
|
23930
|
+
* If not specified, this is set to a half display pixel at the map's
|
|
23931
|
+
* current zoom level.
|
|
23904
23932
|
* @param {function} [posFunc=this.style.get('position')] The function to
|
|
23905
23933
|
* get the position of each vertex.
|
|
23906
23934
|
* @param {function} [polyFunc=this.style.get('polygon')] The function to
|
|
@@ -24401,7 +24429,8 @@ var quadFeature = function quadFeature(arg) {
|
|
|
24401
24429
|
|
|
24402
24430
|
if (coordbasis) {
|
|
24403
24431
|
extra[quad.idx] = {
|
|
24404
|
-
basis: coordbasis
|
|
24432
|
+
basis: coordbasis,
|
|
24433
|
+
_quad: quad
|
|
24405
24434
|
};
|
|
24406
24435
|
}
|
|
24407
24436
|
}
|
|
@@ -25094,7 +25123,7 @@ util.registerRenderer = function (name, func) {
|
|
|
25094
25123
|
* @param {geo.layer} layer The layer associated with the renderer.
|
|
25095
25124
|
* @param {HTMLCanvasElement} [canvas] A canvas object to share between
|
|
25096
25125
|
* renderers.
|
|
25097
|
-
* @param {object} options Options for the new renderer.
|
|
25126
|
+
* @param {object} [options] Options for the new renderer.
|
|
25098
25127
|
* @returns {geo.renderer|null} The new renderer or null if no such name is
|
|
25099
25128
|
* registered.
|
|
25100
25129
|
*/
|
|
@@ -25123,7 +25152,7 @@ util.createRenderer = function (name, layer, canvas, options) {
|
|
|
25123
25152
|
*
|
|
25124
25153
|
* @alias geo.checkRenderer
|
|
25125
25154
|
* @param {string|null} name Name of the desired renderer.
|
|
25126
|
-
* @param {boolean} noFallback If truthy, don't recommend a fallback.
|
|
25155
|
+
* @param {boolean} [noFallback] If truthy, don't recommend a fallback.
|
|
25127
25156
|
* @returns {string|null|false} The name of the renderer that should be used
|
|
25128
25157
|
* or false if no valid renderer can be determined.
|
|
25129
25158
|
*/
|
|
@@ -25999,7 +26028,7 @@ module.exports = sceneObject;
|
|
|
25999
26028
|
* @constant
|
|
26000
26029
|
* @type {string}
|
|
26001
26030
|
*/
|
|
26002
|
-
module.exports = "
|
|
26031
|
+
module.exports = "c554b05bdeb079f7ebd7d317e44a885f9a93710f";
|
|
26003
26032
|
|
|
26004
26033
|
/***/ }),
|
|
26005
26034
|
|
|
@@ -27380,10 +27409,10 @@ var svgRenderer = function svgRenderer(arg) {
|
|
|
27380
27409
|
* Create a new feature element from an object that describes the feature
|
|
27381
27410
|
* attributes. To be called from feature classes only.
|
|
27382
27411
|
*
|
|
27383
|
-
* @param {object} arg
|
|
27412
|
+
* @param {object} arg
|
|
27384
27413
|
* @param {string} arg.id A unique string identifying the feature.
|
|
27385
27414
|
* @param {array} arg.data Array of data objects used in a d3 data method.
|
|
27386
|
-
* @param {function} [
|
|
27415
|
+
* @param {function} [arg.dataIndex] A function that returns a unique id for
|
|
27387
27416
|
* each data element. This is passed to the data access function.
|
|
27388
27417
|
* @param {object} arg.style An object with style values or functions.
|
|
27389
27418
|
* @param {object} arg.attributes An object containing element attributes.
|
|
@@ -27396,7 +27425,7 @@ var svgRenderer = function svgRenderer(arg) {
|
|
|
27396
27425
|
* attributes and styles set when new. If falsy, features always have
|
|
27397
27426
|
* attributes and styles updated.
|
|
27398
27427
|
* @param {boolean} [arg.sortByZ] If truthy, sort features by the `d.zIndex`.
|
|
27399
|
-
* @param {string} [parentId] If set, the group ID of the parent element.
|
|
27428
|
+
* @param {string} [arg.parentId] If set, the group ID of the parent element.
|
|
27400
27429
|
* @returns {this}
|
|
27401
27430
|
*/
|
|
27402
27431
|
|
|
@@ -28709,7 +28738,7 @@ var tileCache = function tileCache(options) {
|
|
|
28709
28738
|
* Remove a tile from the cache.
|
|
28710
28739
|
*
|
|
28711
28740
|
* @param {string|geo.tile} tile The tile or its hash.
|
|
28712
|
-
* @returns {
|
|
28741
|
+
* @returns {boolean} `true` if a tile was removed.
|
|
28713
28742
|
*/
|
|
28714
28743
|
|
|
28715
28744
|
|
|
@@ -29404,7 +29433,7 @@ var tileLayer = function tileLayer(arg) {
|
|
|
29404
29433
|
/**
|
|
29405
29434
|
* Returns a tile's bounds in a gcs.
|
|
29406
29435
|
*
|
|
29407
|
-
* @param {object|tile} indexOrTile Either a tile or an object with
|
|
29436
|
+
* @param {object|geo.tile} indexOrTile Either a tile or an object with
|
|
29408
29437
|
* {x, y, level}` specifying a tile.
|
|
29409
29438
|
* @param {string|geo.transform|null} [gcs] `undefined` to use the
|
|
29410
29439
|
* interface gcs, `null` to use the map gcs, or any other transform.
|
|
@@ -29573,7 +29602,7 @@ var tileLayer = function tileLayer(arg) {
|
|
|
29573
29602
|
* @param {number} maxLevel The zoom level
|
|
29574
29603
|
* @param {geo.geoBounds} bounds The map bounds
|
|
29575
29604
|
* @param {boolean} sorted Return a sorted list
|
|
29576
|
-
* @param {boolean} onlyIfChanged If the set of tiles have not changed
|
|
29605
|
+
* @param {boolean} [onlyIfChanged] If the set of tiles have not changed
|
|
29577
29606
|
* (even if their desired order has), return undefined instead of an
|
|
29578
29607
|
* array of tiles.
|
|
29579
29608
|
* @returns {geo.tile[]} An array of tile objects
|
|
@@ -30107,7 +30136,7 @@ var tileLayer = function tileLayer(arg) {
|
|
|
30107
30136
|
* origin.
|
|
30108
30137
|
*
|
|
30109
30138
|
* @param {object} pt A point in world space coordinates with `x` and `y`.
|
|
30110
|
-
* @param {number
|
|
30139
|
+
* @param {number} [zoom] If unspecified, use the map zoom.
|
|
30111
30140
|
* @returns {object} Local coordinates with `x` and `y`.
|
|
30112
30141
|
*/
|
|
30113
30142
|
|
|
@@ -30156,7 +30185,7 @@ var tileLayer = function tileLayer(arg) {
|
|
|
30156
30185
|
* create the element if it doesn't already exist.
|
|
30157
30186
|
*
|
|
30158
30187
|
* @param {number} level The zoom level of the layer to fetch.
|
|
30159
|
-
* @returns {
|
|
30188
|
+
* @returns {HTMLElement} The layer's DOM element.
|
|
30160
30189
|
*/
|
|
30161
30190
|
|
|
30162
30191
|
|
|
@@ -30513,8 +30542,8 @@ var tileLayer = function tileLayer(arg) {
|
|
|
30513
30542
|
* @param {geo.geoBounds} [bounds] The view bounds (if unspecified, assume
|
|
30514
30543
|
* global bounds)
|
|
30515
30544
|
* @param {number} bounds.level The zoom level the bounds are given as.
|
|
30516
|
-
* @param {number} zoom Keep in bound tile at this zoom level.
|
|
30517
|
-
* @param {boolean} doneLoading If true, allow purging additional tiles.
|
|
30545
|
+
* @param {number} [zoom] Keep in bound tile at this zoom level.
|
|
30546
|
+
* @param {boolean} [doneLoading] If true, allow purging additional tiles.
|
|
30518
30547
|
* @returns {boolean}
|
|
30519
30548
|
*/
|
|
30520
30549
|
|
|
@@ -30627,9 +30656,9 @@ var tileLayer = function tileLayer(arg) {
|
|
|
30627
30656
|
/**
|
|
30628
30657
|
* Get or set the subdomains used for templating.
|
|
30629
30658
|
*
|
|
30630
|
-
* @param {string|
|
|
30659
|
+
* @param {string|string[]} [subdomains] A comma-separated list, a string of
|
|
30631
30660
|
* single character subdomains, or a list.
|
|
30632
|
-
* @returns {string|
|
|
30661
|
+
* @returns {string|string[]|this}
|
|
30633
30662
|
*/
|
|
30634
30663
|
|
|
30635
30664
|
|
|
@@ -30673,8 +30702,8 @@ var tileLayer = function tileLayer(arg) {
|
|
|
30673
30702
|
/**
|
|
30674
30703
|
* Get/Set visibility of the layer.
|
|
30675
30704
|
*
|
|
30676
|
-
* @param {boolean
|
|
30677
|
-
*
|
|
30705
|
+
* @param {boolean} [val] If unspecified, return the visibility, otherwise
|
|
30706
|
+
* set it.
|
|
30678
30707
|
* @returns {boolean|this} Either the visibility (if getting) or the layer
|
|
30679
30708
|
* (if setting).
|
|
30680
30709
|
*/
|
|
@@ -30891,24 +30920,24 @@ var util = __webpack_require__(4634);
|
|
|
30891
30920
|
* @extends geo.feature.spec
|
|
30892
30921
|
* @property {geo.geoPosition|function} [position] Position of the data.
|
|
30893
30922
|
* Default is (data).
|
|
30894
|
-
* @property {
|
|
30923
|
+
* @property {number|function} [time] Time of the data. Default is `(data).t`.
|
|
30895
30924
|
* @property {object|function} [track] Tracks from the data. Default is
|
|
30896
30925
|
* (data). Typically, the data is an array of tracks, each of which is an
|
|
30897
30926
|
* array of points, each of which has a position and time. The position and
|
|
30898
30927
|
* time functions are called for each point as `position(trackPoint,
|
|
30899
30928
|
* pointIndex, trackEntry, trackEntryIndex)`.
|
|
30900
|
-
* @property {
|
|
30929
|
+
* @property {number|null} [startTime=null] Start time. Used for styling. If
|
|
30901
30930
|
* `null`, this is the duration before the end time if `duration` is not
|
|
30902
30931
|
* `null` and the minimum time in any track if `duration` is `null`.
|
|
30903
|
-
* @property {
|
|
30904
|
-
* the track head. If `null` and either of `startTime` or `duration` are
|
|
30932
|
+
* @property {number} [endTime=null] End time. Used for styling and position
|
|
30933
|
+
* of the track head. If `null` and either of `startTime` or `duration` are
|
|
30905
30934
|
* `null`, this is the maximum time in any track.
|
|
30906
|
-
* @property {
|
|
30935
|
+
* @property {number} [duration=null] Duration between start and end times.
|
|
30907
30936
|
* Ignored if both start and end times are specified.
|
|
30908
|
-
* @property {
|
|
30909
|
-
* specified, the track head is rendered as text. If `undefined` a marker
|
|
30910
|
-
* used instead. If `null` or an empty string (`''`), neither a marker
|
|
30911
|
-
* text is used.
|
|
30937
|
+
* @property {number|function} [text] Text to use for the head of the track.
|
|
30938
|
+
* If specified, the track head is rendered as text. If `undefined` a marker
|
|
30939
|
+
* is used instead. If `null` or an empty string (`''`), neither a marker
|
|
30940
|
+
* nor text is used.
|
|
30912
30941
|
* @property {geo.trackFeature.styleSpec} [style] Style object with default
|
|
30913
30942
|
* style options.
|
|
30914
30943
|
* @property {geo.lineFeature.styleSpec} [pastStyle] Style object with
|
|
@@ -31056,7 +31085,7 @@ var trackFeature = function trackFeature(arg) {
|
|
|
31056
31085
|
* Calculate an interpolated position given a time. If the time is outside
|
|
31057
31086
|
* the range of a track, the first or last point is returned.
|
|
31058
31087
|
*
|
|
31059
|
-
* @param {
|
|
31088
|
+
* @param {number} time The time to compute a position array for.
|
|
31060
31089
|
* @param {string|geo.transform|null} [gcs] `undefined` to use the feature
|
|
31061
31090
|
* gcs, `null` to use the map gcs, or any other transform. This transform
|
|
31062
31091
|
* is used for the interpolation; the results are still in feature gcs.
|
|
@@ -31221,7 +31250,7 @@ var trackFeature = function trackFeature(arg) {
|
|
|
31221
31250
|
m_tracks.trackFunc = m_this.style.get('track');
|
|
31222
31251
|
m_tracks.textFunc = m_this.style.get('text');
|
|
31223
31252
|
['past', 'current', 'future'].forEach(function (key) {
|
|
31224
|
-
m_lineFeatures[key].style(m_this[key + 'Style']()).
|
|
31253
|
+
m_lineFeatures[key].style(m_this.style()).style(m_this[key + 'Style']()).line(m_this.style('track')).gcs(m_this.gcs()).data(data).position(m_this._linePosition(key));
|
|
31225
31254
|
});
|
|
31226
31255
|
var timeExtents = {};
|
|
31227
31256
|
data.forEach(function (d, i) {
|
|
@@ -31557,11 +31586,11 @@ var trackFeature = function trackFeature(arg) {
|
|
|
31557
31586
|
/**
|
|
31558
31587
|
* Get/Set time accessor.
|
|
31559
31588
|
*
|
|
31560
|
-
* @param {
|
|
31589
|
+
* @param {number} [val] If not specified, return the current time accessor.
|
|
31561
31590
|
* If specified, use this for the time accessor and return `this`. If a
|
|
31562
31591
|
* function is given, this is called with `(vertexElement, vertexIndex,
|
|
31563
31592
|
* dataElement, dataIndex)`.
|
|
31564
|
-
* @returns {
|
|
31593
|
+
* @returns {number|function|this} The current time or this feature.
|
|
31565
31594
|
*/
|
|
31566
31595
|
|
|
31567
31596
|
|
|
@@ -31631,8 +31660,8 @@ var trackFeature = function trackFeature(arg) {
|
|
|
31631
31660
|
/**
|
|
31632
31661
|
* Get or set the start time.
|
|
31633
31662
|
*
|
|
31634
|
-
* @param {
|
|
31635
|
-
* @returns {
|
|
31663
|
+
* @param {number|null} [val] If specified, the new start time.
|
|
31664
|
+
* @returns {number|null|this} If set, the instance. Otherwise, the current
|
|
31636
31665
|
* start time value.
|
|
31637
31666
|
*/
|
|
31638
31667
|
|
|
@@ -31653,8 +31682,8 @@ var trackFeature = function trackFeature(arg) {
|
|
|
31653
31682
|
/**
|
|
31654
31683
|
* Get or set the end time.
|
|
31655
31684
|
*
|
|
31656
|
-
* @param {
|
|
31657
|
-
* @returns {
|
|
31685
|
+
* @param {number|null} [val] If specified, the new end time.
|
|
31686
|
+
* @returns {number|null|this} If set, the instance. Otherwise, the current
|
|
31658
31687
|
* end time value.
|
|
31659
31688
|
*/
|
|
31660
31689
|
|
|
@@ -31675,8 +31704,8 @@ var trackFeature = function trackFeature(arg) {
|
|
|
31675
31704
|
/**
|
|
31676
31705
|
* Get or set the duration.
|
|
31677
31706
|
*
|
|
31678
|
-
* @param {
|
|
31679
|
-
* @returns {
|
|
31707
|
+
* @param {number|null} [val] If specified, the new duration.
|
|
31708
|
+
* @returns {number|null|this} If set, the instance. Otherwise, the current
|
|
31680
31709
|
* duration.
|
|
31681
31710
|
*/
|
|
31682
31711
|
|
|
@@ -32300,11 +32329,12 @@ transform.lookup = function (projection) {
|
|
|
32300
32329
|
*
|
|
32301
32330
|
* @param {string} srcPrj The source projection.
|
|
32302
32331
|
* @param {string} tgtPrj The destination projection.
|
|
32303
|
-
* @param {geoPosition|geoPosition[]|number[]} coordinates An array of
|
|
32304
|
-
*
|
|
32305
|
-
*
|
|
32306
|
-
* @param {number} numberOfComponents For flat arrays, either 2 or 3.
|
|
32307
|
-
* @returns {geoPosition|geoPosition[]|number[]} The transformed
|
|
32332
|
+
* @param {geo.geoPosition|geo.geoPosition[]|number[]} coordinates An array of
|
|
32333
|
+
* coordinate objects. These may be in object or array form, or a flat
|
|
32334
|
+
* array.
|
|
32335
|
+
* @param {number} [numberOfComponents] For flat arrays, either 2 or 3.
|
|
32336
|
+
* @returns {geo.geoPosition|geo.geoPosition[]|number[]} The transformed
|
|
32337
|
+
* coordinates.
|
|
32308
32338
|
*/
|
|
32309
32339
|
|
|
32310
32340
|
|
|
@@ -32393,10 +32423,10 @@ transform.transformCoordinates = function (srcPrj, tgtPrj, coordinates, numberOf
|
|
|
32393
32423
|
* components per coordinate. The array is modified in place.
|
|
32394
32424
|
*
|
|
32395
32425
|
* @param {transform} trans The transformation object.
|
|
32396
|
-
* @param {geoPosition[]|number[]} coordinates An array of coordinate
|
|
32426
|
+
* @param {geo.geoPosition[]|number[]} coordinates An array of coordinate
|
|
32397
32427
|
* objects or a flat array.
|
|
32398
32428
|
* @param {number} numberOfComponents For flat arrays, either 2 or 3.
|
|
32399
|
-
* @returns {geoPosition[]|number[]} The transformed coordinates
|
|
32429
|
+
* @returns {geo.geoPosition[]|number[]} The transformed coordinates
|
|
32400
32430
|
*/
|
|
32401
32431
|
|
|
32402
32432
|
|
|
@@ -32718,8 +32748,6 @@ transform.affineInverse = function (def, coords) {
|
|
|
32718
32748
|
* @param {object} [ellipsoid=proj4.WGS84] An object with at least `a` and one
|
|
32719
32749
|
* of `b`, `f`, or `rf` (1 / `f`) -- this works with proj4 ellipsoid
|
|
32720
32750
|
* definitions.
|
|
32721
|
-
* @param {number} [maxIterations=100] Maximum number of iterations to use
|
|
32722
|
-
* to test convergence.
|
|
32723
32751
|
* @returns {number} The distance in meters (or whatever units the ellipsoid
|
|
32724
32752
|
* was specified in.
|
|
32725
32753
|
*/
|
|
@@ -32857,7 +32885,7 @@ module.exports = transform;
|
|
|
32857
32885
|
/***/ }),
|
|
32858
32886
|
|
|
32859
32887
|
/***/ 3762:
|
|
32860
|
-
/***/ (function() {
|
|
32888
|
+
/***/ (function(module) {
|
|
32861
32889
|
|
|
32862
32890
|
/*
|
|
32863
32891
|
* Type definitions for jsdoc.
|
|
@@ -33095,6 +33123,7 @@ module.exports = transform;
|
|
|
33095
33123
|
*
|
|
33096
33124
|
* @typedef {geo.polygonFlat|geo.polygonObject} geo.polygon
|
|
33097
33125
|
*/
|
|
33126
|
+
module.exports = {};
|
|
33098
33127
|
|
|
33099
33128
|
/***/ }),
|
|
33100
33129
|
|
|
@@ -34650,7 +34679,7 @@ var sliderWidget = function sliderWidget(arg) {
|
|
|
34650
34679
|
* Respond to a mouse event on the widget.
|
|
34651
34680
|
*
|
|
34652
34681
|
* @param {d3Event} evt The event on the widget.
|
|
34653
|
-
* @param {boolean} trans Truthy for an animated transition.
|
|
34682
|
+
* @param {boolean} [trans] Truthy for an animated transition.
|
|
34654
34683
|
*/
|
|
34655
34684
|
|
|
34656
34685
|
function respond(evt, trans) {
|
|
@@ -35271,7 +35300,7 @@ var $ = __webpack_require__(5638);
|
|
|
35271
35300
|
*
|
|
35272
35301
|
* @param {geo.util.ClusterGroup} group The source cluster group
|
|
35273
35302
|
* @param {number} zoom The zoom level of the current node
|
|
35274
|
-
* @param {object[]} children An array of ClusterTrees or point objects
|
|
35303
|
+
* @param {object[]} [children] An array of ClusterTrees or point objects
|
|
35275
35304
|
*/
|
|
35276
35305
|
|
|
35277
35306
|
|
|
@@ -35405,8 +35434,8 @@ ClusterTree.prototype.coords = function () {
|
|
|
35405
35434
|
* @class
|
|
35406
35435
|
* @alias geo.util.ClusterGroup
|
|
35407
35436
|
* @param {object} opts An options object
|
|
35408
|
-
* @param {number} maxZoom The maximum zoom level to calculate.
|
|
35409
|
-
* @param {number} radius Size of clustering at zoom 0 in point gcs.
|
|
35437
|
+
* @param {number} [opts.maxZoom] The maximum zoom level to calculate.
|
|
35438
|
+
* @param {number} [opts.radius] Size of clustering at zoom 0 in point gcs.
|
|
35410
35439
|
*/
|
|
35411
35440
|
|
|
35412
35441
|
|
|
@@ -35608,7 +35637,7 @@ var colorName = __webpack_require__(9552);
|
|
|
35608
35637
|
/**
|
|
35609
35638
|
* @typedef {object} geo.util.cssColorConversionRecord
|
|
35610
35639
|
* @property {string} name The name of the color conversion.
|
|
35611
|
-
* @property {
|
|
35640
|
+
* @property {RegExp} regex A regex that, if it matches the color string, will
|
|
35612
35641
|
* cause the process function to be invoked.
|
|
35613
35642
|
* @property {function} process A function that takes (`color`, `match`) with
|
|
35614
35643
|
* the original color string and the results of matching the regex using
|
|
@@ -36068,7 +36097,7 @@ var util = {
|
|
|
36068
36097
|
* Check if an object an HTMLVideoElement element that is loaded.
|
|
36069
36098
|
*
|
|
36070
36099
|
* @param {object} vid An object that might be an HTMLVideoElement.
|
|
36071
|
-
* @param {boolean} [allowFailedVideo] If `true`, an
|
|
36100
|
+
* @param {boolean} [allowFailedVideo] If `true`, an video element that has
|
|
36072
36101
|
* a source and has failed to load is also considered 'ready' in the
|
|
36073
36102
|
* sense that it isn't expected to change to a better state.
|
|
36074
36103
|
* @returns {boolean} `true` if this is a video that is ready.
|
|
@@ -36458,7 +36487,7 @@ var util = {
|
|
|
36458
36487
|
* var map = geo.map($.extend(results.map, {clampZoom: false}));
|
|
36459
36488
|
* map.createLayer('osm', results.layer);
|
|
36460
36489
|
*
|
|
36461
|
-
* @param {string}
|
|
36490
|
+
* @param {string?} node DOM selector for the map container.
|
|
36462
36491
|
* @param {number} width Width of the whole map contents in pixels.
|
|
36463
36492
|
* @param {number} height Height of the whole map contents in pixels.
|
|
36464
36493
|
* @param {number} [tileWidth] If an osm or tile layer is going to be used,
|
|
@@ -36732,7 +36761,7 @@ var util = {
|
|
|
36732
36761
|
/**
|
|
36733
36762
|
* Determine if two line segments cross. They are not considered crossing if
|
|
36734
36763
|
* they share a vertex. They are crossing if either of one segment's
|
|
36735
|
-
* vertices are
|
|
36764
|
+
* vertices are collinear with the other segment.
|
|
36736
36765
|
*
|
|
36737
36766
|
* @param {geo.geoPosition} seg1pt1 One endpoint of the first segment.
|
|
36738
36767
|
* @param {geo.geoPosition} seg1pt2 The other endpoint of the first segment.
|
|
@@ -36754,7 +36783,7 @@ var util = {
|
|
|
36754
36783
|
}
|
|
36755
36784
|
/* If the lines cross, the signed area of the triangles formed between one
|
|
36756
36785
|
* segment and the other's vertices will have different signs. By using
|
|
36757
|
-
* > 0,
|
|
36786
|
+
* > 0, collinear points are crossing. */
|
|
36758
36787
|
|
|
36759
36788
|
|
|
36760
36789
|
if (util.triangleTwiceSignedArea2d(seg1pt1, seg1pt2, seg2pt1) * util.triangleTwiceSignedArea2d(seg1pt1, seg1pt2, seg2pt2) > 0 || util.triangleTwiceSignedArea2d(seg2pt1, seg2pt2, seg1pt1) * util.triangleTwiceSignedArea2d(seg2pt1, seg2pt2, seg1pt2) > 0) {
|
|
@@ -36801,7 +36830,7 @@ var util = {
|
|
|
36801
36830
|
* @param {geo.geoPosition[]} pts A list of points forming the line or
|
|
36802
36831
|
* polygon.
|
|
36803
36832
|
* @param {number} tolerance The maximum variation allowed. A value of zero
|
|
36804
|
-
* will only remove perfectly
|
|
36833
|
+
* will only remove perfectly collinear points.
|
|
36805
36834
|
* @param {boolean} [closed] If true, this is a polygon rather than an open
|
|
36806
36835
|
* line. In this case, it is possible to get back a single point.
|
|
36807
36836
|
* @param {Array.<geo.geoPosition[]>?} [noCrossLines] A falsy value to allow
|
|
@@ -36961,7 +36990,7 @@ var util = {
|
|
|
36961
36990
|
*/
|
|
36962
36991
|
escapeUnicodeHTML: function escapeUnicodeHTML(text) {
|
|
36963
36992
|
return text.replace(/./g, function (k) {
|
|
36964
|
-
var code = k.charCodeAt();
|
|
36993
|
+
var code = k.charCodeAt(0);
|
|
36965
36994
|
|
|
36966
36995
|
if (code < 127) {
|
|
36967
36996
|
return k;
|
|
@@ -37028,7 +37057,7 @@ var util = {
|
|
|
37028
37057
|
* stored as local base64 urls.
|
|
37029
37058
|
*
|
|
37030
37059
|
* @param {string} css The css to parse for urls.
|
|
37031
|
-
* @param {jQuery.selector|
|
|
37060
|
+
* @param {jQuery.selector|HTMLElement} styleElem The element that receives
|
|
37032
37061
|
* the css text after dereferencing or the DOM element that has style
|
|
37033
37062
|
* that will be updated.
|
|
37034
37063
|
* @param {jQuery.Deferred} styleDefer A Deferred to resolve once
|
|
@@ -38135,7 +38164,7 @@ module.exports.restoreWebglRenderer = function () {
|
|
|
38135
38164
|
* unspecified, callback will be executed one final time after the last
|
|
38136
38165
|
* throttled-function call. (After the throttled-function has not been
|
|
38137
38166
|
* called for `delay` milliseconds, the internal counter is reset)
|
|
38138
|
-
* @param {function} callback A function to be executed after `delay`
|
|
38167
|
+
* @param {function} [callback] A function to be executed after `delay`
|
|
38139
38168
|
* milliseconds. The `this` context and all arguments are passed through,
|
|
38140
38169
|
* as-is, to `callback` when the throttled-function is executed.
|
|
38141
38170
|
* @param {function} [accumulator] A function to be executed (synchronously)
|
|
@@ -38463,7 +38492,7 @@ module.exports = vectorFeature;
|
|
|
38463
38492
|
* @constant
|
|
38464
38493
|
* @type {string}
|
|
38465
38494
|
*/
|
|
38466
|
-
module.exports = "1.6.
|
|
38495
|
+
module.exports = "1.6.6";
|
|
38467
38496
|
|
|
38468
38497
|
/***/ }),
|
|
38469
38498
|
|
|
@@ -38616,7 +38645,7 @@ var vtkjs_pointFeature = function vtkjs_pointFeature(arg) {
|
|
|
38616
38645
|
|
|
38617
38646
|
this._init = function () {
|
|
38618
38647
|
s_init.call(m_this, arg);
|
|
38619
|
-
m_this.renderer().contextRenderer().setLayer(
|
|
38648
|
+
m_this.renderer().contextRenderer().setLayer(0);
|
|
38620
38649
|
|
|
38621
38650
|
m_this._createPipeline();
|
|
38622
38651
|
};
|
|
@@ -39226,8 +39255,10 @@ module.exports = {
|
|
|
39226
39255
|
isolineFeature: __webpack_require__(9752),
|
|
39227
39256
|
layer: __webpack_require__(5389),
|
|
39228
39257
|
lineFeature: __webpack_require__(7390),
|
|
39258
|
+
lookupTable2D: __webpack_require__(8672),
|
|
39229
39259
|
markerFeature: __webpack_require__(1848),
|
|
39230
39260
|
meshColored: __webpack_require__(5651),
|
|
39261
|
+
pixelmapFeature: __webpack_require__(9685),
|
|
39231
39262
|
pointFeature: __webpack_require__(5675),
|
|
39232
39263
|
polygonFeature: __webpack_require__(2890),
|
|
39233
39264
|
quadFeature: __webpack_require__(2182),
|
|
@@ -40177,6 +40208,139 @@ module.exports = webgl_lineFeature;
|
|
|
40177
40208
|
|
|
40178
40209
|
/***/ }),
|
|
40179
40210
|
|
|
40211
|
+
/***/ 8672:
|
|
40212
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
40213
|
+
|
|
40214
|
+
var inherit = __webpack_require__(5699);
|
|
40215
|
+
|
|
40216
|
+
var timestamp = __webpack_require__(6618);
|
|
40217
|
+
|
|
40218
|
+
var vgl = __webpack_require__(320);
|
|
40219
|
+
/**
|
|
40220
|
+
* Switch to a specific texture unit.
|
|
40221
|
+
*
|
|
40222
|
+
* @param {vgl.renderState} renderState An object that contains the context
|
|
40223
|
+
* used for drawing.
|
|
40224
|
+
* @param {number} textureUnit The number of the texture unit [0-15].
|
|
40225
|
+
*/
|
|
40226
|
+
|
|
40227
|
+
|
|
40228
|
+
function activateTextureUnit(renderState, textureUnit) {
|
|
40229
|
+
if (textureUnit >= 0 && textureUnit <= 31) {
|
|
40230
|
+
renderState.m_context.activeTexture(vgl.GL.TEXTURE0 + textureUnit);
|
|
40231
|
+
} else {
|
|
40232
|
+
throw Error('[error] Texture unit ' + textureUnit + ' is not supported');
|
|
40233
|
+
}
|
|
40234
|
+
}
|
|
40235
|
+
/**
|
|
40236
|
+
* Create a new instance of class webgl_lookupTable2D.
|
|
40237
|
+
*
|
|
40238
|
+
* @class
|
|
40239
|
+
* @alias geo.webgl.lookupTable2D
|
|
40240
|
+
* @param {object} arg Options object.
|
|
40241
|
+
* @param {number} [arg.maxWidth] Maximum width to use for the texture. If the
|
|
40242
|
+
* number of colors set is less than this, the texture is 1D. If greater, it
|
|
40243
|
+
* will be a rectangle of maxWidth x whatever height is necessary.
|
|
40244
|
+
* @param {number[]} [arg.colorTable] Initial color table for the texture.
|
|
40245
|
+
* This is of the form RGBARGBA... where each value is an integer on the
|
|
40246
|
+
* scale [0,255].
|
|
40247
|
+
* @extends vgl.texture
|
|
40248
|
+
* @returns {geo.webgl.lookupTable2D}
|
|
40249
|
+
*/
|
|
40250
|
+
|
|
40251
|
+
|
|
40252
|
+
var webgl_lookupTable2D = function webgl_lookupTable2D(arg) {
|
|
40253
|
+
'use strict';
|
|
40254
|
+
|
|
40255
|
+
if (!(this instanceof webgl_lookupTable2D)) {
|
|
40256
|
+
return new webgl_lookupTable2D(arg);
|
|
40257
|
+
}
|
|
40258
|
+
|
|
40259
|
+
arg = arg || {};
|
|
40260
|
+
vgl.texture.call(this);
|
|
40261
|
+
var m_setupTimestamp = timestamp(),
|
|
40262
|
+
m_maxWidth = arg.maxWidth || 4096,
|
|
40263
|
+
m_colorTable = new Uint8Array([0, 0, 0, 0]),
|
|
40264
|
+
m_colorTableOrig,
|
|
40265
|
+
m_this = this;
|
|
40266
|
+
/**
|
|
40267
|
+
* Create lookup table, initialize parameters, and bind data to it.
|
|
40268
|
+
*
|
|
40269
|
+
* @param {vgl.renderState} renderState An object that contains the context
|
|
40270
|
+
* used for drawing.
|
|
40271
|
+
*/
|
|
40272
|
+
|
|
40273
|
+
this.setup = function (renderState) {
|
|
40274
|
+
activateTextureUnit(renderState, m_this.textureUnit());
|
|
40275
|
+
renderState.m_context.deleteTexture(m_this.m_textureHandle);
|
|
40276
|
+
m_this.m_textureHandle = renderState.m_context.createTexture();
|
|
40277
|
+
renderState.m_context.bindTexture(vgl.GL.TEXTURE_2D, m_this.m_textureHandle);
|
|
40278
|
+
renderState.m_context.texParameteri(vgl.GL.TEXTURE_2D, vgl.GL.TEXTURE_MIN_FILTER, vgl.GL.NEAREST);
|
|
40279
|
+
renderState.m_context.texParameteri(vgl.GL.TEXTURE_2D, vgl.GL.TEXTURE_MAG_FILTER, vgl.GL.NEAREST);
|
|
40280
|
+
renderState.m_context.texParameteri(vgl.GL.TEXTURE_2D, vgl.GL.TEXTURE_WRAP_S, vgl.GL.CLAMP_TO_EDGE);
|
|
40281
|
+
renderState.m_context.texParameteri(vgl.GL.TEXTURE_2D, vgl.GL.TEXTURE_WRAP_T, vgl.GL.CLAMP_TO_EDGE);
|
|
40282
|
+
renderState.m_context.pixelStorei(vgl.GL.UNPACK_ALIGNMENT, 1);
|
|
40283
|
+
renderState.m_context.pixelStorei(vgl.GL.UNPACK_FLIP_Y_WEBGL, true);
|
|
40284
|
+
renderState.m_context.texImage2D(vgl.GL.TEXTURE_2D, 0, vgl.GL.RGBA, m_this.width, m_this.height, 0, vgl.GL.RGBA, vgl.GL.UNSIGNED_BYTE, m_colorTable);
|
|
40285
|
+
renderState.m_context.bindTexture(vgl.GL.TEXTURE_2D, null);
|
|
40286
|
+
m_setupTimestamp.modified();
|
|
40287
|
+
};
|
|
40288
|
+
/**
|
|
40289
|
+
* Get/set color table.
|
|
40290
|
+
*
|
|
40291
|
+
* @param {number[]} [val] An array of RGBARGBA... integers on a scale
|
|
40292
|
+
* of [0, 255]. `undefined` to get the current value.
|
|
40293
|
+
* @returns {number[]|this}
|
|
40294
|
+
*/
|
|
40295
|
+
|
|
40296
|
+
|
|
40297
|
+
this.colorTable = function (val) {
|
|
40298
|
+
if (val === undefined) {
|
|
40299
|
+
return m_colorTableOrig;
|
|
40300
|
+
}
|
|
40301
|
+
|
|
40302
|
+
m_colorTableOrig = val;
|
|
40303
|
+
|
|
40304
|
+
if (val.length < 4) {
|
|
40305
|
+
val = [0, 0, 0, 0];
|
|
40306
|
+
}
|
|
40307
|
+
|
|
40308
|
+
m_this.width = Math.min(m_maxWidth, val.length / 4);
|
|
40309
|
+
m_this.height = Math.ceil(val.length / 4 / m_maxWidth);
|
|
40310
|
+
|
|
40311
|
+
if (!(val instanceof Uint8Array) || val.length !== m_this.width * m_this.height * 4) {
|
|
40312
|
+
if (val.length < m_this.width * m_this.height * 4) {
|
|
40313
|
+
val = val.concat(new Array(m_this.width * m_this.height * 4 - val.length).fill(0));
|
|
40314
|
+
}
|
|
40315
|
+
|
|
40316
|
+
m_colorTable = new Uint8Array(val);
|
|
40317
|
+
} else {
|
|
40318
|
+
m_colorTable = val;
|
|
40319
|
+
}
|
|
40320
|
+
|
|
40321
|
+
m_this.modified();
|
|
40322
|
+
return m_this;
|
|
40323
|
+
};
|
|
40324
|
+
/**
|
|
40325
|
+
* Get maxWidth value.
|
|
40326
|
+
*
|
|
40327
|
+
* @returns {number} The maxWidth of the texture used.
|
|
40328
|
+
*/
|
|
40329
|
+
|
|
40330
|
+
|
|
40331
|
+
this.maxWidth = function () {
|
|
40332
|
+
return m_maxWidth;
|
|
40333
|
+
};
|
|
40334
|
+
|
|
40335
|
+
this.colorTable(arg.colorTable || []);
|
|
40336
|
+
return this;
|
|
40337
|
+
};
|
|
40338
|
+
|
|
40339
|
+
inherit(webgl_lookupTable2D, vgl.texture);
|
|
40340
|
+
module.exports = webgl_lookupTable2D;
|
|
40341
|
+
|
|
40342
|
+
/***/ }),
|
|
40343
|
+
|
|
40180
40344
|
/***/ 1848:
|
|
40181
40345
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
40182
40346
|
|
|
@@ -40291,7 +40455,7 @@ var webgl_markerFeature = function webgl_markerFeature(arg) {
|
|
|
40291
40455
|
/**
|
|
40292
40456
|
* Create and style the data needed to render the markers.
|
|
40293
40457
|
*
|
|
40294
|
-
@param {boolean} onlyStyle if true, use the existing geometry and just
|
|
40458
|
+
@param {boolean} [onlyStyle] if true, use the existing geometry and just
|
|
40295
40459
|
* recalculate the style.
|
|
40296
40460
|
*/
|
|
40297
40461
|
|
|
@@ -41116,6 +41280,209 @@ module.exports = webgl_object;
|
|
|
41116
41280
|
|
|
41117
41281
|
/***/ }),
|
|
41118
41282
|
|
|
41283
|
+
/***/ 9685:
|
|
41284
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
41285
|
+
|
|
41286
|
+
var inherit = __webpack_require__(5699);
|
|
41287
|
+
|
|
41288
|
+
var registerFeature = (__webpack_require__(4647).registerFeature);
|
|
41289
|
+
|
|
41290
|
+
var pixelmapFeature = __webpack_require__(6374);
|
|
41291
|
+
|
|
41292
|
+
var lookupTable2D = __webpack_require__(8672);
|
|
41293
|
+
|
|
41294
|
+
var util = __webpack_require__(4634);
|
|
41295
|
+
/**
|
|
41296
|
+
* Create a new instance of class webgl.pixelmapFeature.
|
|
41297
|
+
*
|
|
41298
|
+
* @class
|
|
41299
|
+
* @alias geo.webgl.pixelmapFeature
|
|
41300
|
+
* @extends geo.pixelmapFeature
|
|
41301
|
+
* @param {geo.pixelmapFeature.spec} arg
|
|
41302
|
+
* @returns {geo.webgl.pixelmapFeature}
|
|
41303
|
+
*/
|
|
41304
|
+
|
|
41305
|
+
|
|
41306
|
+
var webgl_pixelmapFeature = function webgl_pixelmapFeature(arg) {
|
|
41307
|
+
'use strict';
|
|
41308
|
+
|
|
41309
|
+
if (!(this instanceof webgl_pixelmapFeature)) {
|
|
41310
|
+
return new webgl_pixelmapFeature(arg);
|
|
41311
|
+
}
|
|
41312
|
+
|
|
41313
|
+
pixelmapFeature.call(this, arg);
|
|
41314
|
+
|
|
41315
|
+
var object = __webpack_require__(7719);
|
|
41316
|
+
|
|
41317
|
+
object.call(this);
|
|
41318
|
+
|
|
41319
|
+
var vgl = __webpack_require__(320);
|
|
41320
|
+
|
|
41321
|
+
var fragmentShader = __webpack_require__(3953);
|
|
41322
|
+
|
|
41323
|
+
var m_quadFeature,
|
|
41324
|
+
s_exit = this._exit,
|
|
41325
|
+
m_lookupTable,
|
|
41326
|
+
m_this = this;
|
|
41327
|
+
/**
|
|
41328
|
+
* If the specified coordinates are in the rendered quad, use the basis
|
|
41329
|
+
* information from the quad to determine the pixelmap index value so that it
|
|
41330
|
+
* can be included in the `found` results.
|
|
41331
|
+
*
|
|
41332
|
+
* @param {geo.geoPosition} geo Coordinate.
|
|
41333
|
+
* @param {string|geo.transform|null} [gcs] Input gcs. `undefined` to use
|
|
41334
|
+
* the interface gcs, `null` to use the map gcs, or any other transform.
|
|
41335
|
+
* @returns {geo.feature.searchResult} An object with a list of features and
|
|
41336
|
+
* feature indices that are located at the specified point.
|
|
41337
|
+
*/
|
|
41338
|
+
|
|
41339
|
+
this.pointSearch = function (geo, gcs) {
|
|
41340
|
+
if (m_quadFeature && m_this.m_info) {
|
|
41341
|
+
var result = m_quadFeature.pointSearch(geo, gcs);
|
|
41342
|
+
|
|
41343
|
+
if (result.index.length === 1 && result.extra && result.extra[result.index[0]].basis && result.extra[result.index[0]]._quad && result.extra[result.index[0]]._quad.image) {
|
|
41344
|
+
var img = result.extra[result.index[0]]._quad.image;
|
|
41345
|
+
var basis = result.extra[result.index[0]].basis;
|
|
41346
|
+
var x = Math.floor(basis.x * img.width);
|
|
41347
|
+
var y = Math.floor(basis.y * img.height);
|
|
41348
|
+
var canvas = document.createElement('canvas');
|
|
41349
|
+
canvas.width = canvas.height = 1;
|
|
41350
|
+
var context = canvas.getContext('2d');
|
|
41351
|
+
context.drawImage(img, x, y, 1, 1, 0, 0, 1, 1);
|
|
41352
|
+
var pixel = context.getImageData(0, 0, 1, 1).data;
|
|
41353
|
+
var idx = pixel[0] + pixel[1] * 256 + pixel[2] * 256 * 256;
|
|
41354
|
+
result = {
|
|
41355
|
+
index: [idx],
|
|
41356
|
+
found: [m_this.data()[idx]]
|
|
41357
|
+
};
|
|
41358
|
+
return result;
|
|
41359
|
+
}
|
|
41360
|
+
}
|
|
41361
|
+
|
|
41362
|
+
return {
|
|
41363
|
+
index: [],
|
|
41364
|
+
found: []
|
|
41365
|
+
};
|
|
41366
|
+
};
|
|
41367
|
+
/**
|
|
41368
|
+
* Given the loaded pixelmap image, create a texture for the colors and a
|
|
41369
|
+
* quad that will use it.
|
|
41370
|
+
*/
|
|
41371
|
+
|
|
41372
|
+
|
|
41373
|
+
this._computePixelmap = function () {
|
|
41374
|
+
var data = m_this.data() || [],
|
|
41375
|
+
colorFunc = m_this.style.get('color');
|
|
41376
|
+
|
|
41377
|
+
if (!m_lookupTable) {
|
|
41378
|
+
m_lookupTable = lookupTable2D();
|
|
41379
|
+
m_lookupTable.setTextureUnit(1);
|
|
41380
|
+
}
|
|
41381
|
+
|
|
41382
|
+
var clrLen = Math.max(1, data.length);
|
|
41383
|
+
var maxWidth = m_lookupTable.maxWidth();
|
|
41384
|
+
|
|
41385
|
+
if (clrLen > maxWidth && clrLen % maxWidth) {
|
|
41386
|
+
clrLen += maxWidth - clrLen % maxWidth;
|
|
41387
|
+
}
|
|
41388
|
+
|
|
41389
|
+
var colors = new Uint8Array(clrLen * 4);
|
|
41390
|
+
data.forEach(function (d, i) {
|
|
41391
|
+
var color = util.convertColor(colorFunc.call(m_this, d, i));
|
|
41392
|
+
colors[i * 4] = color.r * 255;
|
|
41393
|
+
colors[i * 4 + 1] = color.g * 255;
|
|
41394
|
+
colors[i * 4 + 2] = color.b * 255;
|
|
41395
|
+
colors[i * 4 + 3] = color.a === undefined ? 255 : color.a * 255;
|
|
41396
|
+
});
|
|
41397
|
+
m_this.m_info = {
|
|
41398
|
+
colors: colors
|
|
41399
|
+
}; // check if colors haven't changed
|
|
41400
|
+
|
|
41401
|
+
var oldcolors = m_lookupTable.colorTable();
|
|
41402
|
+
|
|
41403
|
+
if (oldcolors && oldcolors.length === colors.length) {
|
|
41404
|
+
var idx = 0;
|
|
41405
|
+
|
|
41406
|
+
for (; idx < colors.length; idx += 1) {
|
|
41407
|
+
if (colors[idx] !== oldcolors[idx]) {
|
|
41408
|
+
break;
|
|
41409
|
+
}
|
|
41410
|
+
}
|
|
41411
|
+
|
|
41412
|
+
if (idx === colors.length) {
|
|
41413
|
+
return;
|
|
41414
|
+
}
|
|
41415
|
+
}
|
|
41416
|
+
|
|
41417
|
+
m_lookupTable.colorTable(colors);
|
|
41418
|
+
/* If we haven't made a quad feature, make one now */
|
|
41419
|
+
|
|
41420
|
+
if (!m_quadFeature) {
|
|
41421
|
+
m_quadFeature = m_this.layer().createFeature('quad', {
|
|
41422
|
+
selectionAPI: false,
|
|
41423
|
+
gcs: m_this.gcs(),
|
|
41424
|
+
visible: m_this.visible(undefined, true)
|
|
41425
|
+
});
|
|
41426
|
+
m_this.dependentFeatures([m_quadFeature]);
|
|
41427
|
+
m_quadFeature.setShader('image_fragment', fragmentShader);
|
|
41428
|
+
|
|
41429
|
+
m_quadFeature._hookBuild = function (prog) {
|
|
41430
|
+
var lutSampler = new vgl.uniform(vgl.GL.INT, 'lutSampler');
|
|
41431
|
+
lutSampler.set(m_lookupTable.textureUnit());
|
|
41432
|
+
prog.addUniform(lutSampler);
|
|
41433
|
+
var lutWidth = new vgl.uniform(vgl.GL.INT, 'lutWidth');
|
|
41434
|
+
lutWidth.set(m_lookupTable.width);
|
|
41435
|
+
prog.addUniform(lutWidth);
|
|
41436
|
+
var lutHeight = new vgl.uniform(vgl.GL.INT, 'lutHeight');
|
|
41437
|
+
lutHeight.set(m_lookupTable.height);
|
|
41438
|
+
prog.addUniform(lutHeight);
|
|
41439
|
+
};
|
|
41440
|
+
|
|
41441
|
+
m_quadFeature._hookRenderImageQuads = function (renderState, quads) {
|
|
41442
|
+
quads.forEach(function (quad) {
|
|
41443
|
+
if (quad.image && quad.texture && !quad.texture.nearestPixel()) {
|
|
41444
|
+
quad.texture.setNearestPixel(true);
|
|
41445
|
+
}
|
|
41446
|
+
});
|
|
41447
|
+
m_lookupTable.bind(renderState, quads);
|
|
41448
|
+
};
|
|
41449
|
+
|
|
41450
|
+
m_quadFeature.style({
|
|
41451
|
+
image: m_this.m_srcImage,
|
|
41452
|
+
position: m_this.style.get('position')
|
|
41453
|
+
}).data([{}]).draw();
|
|
41454
|
+
}
|
|
41455
|
+
};
|
|
41456
|
+
/**
|
|
41457
|
+
* Destroy. Deletes the associated quadFeature.
|
|
41458
|
+
*
|
|
41459
|
+
* @returns {this}
|
|
41460
|
+
*/
|
|
41461
|
+
|
|
41462
|
+
|
|
41463
|
+
this._exit = function () {
|
|
41464
|
+
if (m_quadFeature && m_this.layer()) {
|
|
41465
|
+
m_this.layer().deleteFeature(m_quadFeature);
|
|
41466
|
+
m_quadFeature = null;
|
|
41467
|
+
m_this.dependentFeatures([]);
|
|
41468
|
+
}
|
|
41469
|
+
|
|
41470
|
+
s_exit();
|
|
41471
|
+
return m_this;
|
|
41472
|
+
};
|
|
41473
|
+
|
|
41474
|
+
this._init(arg);
|
|
41475
|
+
|
|
41476
|
+
return this;
|
|
41477
|
+
};
|
|
41478
|
+
|
|
41479
|
+
inherit(webgl_pixelmapFeature, pixelmapFeature); // Now register it
|
|
41480
|
+
|
|
41481
|
+
registerFeature('webgl', 'pixelmap', webgl_pixelmapFeature);
|
|
41482
|
+
module.exports = webgl_pixelmapFeature;
|
|
41483
|
+
|
|
41484
|
+
/***/ }),
|
|
41485
|
+
|
|
41119
41486
|
/***/ 5675:
|
|
41120
41487
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
41121
41488
|
|
|
@@ -41211,7 +41578,7 @@ var webgl_pointFeature = function webgl_pointFeature(arg) {
|
|
|
41211
41578
|
/**
|
|
41212
41579
|
* Create and style the data needed to render the points.
|
|
41213
41580
|
*
|
|
41214
|
-
* @param {boolean} onlyStyle if true, use the existing geometry and just
|
|
41581
|
+
* @param {boolean} [onlyStyle] if true, use the existing geometry and just
|
|
41215
41582
|
* recalculate the style.
|
|
41216
41583
|
*/
|
|
41217
41584
|
|
|
@@ -42480,7 +42847,7 @@ var webgl_quadFeature = function webgl_quadFeature(arg) {
|
|
|
42480
42847
|
|
|
42481
42848
|
|
|
42482
42849
|
this._build = function () {
|
|
42483
|
-
var mapper, mat, prog, srctex, unicrop, unicropsource, geom, context;
|
|
42850
|
+
var mapper, mat, prog, srctex, unicrop, unicropsource, geom, context, sampler2d;
|
|
42484
42851
|
|
|
42485
42852
|
if (!m_this.position()) {
|
|
42486
42853
|
return;
|
|
@@ -42505,6 +42872,11 @@ var webgl_quadFeature = function webgl_quadFeature(arg) {
|
|
|
42505
42872
|
prog.addUniform(new vgl.projectionUniform('projectionMatrix'));
|
|
42506
42873
|
prog.addUniform(new vgl.floatUniform('opacity', 1.0));
|
|
42507
42874
|
prog.addUniform(new vgl.floatUniform('zOffset', 0.0));
|
|
42875
|
+
/* Use texture unit 0 */
|
|
42876
|
+
|
|
42877
|
+
sampler2d = new vgl.uniform(vgl.GL.INT, 'sampler2d');
|
|
42878
|
+
sampler2d.set(0);
|
|
42879
|
+
prog.addUniform(sampler2d);
|
|
42508
42880
|
context = m_this.renderer()._glContext();
|
|
42509
42881
|
unicrop = new vgl.uniform(context.FLOAT_VEC2, 'crop');
|
|
42510
42882
|
unicrop.set([1.0, 1.0]);
|
|
@@ -42514,6 +42886,11 @@ var webgl_quadFeature = function webgl_quadFeature(arg) {
|
|
|
42514
42886
|
prog.addUniform(unicropsource);
|
|
42515
42887
|
prog.addShader(vgl.getCachedShader(context.VERTEX_SHADER, context, vertexShaderImage));
|
|
42516
42888
|
prog.addShader(vgl.getCachedShader(context.FRAGMENT_SHADER, context, fragmentShaderImage));
|
|
42889
|
+
|
|
42890
|
+
if (m_this._hookBuild) {
|
|
42891
|
+
m_this._hookBuild(prog);
|
|
42892
|
+
}
|
|
42893
|
+
|
|
42517
42894
|
mat.addAttribute(prog);
|
|
42518
42895
|
mat.addAttribute(new vgl.blend());
|
|
42519
42896
|
/* This is similar to vgl.planeSource */
|
|
@@ -42690,6 +43067,11 @@ var webgl_quadFeature = function webgl_quadFeature(arg) {
|
|
|
42690
43067
|
h,
|
|
42691
43068
|
quadw,
|
|
42692
43069
|
quadh;
|
|
43070
|
+
|
|
43071
|
+
if (m_this._hookRenderImageQuads) {
|
|
43072
|
+
m_this._hookRenderImageQuads(renderState, m_quads.imgQuads);
|
|
43073
|
+
}
|
|
43074
|
+
|
|
42693
43075
|
context.bindBuffer(context.ARRAY_BUFFER, m_glBuffers.imgQuadsPosition);
|
|
42694
43076
|
$.each(m_quads.imgQuads, function (idx, quad) {
|
|
42695
43077
|
if (!quad.image) {
|
|
@@ -42806,6 +43188,41 @@ var webgl_quadFeature = function webgl_quadFeature(arg) {
|
|
|
42806
43188
|
|
|
42807
43189
|
m_this.modified();
|
|
42808
43190
|
};
|
|
43191
|
+
/**
|
|
43192
|
+
* Set the image or color vertex or fragment shader.
|
|
43193
|
+
*
|
|
43194
|
+
* @param {string} shaderType One of `image_vertex`, `image_fragment`,
|
|
43195
|
+
* `color_vertex`, or `color_fragment`.
|
|
43196
|
+
* @param {string} shaderCode The shader program.
|
|
43197
|
+
* @returns {this} The class instance on success, undefined in an unknown
|
|
43198
|
+
* shaderType was specified.
|
|
43199
|
+
*/
|
|
43200
|
+
|
|
43201
|
+
|
|
43202
|
+
this.setShader = function (shaderType, shaderCode) {
|
|
43203
|
+
switch (shaderType) {
|
|
43204
|
+
case 'image_vertex':
|
|
43205
|
+
vertexShaderImage = shaderCode;
|
|
43206
|
+
break;
|
|
43207
|
+
|
|
43208
|
+
case 'image_fragment':
|
|
43209
|
+
fragmentShaderImage = shaderCode;
|
|
43210
|
+
break;
|
|
43211
|
+
|
|
43212
|
+
case 'color_vertex':
|
|
43213
|
+
vertexShaderColor = shaderCode;
|
|
43214
|
+
break;
|
|
43215
|
+
|
|
43216
|
+
case 'color_fragment':
|
|
43217
|
+
fragmentShaderColor = shaderCode;
|
|
43218
|
+
break;
|
|
43219
|
+
|
|
43220
|
+
default:
|
|
43221
|
+
return;
|
|
43222
|
+
}
|
|
43223
|
+
|
|
43224
|
+
return m_this;
|
|
43225
|
+
};
|
|
42809
43226
|
/**
|
|
42810
43227
|
* Destroy.
|
|
42811
43228
|
*/
|
|
@@ -43519,6 +43936,8 @@ webglRenderer.supported = function () {
|
|
|
43519
43936
|
|
|
43520
43937
|
try {
|
|
43521
43938
|
canvas = document.createElement('canvas');
|
|
43939
|
+
/** @type {WebGLRenderingContext} */
|
|
43940
|
+
|
|
43522
43941
|
ctx = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
|
|
43523
43942
|
/* getSupportExtensions will throw an exception if the context isn't
|
|
43524
43943
|
* really supported. */
|
|
@@ -81675,6 +82094,13 @@ module.exports = "/* contourFeature vertex shader */\n\n#ifdef GL_ES\n precisio
|
|
|
81675
82094
|
|
|
81676
82095
|
/***/ }),
|
|
81677
82096
|
|
|
82097
|
+
/***/ 3953:
|
|
82098
|
+
/***/ (function(module) {
|
|
82099
|
+
|
|
82100
|
+
module.exports = "/* pixelmapFeature fragment shader */\n\nvarying highp vec2 iTextureCoord;\nuniform sampler2D sampler2d;\nuniform sampler2D lutSampler;\nuniform int lutWidth;\nuniform int lutHeight;\nuniform mediump float opacity;\nuniform highp vec2 crop;\n\nvoid main(void) {\n if ((crop.s < 1.0 && iTextureCoord.s > crop.s) || (crop.t < 1.0 && 1.0 - iTextureCoord.t > crop.t)) {\n discard;\n }\n // to add anti-aliasing, we would need to know the current pixel size\n // (probably computed in the vertex shader) and then sample the base image at\n // multiple points, then average the output color.\n highp vec4 lutValue = texture2D(sampler2d, iTextureCoord);\n highp vec2 lutCoord;\n lutCoord.s = (\n mod(\n // add 0.5 to handle float imprecision\n floor(lutValue.r * 255.0 + 0.5) +\n floor(lutValue.g * 255.0 + 0.5) * 256.0,\n float(lutWidth)\n // center in pixel\n ) + 0.5) / float(lutWidth);\n // Our image is top-down, so invert the coordinate\n lutCoord.t = 1.0 - (\n floor(\n (\n // add 0.5 to handle float imprecision\n floor(lutValue.r * 255.0 + 0.5) +\n floor(lutValue.g * 255.0 + 0.5) * 256.0 +\n floor(lutValue.b * 255.0 + 0.5) * 256.0 * 256.0\n // We may want an option to use the alpha channel to allow more indices\n ) / float(lutWidth)\n // center in pixel\n ) + 0.5) / float(lutHeight);\n if (lutCoord.t < 0.0) {\n discard;\n }\n mediump vec4 color = texture2D(lutSampler, lutCoord);\n\n color.a *= opacity;\n gl_FragColor = color;\n}\n"
|
|
82101
|
+
|
|
82102
|
+
/***/ }),
|
|
82103
|
+
|
|
81678
82104
|
/***/ 1815:
|
|
81679
82105
|
/***/ (function(module) {
|
|
81680
82106
|
|