Custom Fields
Re-Envisioned
Support Meta Box Geolocation New Google maps pricing policy and MB geolocation

This topic contains 25 replies, has 4 voices, and was last updated by  Anh Tran 4 weeks, 1 day ago.

  • Creator
    Topic
  • #9438
    Resolved
    poehnix
    Participant

    Hi,
    according to my understanding, starting June 11th 2018, google maps api users will be forced to give a credit card number to use the service, even if they do not reach the 25.000 hits per day ( free daily rate usage).
    It is not feasable to ask for a client credit card or force him to generate a private api key, so I would like to ask if it’s going to be provided a different (free) geolocation service for Metabox geolocation plugin, maybe with the possibility to choose between google maps and the new geolocation provider
    All the info about the subject can be found here https://cloud.google.com/maps-platform/user-guide/

    Thank you
    Michele

Viewing 10 replies - 11 through 20 (of 25 total)
  • Author
    Replies
  • #10463

    david.h
    Participant

    Hi Anh,

    This looks perfect.

    I’m currently juggling several projects and my staging environment is down at the moment, but I’ll try and test it next week.

    Thanks

    #10555

    poehnix
    Participant

    Hi Ahn and David, sorry for the delayed answer.
    I will be able to test the code only next week. Anyway, the provided link on github (https://github.com/wpmetabox/meta-box/tree/map-field) returns a 404, so i do not know how to get the code. Ahn, could you please give us the right url ?
    I am eager to try the new map&geocoding plugin. Just out of curiosity, is there any reason why you haven’t used the Nominatim tools for geocoding that comes with openstreetmap? Reference can be found here
    https://wiki.openstreetmap.org/wiki/Nominatim

    Thank you for your effort. Next week, once I have the code I will be able to test it.
    For the moment thank you for your hard work

    Bye
    Michele

    #10573

    Anh Tran
    Keymaster

    Hi Michele,

    I’ve merged the branch into the master branch, so it’s available at https://github.com/wpmetabox/meta-box/. At the moment, I only finished the osm field, which is an alternative for map field. If everything goes right, Geolocation will be the next step.

    And yes, I use Nominatim for the geocoding :). I found the wiki, but didn’t look at that carefully until I read code of other libraries. It’s great and not hard to implement.

    #10604

    poehnix
    Participant

    Hi Ahn,
    I have made a bit of testing. I made a new post type with title, editor and osm metabox in code ( osm map + address text field) using metabox from github master branch

    On the backend everything seems to be ok. Geolocation works almost fine. The only problem I see is that if the address is not known by openstreetmap, which happens in OSM more than google maps, there is no feedback message (something like “address not found”) but, given that markers can be moved “by hand” one can look for another place and then move the marker manually, so it’s not a big deal.

    On the frontend unfortunately I am not able to display the map. rwmb_meta( ‘mapID’, $args ) returns an array with the coordinates and zoom value and not the map as expected, something like array(3) { [“latitude”]=> string(10)
    “39.7995053” [“longitude”]=> string(10) “18.3579493” [“zoom”]=> string(2) “16” }
    I might be missing something trivial here, can you please give me an advice on what I am doing wrong ?

    One last thing: I had upgraded the geolocation plugin to latest release but I had to revert it back because of some notices on line 73 of geolocation class (types not defined). Probably something related to the geo paramenter. Since geolocation is working, at this point it is not clear if the “geo” parameter (or even the geolocation plugin itself) is needed and / or what one has to put in there.

    I will made more tests when I have these info. In the meantime thank you for your hard work.
    Bye
    Michele

    #10608

    Anh Tran
    Keymaster

    Hi Michele,

    Thanks a lot for your feedback!

    • No results message: I’ve just added it to both osm and map field.
    • Output the map: I’ve fixed it.
    • Geolocation extension: I couldn’t find the bug on line 73. There is a check isset on line 72. Maybe I’m missing something.

    One note: The Geolocation extension has not been updated to use OSM yet. It still uses the Google Maps API. Only the core Meta Box plugin with osm field use the new OSM. I’ll update the Geolocation later if everything goes well with osm field.

    #10621

    poehnix
    Participant

    Hi Ahn,
    I can confirm that now osm map displays perfectly in the frontend.

    The “no address found” message in the backend does not still display. I have updated meta-box to the latest github release and disabled the geolocation plugin. I have cleared the browser cache too.
    When I write an (unknown to OSM) address and click on the “find address” button nothing happens on the map.
    Looking at the javascript console I see the ajax request to nominatinm.openstreetmap.org and the response. The response is empty. Where should the message appear? I guess near the address field…
    Trying the same address directly in the https://nominatim.openstreetmap.org/ input search reset the map to the whole world.

    On a side note, due to office relocation I will only be able to proceed with the tests in a couple of days
    Thank you
    Michele

    #10636

    Anh Tran
    Keymaster

    Hi Michele,

    The “No address found” message is shown in the autocomplete popup, just like this:

    View post on imgur.com

    I’ve just tested again and it show correctly to me. Perhaps you should try again?

    #10640

    poehnix
    Participant

    No idea of what’s wrong. I am doing some js debugging but I cannot see the value result variable.
    Possibly due to the fact that RWMB_Osm.no_results_string is set on line 145 but not on line 190 where there is just a return ?
    With a non existent address “XXXXXXXX”, clicking on find address does nothing (it correctly does not move the pin on the map but it does not show the message)

    I am attaching an image too https://imgur.com/sKLkrc7

    I am testing it on Firefox, now I will try with Chrome,
    Any clue of what is going wrong ?
    Thank you
    Michele
    }

    #10642

    poehnix
    Participant

    Oh too bad! On my testing enviroment I had re-enabled the geolocation plugin!!! I did not find it because I was seeing the ajax queries to nominatim!
    Sorry, my mistake. On chrome I got I message that lead me to find the problem.
    I confirm the “no message found” is showing correctly
    Thank you very much Ahn, and sorry for the trouble
    Michele

    #10643

    Anh Tran
    Keymaster

    Cool! That’s enough for an update 🙂

Viewing 10 replies - 11 through 20 (of 25 total)

You must be logged in to reply to this topic.