geojs 1.10.13 → 1.10.15
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 +7 -7
- package/geo.js +148 -65
- package/geo.lean.js +147 -64
- package/geo.lean.min.js +3 -3
- package/geo.min.js +6 -6
- package/package.json +3 -3
- package/src/event.js +57 -0
- package/src/feature.js +49 -3
- package/src/mapInteractor.js +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geojs",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.15",
|
|
4
4
|
"description": "JavaScript Geo Visualization and Analysis Library",
|
|
5
5
|
"homepage": "https://github.com/OpenGeoscience/geojs",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"expose-loader": "^4.0.0",
|
|
55
55
|
"express": "^4.17.2",
|
|
56
56
|
"fs-extra": "^11.0.0",
|
|
57
|
-
"glob": "^
|
|
57
|
+
"glob": "^10.1.0",
|
|
58
58
|
"imports-loader": "^4.0.0",
|
|
59
59
|
"jasmine-core": "^4.0.0",
|
|
60
60
|
"js-yaml": "^4.1.0",
|
|
@@ -80,7 +80,6 @@
|
|
|
80
80
|
"pug-load": "^3.0.0",
|
|
81
81
|
"raw-body": "^2.4.2",
|
|
82
82
|
"resemblejs": "git+https://github.com/dominykas/Resemble.js",
|
|
83
|
-
"semantic-release": "^19.0.5",
|
|
84
83
|
"serve-index": "^1.9.1",
|
|
85
84
|
"shader-loader": "git+https://github.com/Makio64/shader-loader",
|
|
86
85
|
"sinon": "^15.0.0",
|
|
@@ -135,6 +134,7 @@
|
|
|
135
134
|
"build-tutorials": "node tutorials/build.js && webpack --config webpack-tutorials.config.js",
|
|
136
135
|
"build-website-tutorials": "node tutorials/build-website.js && webpack --config webpack-website-tutorials.config.js",
|
|
137
136
|
"lint": "eslint --cache . --max-warnings=0",
|
|
137
|
+
"format": "eslint --cache --fix .",
|
|
138
138
|
"puglint": "pug-lint src examples",
|
|
139
139
|
"glsllint": "chmod +x node_modules/glslang-validator-prebuilt-predownloaded/bin/glslangValidator.linux; find . \\( -name '*.frag' \\) -exec sh -c 'for n; do python scripts/preprocess_glsl.py \"$n\" | node_modules/glslang-validator-prebuilt-predownloaded/bin/glslangValidator.linux --stdin -S frag || exit 1; done' sh {} \\+ && find . \\( -name '*.vert' \\) -exec sh -c 'for n; do python scripts/preprocess_glsl.py \"$n\" | node_modules/glslang-validator-prebuilt-predownloaded/bin/glslangValidator.linux --stdin -S vert || exit 1; done' sh {} \\+",
|
|
140
140
|
"test-headless": "GEOJS_TEST_CASE=tests/test-unit.js karma start karma-cov.conf.js --single-run --browsers ChromeHeadlessTouch,FirefoxHeadlessTouch",
|
package/src/event.js
CHANGED
|
@@ -163,6 +163,28 @@ geo_event.mousemove = 'geo_mousemove';
|
|
|
163
163
|
*/
|
|
164
164
|
geo_event.mouseclick = 'geo_mouseclick';
|
|
165
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Triggered on `mouseup` events. The event object extends
|
|
168
|
+
* {@link geo.mouseState}.
|
|
169
|
+
*
|
|
170
|
+
* @event geo.event.mouseup
|
|
171
|
+
* @type {(geo.event.base|geo.mouseState)}
|
|
172
|
+
* @property {geo.mouseButtons} buttonsDown The buttons that were down at the
|
|
173
|
+
* start of the up action.
|
|
174
|
+
*/
|
|
175
|
+
geo_event.mouseup = 'geo_mouseup';
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Triggered on `mousedown` events. The event object extends
|
|
179
|
+
* {@link geo.mouseState}.
|
|
180
|
+
*
|
|
181
|
+
* @event geo.event.mousedown
|
|
182
|
+
* @type {(geo.event.base|geo.mouseState)}
|
|
183
|
+
* @property {geo.mouseButtons} buttonsDown The buttons that were down at the
|
|
184
|
+
* end of the down action.
|
|
185
|
+
*/
|
|
186
|
+
geo_event.mousedown = 'geo_mousedown';
|
|
187
|
+
|
|
166
188
|
/**
|
|
167
189
|
* Triggered on every `mousemove` during a brushing selection.
|
|
168
190
|
* The event object extends {@link geo.brushSelection}.
|
|
@@ -485,6 +507,41 @@ geo_event.feature = {
|
|
|
485
507
|
* @property {geo.event} sourceEvent The underlying event that trigger this.
|
|
486
508
|
*/
|
|
487
509
|
mouseclick_order: 'geo_feature_mouseclick_order',
|
|
510
|
+
/**
|
|
511
|
+
* The event is the feature version of {@link geo.event.mousedown}.
|
|
512
|
+
*
|
|
513
|
+
* @event geo.event.feature.mousedown
|
|
514
|
+
* @type {geo.event.base}
|
|
515
|
+
* @property {object} data The feature data the mouse is above.
|
|
516
|
+
* @property {number} index The index of the feature data the mouse is above.
|
|
517
|
+
* @property {object} extra Extra information about the feature and mouse
|
|
518
|
+
* location.
|
|
519
|
+
* @property {geo.mouseState} mouse The mouse state.
|
|
520
|
+
* @property {number} eventID a monotonically increasing event number. All
|
|
521
|
+
* features that the mouse goes down on simultaneously will have the same
|
|
522
|
+
* `eventID`.
|
|
523
|
+
* @property {boolean} top True if this is the topmost data element.
|
|
524
|
+
* @property {geo.event} sourceEvent The underlying event that trigger this.
|
|
525
|
+
*/
|
|
526
|
+
mousedown: 'geo_feature_mousedown',
|
|
527
|
+
/**
|
|
528
|
+
* The event is the feature version of {@link geo.event.mouseup}.
|
|
529
|
+
*
|
|
530
|
+
* @event geo.event.feature.mouseup
|
|
531
|
+
* @type {geo.event.base}
|
|
532
|
+
* @property {object} data The feature data the mouse is above.
|
|
533
|
+
* @property {number} index The index of the feature data the mouse is above.
|
|
534
|
+
* @property {object} extra Extra information about the feature and mouse
|
|
535
|
+
* location.
|
|
536
|
+
* @property {geo.mouseState} mouse The mouse state. The buttons are before
|
|
537
|
+
* the up action occurs.
|
|
538
|
+
* @property {number} eventID a monotonically increasing event number. All
|
|
539
|
+
* features that the mouse goes up on simultaneously will have the same
|
|
540
|
+
* `eventID`.
|
|
541
|
+
* @property {boolean} top True if this is the topmost data element.
|
|
542
|
+
* @property {geo.event} sourceEvent The underlying event that trigger this.
|
|
543
|
+
*/
|
|
544
|
+
mouseup: 'geo_feature_mouseup',
|
|
488
545
|
/**
|
|
489
546
|
* This event is fired for each data component of a feature under a brush
|
|
490
547
|
* that has just finished its selection.
|
package/src/feature.js
CHANGED
|
@@ -162,6 +162,8 @@ var feature = function (arg) {
|
|
|
162
162
|
m_this._unbindMouseHandlers();
|
|
163
163
|
|
|
164
164
|
m_this.geoOn(geo_event.mousemove, m_this._handleMousemove);
|
|
165
|
+
m_this.geoOn(geo_event.mousedown, m_this._handleMousedown);
|
|
166
|
+
m_this.geoOn(geo_event.mouseup, m_this._handleMouseup);
|
|
165
167
|
m_this.geoOn(geo_event.mouseclick, m_this._handleMouseclick);
|
|
166
168
|
m_this.geoOn(geo_event.brushend, m_this._handleBrushend);
|
|
167
169
|
m_this.geoOn(geo_event.brush, m_this._handleBrush);
|
|
@@ -172,6 +174,8 @@ var feature = function (arg) {
|
|
|
172
174
|
*/
|
|
173
175
|
this._unbindMouseHandlers = function () {
|
|
174
176
|
m_this.geoOff(geo_event.mousemove, m_this._handleMousemove);
|
|
177
|
+
m_this.geoOff(geo_event.mousedown, m_this._handleMousedown);
|
|
178
|
+
m_this.geoOff(geo_event.mouseup, m_this._handleMouseup);
|
|
175
179
|
m_this.geoOff(geo_event.mouseclick, m_this._handleMouseclick);
|
|
176
180
|
m_this.geoOff(geo_event.brushend, m_this._handleBrushend);
|
|
177
181
|
m_this.geoOff(geo_event.brush, m_this._handleBrush);
|
|
@@ -238,20 +242,46 @@ var feature = function (arg) {
|
|
|
238
242
|
};
|
|
239
243
|
};
|
|
240
244
|
|
|
245
|
+
/**
|
|
246
|
+
* Private mousedown handler. This uses `pointSearch` to determine which
|
|
247
|
+
* features the mouse is over, then fires appropriate events.
|
|
248
|
+
*
|
|
249
|
+
* @param {geo.event} evt The event that triggered this handler.
|
|
250
|
+
* @fires geo.event.feature.mousedown
|
|
251
|
+
*/
|
|
252
|
+
this._handleMousedown = function (evt) {
|
|
253
|
+
this._handleMousemove(evt, geo_event.feature.mousedown);
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Private mouseup handler. This uses `pointSearch` to determine which
|
|
258
|
+
* features the mouse is over, then fires appropriate events.
|
|
259
|
+
*
|
|
260
|
+
* @param {geo.event} evt The event that triggered this handler.
|
|
261
|
+
* @fires geo.event.feature.mouseup
|
|
262
|
+
*/
|
|
263
|
+
this._handleMouseup = function (evt) {
|
|
264
|
+
this._handleMousemove(evt, geo_event.feature.mouseup);
|
|
265
|
+
};
|
|
266
|
+
|
|
241
267
|
/**
|
|
242
268
|
* Private mousemove handler. This uses `pointSearch` to determine which
|
|
243
269
|
* features the mouse is over, then fires appropriate events.
|
|
244
270
|
*
|
|
245
271
|
* @param {geo.event} evt The event that triggered this handler.
|
|
272
|
+
* @param {string} [updown] If "mouseup" or "mousedown", fire that event
|
|
273
|
+
* instead of mouseon.
|
|
246
274
|
* @fires geo.event.feature.mouseover_order
|
|
247
275
|
* @fires geo.event.feature.mouseover
|
|
248
276
|
* @fires geo.event.feature.mouseout
|
|
249
277
|
* @fires geo.event.feature.mousemove
|
|
250
278
|
* @fires geo.event.feature.mouseoff
|
|
251
279
|
* @fires geo.event.feature.mouseon
|
|
280
|
+
* @fires geo.event.feature.mouseup
|
|
281
|
+
* @fires geo.event.feature.mousedown
|
|
252
282
|
*/
|
|
253
|
-
this._handleMousemove = function (evt) {
|
|
254
|
-
var mouse = m_this.layer().map().interactor().mouse(),
|
|
283
|
+
this._handleMousemove = function (evt, updown) {
|
|
284
|
+
var mouse = evt && evt.mouse ? evt.mouse : m_this.layer().map().interactor().mouse(),
|
|
255
285
|
data = m_this.data(),
|
|
256
286
|
over = m_this.pointSearch(mouse.geo),
|
|
257
287
|
newFeatures = [], oldFeatures = [], lastTop = -1, top = -1, extra;
|
|
@@ -277,6 +307,23 @@ var feature = function (arg) {
|
|
|
277
307
|
});
|
|
278
308
|
}
|
|
279
309
|
|
|
310
|
+
feature.eventID += 1;
|
|
311
|
+
|
|
312
|
+
if (updown) {
|
|
313
|
+
over.index.forEach((i, idx) => {
|
|
314
|
+
m_this.geoTrigger(updown, {
|
|
315
|
+
data: data[i],
|
|
316
|
+
index: i,
|
|
317
|
+
extra: extra[i],
|
|
318
|
+
mouse: mouse,
|
|
319
|
+
eventID: feature.eventID,
|
|
320
|
+
top: idx === over.length - 1,
|
|
321
|
+
sourceEvent: evt
|
|
322
|
+
}, true);
|
|
323
|
+
});
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
|
|
280
327
|
// Get the index of the element that was previously on top
|
|
281
328
|
if (m_selectedFeatures.length) {
|
|
282
329
|
lastTop = m_selectedFeatures[m_selectedFeatures.length - 1];
|
|
@@ -290,7 +337,6 @@ var feature = function (arg) {
|
|
|
290
337
|
return over.index.indexOf(i) < 0;
|
|
291
338
|
});
|
|
292
339
|
|
|
293
|
-
feature.eventID += 1;
|
|
294
340
|
// Fire events for mouse in first.
|
|
295
341
|
newFeatures.forEach(function (i, idx) {
|
|
296
342
|
m_this.geoTrigger(geo_event.feature.mouseover, {
|
package/src/mapInteractor.js
CHANGED
|
@@ -276,6 +276,12 @@ var mapInteractor = function (args) {
|
|
|
276
276
|
input: 'rotate',
|
|
277
277
|
owner: 'geo.mapInteractor',
|
|
278
278
|
name: 'touch zoom and rotate'
|
|
279
|
+
}, {
|
|
280
|
+
action: geo_action.pan,
|
|
281
|
+
input: 'middle',
|
|
282
|
+
modifiers: {shift: false, ctrl: false},
|
|
283
|
+
owner: 'geo.mapInteractor',
|
|
284
|
+
name: 'button pan'
|
|
279
285
|
}],
|
|
280
286
|
|
|
281
287
|
click: {
|
|
@@ -1084,6 +1090,7 @@ var mapInteractor = function (args) {
|
|
|
1084
1090
|
* @param {jQuery.Event} evt The event that triggered this.
|
|
1085
1091
|
* @fires geo.event.brushstart
|
|
1086
1092
|
* @fires geo.event.actiondown
|
|
1093
|
+
* @fires geo.event.mousedown
|
|
1087
1094
|
*/
|
|
1088
1095
|
this._handleMouseDown = function (evt) {
|
|
1089
1096
|
var action, actionRecord;
|
|
@@ -1103,6 +1110,9 @@ var mapInteractor = function (args) {
|
|
|
1103
1110
|
m_this._getMouseButton(evt);
|
|
1104
1111
|
m_this._getMouseModifiers(evt);
|
|
1105
1112
|
|
|
1113
|
+
console.log(JSON.stringify(m_this.mouse().buttons)); // DWM::
|
|
1114
|
+
m_this.map().geoTrigger(geo_event.mousedown, m_this.mouse());
|
|
1115
|
+
|
|
1106
1116
|
if (m_options.click.enabled &&
|
|
1107
1117
|
(!m_mouse.buttons.left || m_options.click.buttons.left) &&
|
|
1108
1118
|
(!m_mouse.buttons.right || m_options.click.buttons.right) &&
|
|
@@ -1532,6 +1542,7 @@ var mapInteractor = function (args) {
|
|
|
1532
1542
|
* @fires geo.event.brushend
|
|
1533
1543
|
* @fires geo.event.actionselection
|
|
1534
1544
|
* @fires geo.event.actionup
|
|
1545
|
+
* @fires geo.event.mouseup
|
|
1535
1546
|
* @fires geo.event.select
|
|
1536
1547
|
* @fires geo.event.zoomselect
|
|
1537
1548
|
* @fires geo.event.unzoomselect
|
|
@@ -1619,6 +1630,9 @@ var mapInteractor = function (args) {
|
|
|
1619
1630
|
if (m_clickMaybe) {
|
|
1620
1631
|
m_this._handleMouseClick(evt);
|
|
1621
1632
|
}
|
|
1633
|
+
var details = m_this.mouse();
|
|
1634
|
+
details.buttonsDown = m_clickMaybe.buttons;
|
|
1635
|
+
m_this.map().geoTrigger(geo_event.mouseup, details);
|
|
1622
1636
|
};
|
|
1623
1637
|
|
|
1624
1638
|
/**
|