If your users are simply typing in the address and then doing a save, that will not work.
They need to start typing and then select one of the complete and verified addresses that Google provides in the dropdown.
Otherwise, a call is not made to Google and therefore the lat / lng coords are not returned.
A few other people have had this issue – we tried several approaches to force users to make a selection from the dropdown. Unfortunately, while we could force them to make a selection, there were other side effects that created a potentially very confusing UX.
So the only usable solution was adding a note in the field description that alerted the user to the fact that they have to made a selection if they want to appear on the map.
I am making sure to tell users to select an item from the drop down. Perhaps I didn’t make myself clear enough. What I am after is limiting my results to show addresses, is there any way to hook into your code to make a different request to the Google Maps/Places API to force it to return results that are addresses.
IE I don’t want people to be able to select Somewhereville, SomeState, SomeCountry. But to select 123 Some Street, Somewhereville, SomeState, SomeCountry.
I had a quick read through and someone else has managed to make this change, I am not sure how to acheive it.
>I had a quick read through and someone else has managed to make this change
Link?
I think I may have got it all mixed up. I know you can specify the type street-addresses for what is returned by the Google Maps API.
https://developers.google.com/maps/documentation/javascript/places-autocomplete
allows you to set the options to address. If I knew your Google Maps Places API code, I could change myself. But I want to know if I can hook into it instead.
There is no hook.
If you know the Google Places API options, you could try adjusting the initialization call in the javascript in this file: class-pp-field-type-location.php