geojs 1.10.4 → 1.10.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/CHANGELOG.md +25 -0
- package/geo.js +33 -16
- package/geo.lean.js +33 -16
- package/geo.lean.min.js +2 -2
- package/geo.min.js +2 -2
- package/package.json +1 -1
- package/src/annotation/annotation.js +7 -2
- package/src/annotation/polygonAnnotation.js +1 -1
- package/src/annotation/rectangleAnnotation.js +0 -1
- package/src/object.js +9 -0
- package/src/polygonFeature.js +7 -2
- package/src/webgl/quadFeature.js +1 -1
package/package.json
CHANGED
|
@@ -141,6 +141,9 @@ var annotation = function (type, args) {
|
|
|
141
141
|
* Clean up any resources that the annotation is using.
|
|
142
142
|
*/
|
|
143
143
|
this._exit = function () {
|
|
144
|
+
if (m_this.layer()) {
|
|
145
|
+
m_this.layer().geoOff(geo_event.mousemove, m_this._cursorHandleMousemove);
|
|
146
|
+
}
|
|
144
147
|
};
|
|
145
148
|
|
|
146
149
|
/**
|
|
@@ -754,6 +757,9 @@ var annotation = function (type, args) {
|
|
|
754
757
|
*/
|
|
755
758
|
this.coordinates = function (gcs) {
|
|
756
759
|
var coord = m_this._coordinates() || [];
|
|
760
|
+
if (!coord.length && (!coord.outer || !coord.outer.length)) {
|
|
761
|
+
coord = [];
|
|
762
|
+
}
|
|
757
763
|
if (m_this.layer()) {
|
|
758
764
|
var map = m_this.layer().map();
|
|
759
765
|
gcs = (gcs === null ? map.gcs() : (
|
|
@@ -1265,8 +1271,7 @@ function continuousVerticesActions(m_this, s_actions, state, name, originalArgs)
|
|
|
1265
1271
|
action: geo_action['annotation_' + name],
|
|
1266
1272
|
name: name + ' create',
|
|
1267
1273
|
owner: annotationActionOwner,
|
|
1268
|
-
input: 'left'
|
|
1269
|
-
modifiers: {shift: false, ctrl: false}
|
|
1274
|
+
input: 'left'
|
|
1270
1275
|
}, {
|
|
1271
1276
|
action: geo_action['annotation_' + name],
|
|
1272
1277
|
name: name + ' create',
|
|
@@ -134,7 +134,7 @@ var polygonAnnotation = function (args) {
|
|
|
134
134
|
(coord.inner || []).forEach((h) => result[0].push(h.map((pt) => [pt.x, pt.y])));
|
|
135
135
|
return result;
|
|
136
136
|
}
|
|
137
|
-
if (coord.length < 3) {
|
|
137
|
+
if (coord.length < 3 || !coord.map) {
|
|
138
138
|
return [];
|
|
139
139
|
}
|
|
140
140
|
return [[coord.map((pt) => [pt.x, pt.y])]];
|
|
@@ -75,7 +75,6 @@ var rectangleAnnotation = function (args, annotationName) {
|
|
|
75
75
|
name: 'rectangle create',
|
|
76
76
|
owner: annotationActionOwner,
|
|
77
77
|
input: 'left',
|
|
78
|
-
modifiers: {shift: false, ctrl: false},
|
|
79
78
|
selectionRectangle: true,
|
|
80
79
|
selectionConstraint: this._selectionConstraint
|
|
81
80
|
}];
|
package/src/object.js
CHANGED
|
@@ -273,6 +273,15 @@ var object = function () {
|
|
|
273
273
|
return m_this;
|
|
274
274
|
};
|
|
275
275
|
|
|
276
|
+
/**
|
|
277
|
+
* Report the current event handlers.
|
|
278
|
+
*
|
|
279
|
+
* @returns {object} An object with all of the event handlers.
|
|
280
|
+
*/
|
|
281
|
+
this._eventHandlers = function () {
|
|
282
|
+
return m_eventHandlers;
|
|
283
|
+
};
|
|
284
|
+
|
|
276
285
|
/**
|
|
277
286
|
* Free all resources and destroy the object.
|
|
278
287
|
*/
|
package/src/polygonFeature.js
CHANGED
|
@@ -573,9 +573,11 @@ var polygonFeature = function (arg) {
|
|
|
573
573
|
* get the position of each vertex.
|
|
574
574
|
* @param {function} [polyFunc=this.style.get('polygon')] The function to
|
|
575
575
|
* get each polygon.
|
|
576
|
-
* @
|
|
576
|
+
* @param {boolean} [returnData=false] If truthy, return the new data array
|
|
577
|
+
* rather than modifying the feature.
|
|
578
|
+
* @returns {this|array}
|
|
577
579
|
*/
|
|
578
|
-
this.rdpSimplifyData = function (data, tolerance, posFunc, polyFunc) {
|
|
580
|
+
this.rdpSimplifyData = function (data, tolerance, posFunc, polyFunc, returnData) {
|
|
579
581
|
var map = m_this.layer().map(),
|
|
580
582
|
mapgcs = map.gcs(),
|
|
581
583
|
featuregcs = m_this.gcs(),
|
|
@@ -633,6 +635,9 @@ var polygonFeature = function (arg) {
|
|
|
633
635
|
}
|
|
634
636
|
return elem;
|
|
635
637
|
});
|
|
638
|
+
if (returnData) {
|
|
639
|
+
return data;
|
|
640
|
+
}
|
|
636
641
|
|
|
637
642
|
/* Set the reduced polgons as the data and use simple accessors. */
|
|
638
643
|
m_this.style('position', util.identityFunction);
|
package/src/webgl/quadFeature.js
CHANGED
|
@@ -372,7 +372,7 @@ var webgl_quadFeature = function (arg) {
|
|
|
372
372
|
nearestPixel = curZoom >= nearestPixel;
|
|
373
373
|
}
|
|
374
374
|
m_quads.imgQuads.forEach((quad) => {
|
|
375
|
-
if (quad.image && quad.texture && quad.texture.nearestPixel() !== nearestPixel) {
|
|
375
|
+
if (quad.image && quad.texture && quad.texture.nearestPixel() !== nearestPixel && quad.texture.textureHandle()) {
|
|
376
376
|
/* This could just be
|
|
377
377
|
* quad.texture.setNearestPixel(nearestPixel);
|
|
378
378
|
* but that needlessly redecodes the image. Instead, just change the
|