Skip to content

diasfs/proximity-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

proximity-search

Install

npm install @diasfs/proximity-search

Usage

import ProximitySearch from "proximity-search"

let position = {
    latitude: -30.07866404815339,
    longitude: -51.03899232898299
}

let options: {
    neighbors: false,
    precision: 5
}

ProximitySearch.search(position, options)
    .then(results => {
        for(result of results) {
            let { id, name, tags, lat, lng } = result
            console.log({ id, name, tags, lat, lng })
        }
    })

Options

Option Default Description
endpoint https://cdn.jsdelivr.net/gh/diasfs/osm-proximity@latest/poi-data The endpoint used to search the content. The final url will be the combination of endpoint, precision and the geohash of the position in the precision (https://[endpoint]/[precision]/[geohash].json). The default endpoint will only return results in brazil
precision 5 The geohash precision used to calculate the position geohash. Wikipedia
neighbors false If true, search in the neighbors areas too

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published