-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to query latitude and logitud from a Google Maps field? #23
Comments
Were you able to get that sorted? I haven't installed this extension yet, but that's exactly what I have in mind. Any info you could provide would be most welcome. |
No, I could not make it work this way. Instead of this, now I am copying the latitude and longitude values to another custom fields every time the post is updated. This is the code I am using: function update_map_on_post_updated($post_id, $post, $update) { This way I can use the item_latitude and item_longitude fields directly in my query. |
Thank you. I think this is what I'm going to have to do. I had considered this already, but not thoroughly. So extra thanks for providing the add action on this! |
I have a Google Maps field and I would like to query by the location. My field is called "itemLocation". What should I use as the "key"? Because the following does not work:
metaQuery: {
relation: AND
metaArray: [
{
key: "itemLocation['latitude']",
compare: BETWEEN,
value: [$latitude_start, $latitude_end]
},
{
key: "itemLocation['longitude']",
compare: BETWEEN,
value: [$latitude_start, $latitude_end]
}
]
}
The text was updated successfully, but these errors were encountered: