Git Product home page Git Product logo

Comments (5)

rylanb avatar rylanb commented on August 12, 2024

Damnit! "Note, when you want to sort by the proximity you must use the following format yourMapField_distance. When the query is built, the field name is prepended to the distance column."

Too late a night writing code. Nvm me.

from google-maps-for-craft.

rylanb avatar rylanb commented on August 12, 2024

Well, "Column not found: 1054 Unknown column 'googleMapField_distance' in 'order clause". What am I doing wrong then? I prepended and no dice...

{% set entries = craft.entries.section('storeLocations').level(2).map(params).order('googleMapField_distance asc') %}

googleMapField is the handle for the Google Map I added to the Store Location fields which go in the Store Locations section. I'm stumped. Its late.

from google-maps-for-craft.

kblizeck avatar kblizeck commented on August 12, 2024

I'm getting the same error - any updates here?

Column not found: 1054 Unknown column 'distance' in 'order clause'.

Also doesn't work if I append my googleMap field to distance ::
Column not found: 1054 Unknown column 'googleMap_distance' in 'order clause'.

from google-maps-for-craft.

mdxprograms avatar mdxprograms commented on August 12, 2024

I have found a fix for distance. Hopefully this helps someone down the road. I originally used zip codes in comparison and was unable to get distance to work. Even after attempting to use street addresses and cities I was still unsuccessful. However, when I used lat/lng for both addresses it worked like a charm.
I used the geocode function to get the lat/lng from zipcodes and then did the proximity example to get the distance associated between two endpoints.

from google-maps-for-craft.

objectivehtml avatar objectivehtml commented on August 12, 2024

Sorry for the lack of replies guy. Was off work most of last year due to some serious health and personal issues. I'll try to address the problems here in case people are still wondering or having issues.

First off, I changed some code in the last major release and didn't update the wiki so that's likely causing confusing. Now, distance is the default value that is used, and there is a parameter to override. No more should you use the mapField_distance value. This format is obsolete at this point.

Here is another thread where I posted some additional remarks and possible fixes. Im going to close this thread, but if anyone else has any questions related to this issue please feel free to post them here.

#48

from google-maps-for-craft.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.