objectivehtml / Google-Maps-for-Craft

The complete geolocation toolkit for Craft CMS.
Other
94 stars 20 forks source link

Column not found distance #29

Closed webvader closed 8 years ago

webvader commented 9 years ago

Hi,

When i try to use the search on proximity I get an SQL error Column not found distance whatever i put in for the order e.g. MyFieldHandle_distance I still get Column not found ... Any idea how to fix this?

This is the code I use:

{% set query = craft.request.getParam('q') %} {% if query is defined %} {% set searchParams = { 'address': query, distance: 200 } %} {% set foundLocations = craft.entries.section('locations').map(searchParams).order('googleMapField_distance asc') %} {% else %} {% set foundLocations = locations %} {% endif %}

webvader commented 9 years ago

Re-installed the plugin and re-saved the entries. now the SQL error is gone and search is working, but marker.distance is empty.

Nevermind got it working: I used location.map.markers instead of location.map.markers() ... both work except the latter returns distance, the first one does not.

mdxprograms commented 8 years ago

@objectivehtml is there any fixes in the works for this issue? I noticed there's a couple more open with the same issue.

objectivehtml commented 8 years ago

https://github.com/objectivehtml/Google-Maps-for-Craft/issues/48