geojs 1.14.6 → 1.14.7
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/geo.js +45346 -42690
- package/geo.lean.js +23480 -20824
- package/geo.lean.min.js +4 -4
- package/geo.min.js +5 -5
- package/package.json +3 -3
- package/src/pointFeature.js +7 -1
- package/src/util/clustering.js +3 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geojs",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.7",
|
|
4
4
|
"description": "JavaScript Geo Visualization and Analysis Library",
|
|
5
5
|
"homepage": "https://github.com/OpenGeoscience/geojs",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"docco": "^0.9.1",
|
|
49
49
|
"eslint": "^9.25.0",
|
|
50
50
|
"eslint-plugin-import": "^2.25.3",
|
|
51
|
-
"eslint-plugin-jsdoc": "^
|
|
51
|
+
"eslint-plugin-jsdoc": "^51.0.0",
|
|
52
52
|
"eslint-plugin-n": "^17.17.0",
|
|
53
53
|
"eslint-plugin-promise": "^7.2.1",
|
|
54
54
|
"expose-loader": "^5.0.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"resemblejs": "^5.0.0",
|
|
86
86
|
"serve-index": "^1.9.1",
|
|
87
87
|
"shader-loader": "git+https://github.com/Makio64/shader-loader",
|
|
88
|
-
"sinon": "^
|
|
88
|
+
"sinon": "^21.0.0",
|
|
89
89
|
"style-loader": "^4.0.0",
|
|
90
90
|
"stylelint": "<16.3.0 || >16.3.0",
|
|
91
91
|
"stylelint-stylus": "^1.0.0",
|
package/src/pointFeature.js
CHANGED
|
@@ -56,7 +56,9 @@ var feature = require('./feature');
|
|
|
56
56
|
* @typedef {object} geo.pointFeature.clusteringSpec
|
|
57
57
|
* @property {number} [radius=10] This is size in pixels that determines how
|
|
58
58
|
* close points need to be to each other to be clustered.
|
|
59
|
-
* @property {number} [maxZoom=18] Never cluster above this zoom level.
|
|
59
|
+
* @property {number} [maxZoom=18] Never cluster above this zoom level. For a
|
|
60
|
+
* point feature associated with a layer and a map, this will default to the
|
|
61
|
+
* map's zoomRange().max value.
|
|
60
62
|
*/
|
|
61
63
|
|
|
62
64
|
/**
|
|
@@ -138,6 +140,10 @@ var pointFeature = function (arg) {
|
|
|
138
140
|
|
|
139
141
|
// set clustering options to default if an options argument wasn't supplied
|
|
140
142
|
var opts = m_clustering === true ? {radius: 10} : m_clustering;
|
|
143
|
+
if (!opts.maxZoom && this.layer() && this.layer().map()) {
|
|
144
|
+
opts = Object.assign({}, opts);
|
|
145
|
+
opts.maxZoom = this.layer().map().zoomRange().max;
|
|
146
|
+
}
|
|
141
147
|
|
|
142
148
|
// generate the cluster tree from the raw data
|
|
143
149
|
var position = m_this.position();
|
package/src/util/clustering.js
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
* hierarchically given an array of length scales (zoom levels).
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
var $ = require('jquery');
|
|
7
|
-
|
|
8
6
|
/**
|
|
9
7
|
* This class manages a group of nearby points that are clustered as a
|
|
10
8
|
* single object for display purposes. The class constructor is private
|
|
@@ -106,10 +104,10 @@ ClusterTree.prototype.each = function (func) {
|
|
|
106
104
|
* @returns {geo.geoPosition} The 2-d coordinates of the center.
|
|
107
105
|
*/
|
|
108
106
|
ClusterTree.prototype.coords = function () {
|
|
109
|
-
var i, center = {x: 0, y: 0};
|
|
110
107
|
if (this._coord) {
|
|
111
108
|
return this._coord;
|
|
112
109
|
}
|
|
110
|
+
var i, center = {x: 0, y: 0};
|
|
113
111
|
// first add up the points at the node
|
|
114
112
|
for (i = 0; i < this._points.length; i += 1) {
|
|
115
113
|
center.x += this._points[i].x;
|
|
@@ -122,10 +120,11 @@ ClusterTree.prototype.coords = function () {
|
|
|
122
120
|
center.y += this._clusters[i].coords().y * this._clusters[i].count();
|
|
123
121
|
}
|
|
124
122
|
|
|
125
|
-
|
|
123
|
+
this._coord = {
|
|
126
124
|
x: center.x / this.count(),
|
|
127
125
|
y: center.y / this.count()
|
|
128
126
|
};
|
|
127
|
+
return this._coord;
|
|
129
128
|
};
|
|
130
129
|
|
|
131
130
|
/**
|
|
@@ -202,9 +201,6 @@ C.prototype.addPoint = function (point) {
|
|
|
202
201
|
}
|
|
203
202
|
}
|
|
204
203
|
|
|
205
|
-
if (!parent) {
|
|
206
|
-
$.noop();
|
|
207
|
-
}
|
|
208
204
|
// create a new cluster with these two points
|
|
209
205
|
newCluster = new ClusterTree(this, zoom, [closest, point]);
|
|
210
206
|
this._clusters[zoom].addObject(newCluster, newCluster.coords());
|