dublin-neighbour

This project exposes following functions - findDistanceOfPointsFromCity - setCustomerRecords - setOriginPointLocation - setRangeToFilterCustomer

Usage no npm install needed!

<script type="module">
  import dublinNeighbour from 'https://cdn.skypack.dev/dublin-neighbour';
</script>

README

This project exposes following functions

  • findDistanceOfPointsFromCity
  • setCustomerRecords
  • setOriginPointLocation
  • setRangeToFilterCustomer

Simply importing and executing the function findDistanceOfPointsFromCity , will give a Json Array object of all customer records which are within 100 Km range of Dublin( GPS coordinates 53.339428, -6.257664 ) which are sorted in ascending order of the user-id.

But following other methods allow the project to be configured , in case you wish to change the city coordinates or wan to change the range , etc

  • setRangeToFilterCustomer - This method takes as input the range in km to be configured. Thus the range can be 40km or 60 km etcwhich depends on the input besides 100km
  • setCustomerRecords - This method takes as input a list of customer records in JSON Array object over which the search operation for food and drinks will take place .
  • setOriginPointLocation - This method allows the latitude,longitude of a different city to be passed in , so that the search operation origin can be different than Dublin as per the needs . This method takes 3 fields as inputs Latitude,Longitude ,Name of City