Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix spelling of collinear. #1173

Merged
merged 1 commit into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# GeoJS Change Log

## Version 1.6.5

### Bug Fixes

- Fix spelling of collinear ([#1173](../../pull/1173))

## Version 1.6.4

### Bug Fixes
Expand Down Expand Up @@ -379,7 +385,7 @@
- Added an `object.geoIsOn` function to check if an event is bound ([#768](../../pull/768))
- Use the average perimeter for the center of a polygon or line ([#761](../../pull/761))
- Allow display to/from gcs conversion functions to handle arrays of points ([#766](../../pull/766))
- When drawing a line annotation, don't create intermediate colinear points ([#759](../../pull/759))
- When drawing a line annotation, don't create intermediate collinear points ([#759](../../pull/759))
- Improve exiting and reloading maps ([#750](../../pull/750))
- Various minor improvements ([#767](../../pull/767), [#760](../../pull/760))

Expand Down
1 change: 1 addition & 0 deletions examples/common/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ doctype html
html(lang="en")
head
meta(charset="UTF-8")
meta(name="viewport", content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no")
link(rel="shortcut icon", href="data:image/x-icon;,", type="image/x-icon")
title= title

Expand Down
4 changes: 2 additions & 2 deletions src/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ function continuousVerticesProcessAction(m_this, evt, name) {
return;
}
var cpp = layer.options('continuousPointProximity');
var cpc = layer.options('continuousPointColinearity');
var cpc = layer.options('continuousPointCollinearity');
var ccp = layer.options('continuousCloseProximity');
if (cpp || cpp === 0) {
var vertices = m_this.options('vertices');
Expand All @@ -1140,7 +1140,7 @@ function continuousVerticesProcessAction(m_this, evt, name) {
}
var dist = layer.displayDistance(vertices[vertices.length - 2], null, evt.mouse.map, 'display');
if (dist && dist > cpp) {
// combine nearly colinear points
// combine nearly collinear points
if (vertices.length >= (m_this._lastClickVertexCount || 1) + 3) {
var d01 = layer.displayDistance(vertices[vertices.length - 3], null, vertices[vertices.length - 2], null),
d12 = dist,
Expand Down
8 changes: 4 additions & 4 deletions src/annotationLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ var textFeature = require('./textFeature');
* @property {number} [continuousPointProximity=5] The minimum distance in
* display coordinates (pixels) between two adjacent points when dragging
* to create an annotation. `false` disables continuous drawing mode.
* @property {number} [continuousPointColinearity=1.0deg] The minimum angle
* @property {number} [continuousPointCollinearity=1.0deg] The minimum angle
* between a series of three points when dragging to not interpret them as
* colinear. Only applies if `continuousPointProximity` is not `false`.
* collinear. Only applies if `continuousPointProximity` is not `false`.
* @property {number} [continuousCloseProximity=10] The minimum distance in
* display coordinates (pixels) to close a polygon or end drawing a line when
* dragging to create an annotation. `false` never closes at the end of a
Expand Down Expand Up @@ -135,8 +135,8 @@ var annotationLayer = function (arg) {
// continuous drawing modes.
continuousPointProximity: 5,
// in radians, minimum angle between continuous points to interpret them as
// being coliner
continuousPointColinearity: 1.0 * Math.PI / 180,
// being collinear
continuousPointCollinearity: 1.0 * Math.PI / 180,
continuousCloseProximity: 10, // in pixels, 0 is exact
finalPointProximity: 10, // in pixels, 0 is exact
showLabels: true,
Expand Down
6 changes: 3 additions & 3 deletions src/lineFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,9 @@ var lineFeature = function (arg) {
*
* @param {array} data A new data array.
* @param {number} [tolerance] The maximum variation allowed in map.gcs
* units. A value of zero will only remove perfectly colinear points. If
* not specified, this is set to a half display pixel at the map's current
* zoom level.
* units. A value of zero will only remove perfectly collinear points.
* If not specified, this is set to a half display pixel at the map's
* current zoom level.
* @param {function} [posFunc=this.style.get('position')] The function to
* get the position of each vertex.
* @param {function} [lineFunc=this.style.get('line')] The function to get
Expand Down
6 changes: 3 additions & 3 deletions src/polygonFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,9 @@ var polygonFeature = function (arg) {
*
* @param {array} data A new data array.
* @param {number} [tolerance] The maximum variation allowed in map.gcs
* units. A value of zero will only remove perfectly colinear points. If
* not specified, this is set to a half display pixel at the map's current
* zoom level.
* units. A value of zero will only remove perfectly collinear points.
* If not specified, this is set to a half display pixel at the map's
* current zoom level.
* @param {function} [posFunc=this.style.get('position')] The function to
* get the position of each vertex.
* @param {function} [polyFunc=this.style.get('polygon')] The function to
Expand Down
6 changes: 3 additions & 3 deletions src/util/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ var util = {
/**
* Determine if two line segments cross. They are not considered crossing if
* they share a vertex. They are crossing if either of one segment's
* vertices are colinear with the other segment.
* vertices are collinear with the other segment.
*
* @param {geo.geoPosition} seg1pt1 One endpoint of the first segment.
* @param {geo.geoPosition} seg1pt2 The other endpoint of the first segment.
Expand Down Expand Up @@ -788,7 +788,7 @@ var util = {
}
/* If the lines cross, the signed area of the triangles formed between one
* segment and the other's vertices will have different signs. By using
* > 0, colinear points are crossing. */
* > 0, collinear points are crossing. */
if (util.triangleTwiceSignedArea2d(seg1pt1, seg1pt2, seg2pt1) *
util.triangleTwiceSignedArea2d(seg1pt1, seg1pt2, seg2pt2) > 0 ||
util.triangleTwiceSignedArea2d(seg2pt1, seg2pt2, seg1pt1) *
Expand Down Expand Up @@ -834,7 +834,7 @@ var util = {
* @param {geo.geoPosition[]} pts A list of points forming the line or
* polygon.
* @param {number} tolerance The maximum variation allowed. A value of zero
* will only remove perfectly colinear points.
* will only remove perfectly collinear points.
* @param {boolean} [closed] If true, this is a polygon rather than an open
* line. In this case, it is possible to get back a single point.
* @param {Array.<geo.geoPosition[]>?} [noCrossLines] A falsy value to allow
Expand Down
6 changes: 3 additions & 3 deletions tests/cases/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ describe('geo.annotation', function () {
expect(ann.options('vertices').length).toBe(3);
expect(ann.processAction(evt)).not.toBe(true);
expect(ann.options('vertices').length).toBe(3);
// add a point that will be colinear with the next one
// add a point that will be collinear with the next one
var halfway = {
x: (vertices[1].x + vertices[2].x) / 2,
y: (vertices[1].y + vertices[2].y) / 2
Expand All @@ -1363,8 +1363,8 @@ describe('geo.annotation', function () {
mapgcs: map.displayToGcs(vertices[2], null)
}
};
// a new colinear point will replace the previous point, so we still have
// the same point count
// a new collinear point will replace the previous point, so we still
// have the same point count
expect(ann.processAction(evt)).toBe(true);
expect(ann.options('vertices').length).toBe(4);
// test up near the end of the line
Expand Down
2 changes: 1 addition & 1 deletion tests/gl-cases/svgStickyLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('svgStickyLayer', function () {
myMap.pan({x: 100, y: 100});
myMap.zoom(myMap.zoom() + 0.5);

// the image should be three points that are NOT colinear and are NOT all
// the image should be three points that are NOT collinear and are NOT all
// the same size. Specifically, the black and blue circles should be lower
// than the red circle, and the black circle should be larger than the red
// and blue circles
Expand Down
1 change: 1 addition & 0 deletions tutorials/common/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ doctype html
html(lang="en")
head
meta(charset="UTF-8")
meta(name="viewport", content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no")
link(rel="shortcut icon", href="data:image/x-icon;,", type="image/x-icon")
title GeoJS Tutorial - #{title}

Expand Down