Plugin Author
Steven
(@shazahm1hotmailcom)
The method is $entry->getAddresses(). Here’s the link to the doc, in the code.
As you are interested in a Map, you should look at this method too:
I hope this helps; please let me know.
This helps immensely, thank you! Just what I was looking for.
I tried the built-in map functionality, and it’s not quite what I’m looking for. I don’t like the design of the included map, and it looks like I’d have to press the “Geolocation” button on every single entry, which there are hundreds of already and that would be a big hassle.
Plugin Author
Steven
(@shazahm1hotmailcom)
RE: I don’t like the design of the included map
It will be either the Google Map tiles, if you enable the Google Maps API key, or the OSM Map tiles.
RE: it looks like I’d have to press the “Geolocation” button on every single entry
The latitude and longitude are required to display the map pins. Geolocation is done automatically when adding a new entry or adding an address to an entry. If you are missing this info, it is because the address could not be geolocated. The free OSM service can be hit or miss, especially outside of the US. I recommend using Google Maps, as that is far more reliable.
You could geolocate using JS, but that would have to be done on each page load, so it would be far slower than attaching the lat and lng to each address.
I hope this helps; please let me know.
Ohh, I was probably using the free OSM map tiles then, that makes sense.
I still would have to press the “Geolocate” button every entry in this instance, as all of my entries are already imported (200+), with addresses already added. It was easier just to add the Google Maps JS API to the site and calculate the geolocation per entry.
Thanks for your help!