0

I'm using the rails geocoder gem. I would like to override

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

with german compass points:

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

but I don't know how and where (config/gecoder.rb?) to do this?

Any help would be appreciated!

kernification
  • 511
  • 1
  • 5
  • 15
  • Create `config/initializers/geocoder_override.rb` and add `Geocoder::Calculations.COMPASS_POINTS = %w[N NO O SO S SW W NW]` in that. – kiddorails Jun 16 '18 at 08:43

1 Answers1

2

According to documentation:

 ##
    # 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]

So, create an intializer config/initializers/geocoder_override.rb and add the following line :

Geocoder::Calculations::COMPASS_POINTS = %w[N NO O SO S SW W NW]
kiddorails
  • 12,961
  • 2
  • 32
  • 41