• Resolved DCuserName

    (@dcusername)


    Really nice so far, thanks for working on this! The only thing I’m struggling with so far is the autofill on Locations. It’s probably just an OpenCage issue, but when I add the address and city, it invariably gets the rest wrong, and when I correct it, there’s no option to reset the map. If this is beyond your control, would it be possible to have an option to turn off autocomplete? Or maybe have fields in Settings to define some defaults? We’ll always have the same State and Region for instance.

    Thanks,
    David

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Stonehenge Creations

    (@duisterdenhaag)

    Hi David,

    Thanks for your enthusiasm!

    There is no option to turnoff autofill, BUT πŸ™‚
    It is only triggered on “onFocusOut” on the city field. (If your cursor is in the City field and then leaves, the Geocoding is called).

    So as long as you do not touch that (or as first entry), you should be able to edit the other fields.

    What do you mean “invariably gets the rest wrong”? All data is fetched live from the main geocode database. Btw, state and region are geographically not the same. πŸ˜‰ So why would you fill two non-required fields with the same value?

    But again, as soon as the fields are filled, you can still edit them Just do not go back to the city or else you will loose your changes.

    Here’s an example output of the geocoding:

    "components:
    ISO_3166-1_alpha-2: "US"
    country: "USA"
    country_code: "us"
    county: "Clark County"
    neighbourhood: "Enterprise"
    postcode: "89119-4016"
    road: "South Las Vegas Boulevard"
    road_type: "secondary"
    state: "Nevada"
    state_code: "NV"
    suburb: "Hughes Center"
    _type: "road"
    __proto__: Object
    confidence: 9
    formatted: "South Las Vegas Boulevard, Hughes Center, NV 89119-4016, United States of America"
    geometry:
    lat: 36.0723921
    lng: -115.172611
    }"

    The State field is filled by the result of “state” and the region field is filled by the result of “county”.

    Thread Starter DCuserName

    (@dcusername)

    Oh, what I meant was that State and Region, while different from each other, will always be the same values, Oregon and Polk County respectively for us.

    As an example of the bad behavior, if I put in Monmouth or Independence for the city, it won’t guess the Oregon cities, which is what I want. That in itself wouldn’t be the end of the world, but when I change each field with the correct info, the map doesn’t update again to reflect the changes. I thought I could outsmart it by filling in the fields in reverse (Polk County for Region, Oregon for state, then address, etc.), but when I type the city name in, it changes all of the other fields.

    Not your fault at all, but unfortunately it makes it pretty unusable for us right now. I’ll see if I can contact OpenCage for possible solutions, ideally it needs to offer options rather than picking the first match, or look forward to the other fields to narrow the choice, or just have a way to turn off autofill.

    Plugin Author Stonehenge Creations

    (@duisterdenhaag)

    Hang on πŸ™‚

    I think I could work with that. The address is now searched by Street Name and City. I simply did not realise that in one country more cities with the same name could be there… I think that is (rather) unique to the US. πŸ˜‰

    Let me try to add some parameters and see what I can do for you.

    Could you please give a full address that is now troublesome?

    Thread Starter DCuserName

    (@dcusername)

    Ah, that makes sense, thanks for looking at it. : )

    278 S Main Street
    Independence
    Oregon
    Polk County
    97351

    Plugin Author Stonehenge Creations

    (@duisterdenhaag)

    Okay, I’ve been busy with better searches all day.

    It seems though that there is also a “problem” with that address itself. I’ve tried several OSM search engines and neither can find it. I can find the Independence Grill & Bar on 154 S Main Street in Dependence, Oregon. πŸ˜‰

    I guess it’s just not mapped for OSM, yet? Since OSM in open source, you can add missing data on their website: openstreetmaps.org.

    Still, I’m working on bettering the search anyway.

    EDIT:
    It does find 278 South Main Street

    Thread Starter DCuserName

    (@dcusername)

    Interesting! Don’t mean to send you down a rabbit hole, hopefully this is useful to you in the larger context of the plugin.

    If I try searches at openstreetmap.org, The only way to see a single result is to include both the city and state:

    278 S Main Street Independence Oregon

    If I use only the city, it returns multiple entries. Technically I think the “S” abbreviation is the correct form for the address in the US though, I could be wrong.

    Is it possible to include the same sort of choices that the openstreetmap.org search does? So a list of possible addresses, and no autofill until one is chosen? I don’t know if that’s a feature offered by the API, or would be a huge custom project, just throwing out ideas.

    Plugin Author Stonehenge Creations

    (@duisterdenhaag)

    Yes, I am working on the search to be like that. πŸ™‚ It will first return several results that you can/have to choose from. Upon clicking the marker will be dragged there and the fields will be filled (but still editable).

    We are on the same page. LOL

    Plugin Author Stonehenge Creations

    (@duisterdenhaag)

    In version 1.3 I have completely revised the location search. Please check it out and let me know. πŸ™‚

    Plugin Author Stonehenge Creations

    (@duisterdenhaag)

    Hi David,
    By now version 1.6.0 had been released. Since I heard nothing back from you, I’m guessing everything works now. Closing this topic. πŸ™‚

    Please feel free to open a new topic if needed. πŸ™‚

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Location autofill’ is closed to new replies.