Giter Club home page Giter Club logo

Comments (1)

SachsenspieltCoding avatar SachsenspieltCoding commented on July 18, 2024

Hi @K1kc4,
since GH maps is built around the GraphHopper APIs, it also depends on the /geocode endpoint of the GraphHopper Gecoding API. With your config, graphhopper-maps would try to fetch from

http://192.168.1.10:8080/nominatimgeocode?q=...

In the code it is descriped here:

async geocode(query: string, provider: string): Promise<GeocodingResult> {
if (!this.supportsGeocoding())
return {
hits: [],
took: 0,
}
const url = this.getGeocodingURLWithKey('geocode')
url.searchParams.append('q', query)
url.searchParams.append('provider', provider)
const langAndCountry = getTranslation().getLang().split('_')
url.searchParams.append('locale', langAndCountry.length > 0 ? langAndCountry[0] : 'en')
// routing makes not much sense between areas and it is unclear if the center is on a road
url.searchParams.append('osm_tag', '!place:county')
url.searchParams.append('osm_tag', '!boundary')
url.searchParams.append('osm_tag', '!historic')
const response = await fetch(url.toString(), {
headers: { Accept: 'application/json' },
})
if (response.ok) {
return (await response.json()) as GeocodingResult
} else {
throw new Error('Geocoding went wrong ' + response.status)
}
}

private getGeocodingURLWithKey(endpoint: string) {
const url = new URL(this.geocodingApi + endpoint)
url.searchParams.append('key', this.apiKey)
return url
}

I hope that I helped you with this.

from graphhopper-maps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.