कैसे geocoders कम्पास अंक ओवरराइड करने के लिए?

वोट
0

मैं रेल जियोकोडर मणि उपयोग कर रहा हूँ। मैं ओवरराइड करना चाहेंगे

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

जर्मन कम्पास अंकों के साथ:

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

लेकिन मैं नहीं जानता कि कैसे और कहाँ (config / gecoder.rb?) यह करने के लिए?

किसी भी सहायता की सराहना की जाएगी!

16/06/2018 को 08:36
का स्रोत उपयोगकर्ता
अन्य भाषाओं में...                            


1 जवाब

वोट
2

के अनुसार प्रलेखन :

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

तो, एक intializer बनाने config/initializers/geocoder_override.rbऔर निम्न पंक्ति जोड़ें:

Geocoder::Calculations::COMPASS_POINTS = %w[N NO O SO S SW W NW]
16/06/2018 को 08:46
का स्रोत उपयोगकर्ता

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