Skip to content

Commit

Permalink
Added/minified global stopping features
Browse files Browse the repository at this point in the history
  • Loading branch information
sdl60660 committed Jan 8, 2022
1 parent 83ade79 commit 4e4012f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/data/global_stopping_features.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ const getDataBounds = (linestringData, coordinatesExtracted=false) => {
// Returns distance in meters (negative values for points inside) from a point to the edges of a polygon
// This function comes from here: https://github.com/Turfjs/turf/issues/1743
const distanceToPolygon = ({ startPoint, targetPolygon }) => {
// if (!targetPolygon.geometry) {
console.log('here!', targetPolygon)
// }

if (targetPolygon.type === "Feature") { targetPolygon = targetPolygon.geometry }

let distance;

if (targetPolygon.coordinates.length === 0) {
if (!targetPolygon || targetPolygon.coordinates.length === 0) {
return 9999999;
}
if (targetPolygon.type === "MultiPolygon" || typeof targetPolygon.coordinates[0][0][0] === "object") {
Expand Down

1 comment on commit 4e4012f

@vercel
Copy link

@vercel vercel bot commented on 4e4012f Jan 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.