geojs 1.6.4 → 1.6.5
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 +7 -1
- package/geo.js +17 -17
- package/geo.lean.js +17 -17
- package/geo.lean.min.js +2 -2
- package/geo.min.js +2 -2
- package/package.json +1 -1
- package/src/annotation.js +2 -2
- package/src/annotationLayer.js +4 -4
- package/src/lineFeature.js +3 -3
- package/src/polygonFeature.js +3 -3
- package/src/util/common.js +3 -3
package/package.json
CHANGED
package/src/annotation.js
CHANGED
|
@@ -1128,7 +1128,7 @@ function continuousVerticesProcessAction(m_this, evt, name) {
|
|
|
1128
1128
|
return;
|
|
1129
1129
|
}
|
|
1130
1130
|
var cpp = layer.options('continuousPointProximity');
|
|
1131
|
-
var cpc = layer.options('
|
|
1131
|
+
var cpc = layer.options('continuousPointCollinearity');
|
|
1132
1132
|
var ccp = layer.options('continuousCloseProximity');
|
|
1133
1133
|
if (cpp || cpp === 0) {
|
|
1134
1134
|
var vertices = m_this.options('vertices');
|
|
@@ -1140,7 +1140,7 @@ function continuousVerticesProcessAction(m_this, evt, name) {
|
|
|
1140
1140
|
}
|
|
1141
1141
|
var dist = layer.displayDistance(vertices[vertices.length - 2], null, evt.mouse.map, 'display');
|
|
1142
1142
|
if (dist && dist > cpp) {
|
|
1143
|
-
// combine nearly
|
|
1143
|
+
// combine nearly collinear points
|
|
1144
1144
|
if (vertices.length >= (m_this._lastClickVertexCount || 1) + 3) {
|
|
1145
1145
|
var d01 = layer.displayDistance(vertices[vertices.length - 3], null, vertices[vertices.length - 2], null),
|
|
1146
1146
|
d12 = dist,
|
package/src/annotationLayer.js
CHANGED
|
@@ -21,9 +21,9 @@ var textFeature = require('./textFeature');
|
|
|
21
21
|
* @property {number} [continuousPointProximity=5] The minimum distance in
|
|
22
22
|
* display coordinates (pixels) between two adjacent points when dragging
|
|
23
23
|
* to create an annotation. `false` disables continuous drawing mode.
|
|
24
|
-
* @property {number} [
|
|
24
|
+
* @property {number} [continuousPointCollinearity=1.0deg] The minimum angle
|
|
25
25
|
* between a series of three points when dragging to not interpret them as
|
|
26
|
-
*
|
|
26
|
+
* collinear. Only applies if `continuousPointProximity` is not `false`.
|
|
27
27
|
* @property {number} [continuousCloseProximity=10] The minimum distance in
|
|
28
28
|
* display coordinates (pixels) to close a polygon or end drawing a line when
|
|
29
29
|
* dragging to create an annotation. `false` never closes at the end of a
|
|
@@ -135,8 +135,8 @@ var annotationLayer = function (arg) {
|
|
|
135
135
|
// continuous drawing modes.
|
|
136
136
|
continuousPointProximity: 5,
|
|
137
137
|
// in radians, minimum angle between continuous points to interpret them as
|
|
138
|
-
// being
|
|
139
|
-
|
|
138
|
+
// being collinear
|
|
139
|
+
continuousPointCollinearity: 1.0 * Math.PI / 180,
|
|
140
140
|
continuousCloseProximity: 10, // in pixels, 0 is exact
|
|
141
141
|
finalPointProximity: 10, // in pixels, 0 is exact
|
|
142
142
|
showLabels: true,
|
package/src/lineFeature.js
CHANGED
|
@@ -396,9 +396,9 @@ var lineFeature = function (arg) {
|
|
|
396
396
|
*
|
|
397
397
|
* @param {array} data A new data array.
|
|
398
398
|
* @param {number} [tolerance] The maximum variation allowed in map.gcs
|
|
399
|
-
* units. A value of zero will only remove perfectly
|
|
400
|
-
* not specified, this is set to a half display pixel at the map's
|
|
401
|
-
* zoom level.
|
|
399
|
+
* units. A value of zero will only remove perfectly collinear points.
|
|
400
|
+
* If not specified, this is set to a half display pixel at the map's
|
|
401
|
+
* current zoom level.
|
|
402
402
|
* @param {function} [posFunc=this.style.get('position')] The function to
|
|
403
403
|
* get the position of each vertex.
|
|
404
404
|
* @param {function} [lineFunc=this.style.get('line')] The function to get
|
package/src/polygonFeature.js
CHANGED
|
@@ -565,9 +565,9 @@ var polygonFeature = function (arg) {
|
|
|
565
565
|
*
|
|
566
566
|
* @param {array} data A new data array.
|
|
567
567
|
* @param {number} [tolerance] The maximum variation allowed in map.gcs
|
|
568
|
-
* units. A value of zero will only remove perfectly
|
|
569
|
-
* not specified, this is set to a half display pixel at the map's
|
|
570
|
-
* zoom level.
|
|
568
|
+
* units. A value of zero will only remove perfectly collinear points.
|
|
569
|
+
* If not specified, this is set to a half display pixel at the map's
|
|
570
|
+
* current zoom level.
|
|
571
571
|
* @param {function} [posFunc=this.style.get('position')] The function to
|
|
572
572
|
* get the position of each vertex.
|
|
573
573
|
* @param {function} [polyFunc=this.style.get('polygon')] The function to
|
package/src/util/common.js
CHANGED
|
@@ -758,7 +758,7 @@ var util = {
|
|
|
758
758
|
/**
|
|
759
759
|
* Determine if two line segments cross. They are not considered crossing if
|
|
760
760
|
* they share a vertex. They are crossing if either of one segment's
|
|
761
|
-
* vertices are
|
|
761
|
+
* vertices are collinear with the other segment.
|
|
762
762
|
*
|
|
763
763
|
* @param {geo.geoPosition} seg1pt1 One endpoint of the first segment.
|
|
764
764
|
* @param {geo.geoPosition} seg1pt2 The other endpoint of the first segment.
|
|
@@ -788,7 +788,7 @@ var util = {
|
|
|
788
788
|
}
|
|
789
789
|
/* If the lines cross, the signed area of the triangles formed between one
|
|
790
790
|
* segment and the other's vertices will have different signs. By using
|
|
791
|
-
* > 0,
|
|
791
|
+
* > 0, collinear points are crossing. */
|
|
792
792
|
if (util.triangleTwiceSignedArea2d(seg1pt1, seg1pt2, seg2pt1) *
|
|
793
793
|
util.triangleTwiceSignedArea2d(seg1pt1, seg1pt2, seg2pt2) > 0 ||
|
|
794
794
|
util.triangleTwiceSignedArea2d(seg2pt1, seg2pt2, seg1pt1) *
|
|
@@ -834,7 +834,7 @@ var util = {
|
|
|
834
834
|
* @param {geo.geoPosition[]} pts A list of points forming the line or
|
|
835
835
|
* polygon.
|
|
836
836
|
* @param {number} tolerance The maximum variation allowed. A value of zero
|
|
837
|
-
* will only remove perfectly
|
|
837
|
+
* will only remove perfectly collinear points.
|
|
838
838
|
* @param {boolean} [closed] If true, this is a polygon rather than an open
|
|
839
839
|
* line. In this case, it is possible to get back a single point.
|
|
840
840
|
* @param {Array.<geo.geoPosition[]>?} [noCrossLines] A falsy value to allow
|