doublesecretagency / craft-googlemaps

Google Maps plugin for Craft CMS - Maps in minutes. Powered by the Google Maps API.
https://plugins.doublesecretagency.com/google-maps/
Other
10 stars 8 forks source link

Add a `name` subfield #26

Closed lindseydiloreto closed 2 years ago

lindseydiloreto commented 3 years ago

Some locations have a proper name which goes beyond their street address (ie: "Empire State Building"). It may make sense to store this name alongside the existing Address data. The Google API results include an address_components array, which often contains a premise. When available, we could use this value as the associated place name.

Once this has been added, you would be able to access the location's name like this...

{{ address.name }}

The value should also be available as an Address subfield.

lindseydiloreto commented 3 years ago

This FR ties very closely to #25. If they happen, they are likely to happen together.

kerns commented 3 years ago

I would really love this feature. It's the only important feature missing and I think a lot of projects could benefit from it.

Small side note: I am not always in love with the official place/premise names and they are not always clean or usable. For example some businesses add them in ALL CAPS, or with an Inc / LIMITED or some other legalistic syntax that doesn't make a good or coherent label relative to how the establishment is known or referred to popularly.

For this reason, the ideal setup would be if you could type into an address name field, select from auto suggestions with enter, but then edit/sanitize the address name yourself prior to submission ...without changing the rest of the address info or otherwise breaking the universe.

If there is anything I can do in terms of testing or sparring on the feature please let me know.

lindseydiloreto commented 2 years ago

The name subfield has been added, and will be formally released with v4.1.0. 👍

In the meantime, you can get it by switching to the dev branch...

"doublesecretagency/craft-googlemaps": "dev-v4-dev"