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

Search based on region defined as a set of coordinates #99

Closed aloco closed 6 months ago

aloco commented 8 months ago

Hi,

not sure if I overlooked this in the docs, but is it possible to query for entries with specific coordinates based on a set of coordinates which defines a region? Like a district in a city? "Show me all entries within the district"

thanks in advance

lindseydiloreto commented 6 months ago

Hi @aloco,

You can Filter by Subfields to get only the locations which match a specific subfield.

Sounds like you're looking for something like this...

{% set options = {
    'subfields': {
        'city': 'New York'
    }
} %}

... or perhaps this...

{% set options = {
    'subfields': {
        'county': 'Queens County'
    }
} %}

Hope that helps!