Come ignorare geocoder punti cardinali?

voti
0

Sto usando la gemma rotaie geocoder. Vorrei ignorare

COMPASS_POINTS = %w[N NE E SE S SW W NW]

con punti cardinali tedesche:

COMPASS_POINTS = %w[N NO O SO S SW W NW]

ma non so come e dove (config / gecoder.rb?) per fare questo?

Qualsiasi aiuto sarebbe apprezzato!

È pubblicato 16/06/2018 alle 08:36
fonte dall'utente
In altre lingue...                            


1 risposte

voti
2

Secondo la documentazione :

 ##
    # Compass point names, listed clockwise starting at North.
    #
    # If you want bearings named using more, fewer, or different points
    # override Geocoder::Calculations.COMPASS_POINTS with your own array.
    #
    COMPASS_POINTS = %w[N NE E SE S SW W NW]

Quindi, creare un intializer config/initializers/geocoder_override.rbe aggiungere la seguente riga:

Geocoder::Calculations::COMPASS_POINTS = %w[N NO O SO S SW W NW]
Risposto il 16/06/2018 a 08:46
fonte dall'utente

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more