How to use the geolib.isPointInside function in geolib

To help you get started, we’ve selected a few geolib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github team-copper / captAR / component / Map.js View on Github external
if (this.props.localUserKey === this.props.players[i].playerKey) {
        team = this.props.players[i].team
        playerHasFlag = this.props.players[i].hasFlag
      }
    }

    // TEAM WIN LOGIC: if red player has red flag and is inside the red territory, red team wins
    if (
      playerHasFlag === true && team === 'red' && geolib.isPointInside(
        { latitude: this.state.latitude, longitude: this.state.longitude },
        redCoordinates
      )
    ) {
      this.setState({ displayStatus: "Red Team Wins!"})
    } else if (
      playerHasFlag === true && team === 'blue' && geolib.isPointInside(
        { latitude: this.state.latitude, longitude: this.state.longitude },
        blueCoordinates
      )
    ) {
      this.setState({ displayStatus: "Blue Team Wins!"})
    }

  };
github team-copper / captAR / component / Map.js View on Github external
this.setState({ displayStatus: "" });
    }

    let team = '';
    let playerHasFlag = false;

    for (let i=0; i
github asafkotzer / apartment-finder / index.js View on Github external
        .filter(x => geolib.isPointInside(x.location, query.searchArea))
        .do(x => incrementCounter(summary, 'within_polygon', x.length))

geolib

Library to provide basic geospatial operations like distance calculation, conversion of decimal coordinates to sexagesimal and vice versa, etc. This library is currently **2D**, meaning that altitude/elevation is not yet supported by any of its functions!

MIT
Latest version published 1 year ago

Package Health Score

66 / 100
Full package analysis

Similar packages