Code Monkey home page Code Monkey logo

radiant-location-extension's Introduction

= Location

== Introduction

Location is a plugin that will allow you to create relatively robust list of locations (stores, churches, etc.). This uses the Directory extension by Loren Johnson as a starting point but makes a number of different decisions. First it uses Geokit (http://geokit.rubyforge.org) to handle the heavy lifting. Second, the JavaScript is completely rewritten to use version 2 of the Google Maps API and to make some additional API changes (this is still TODO)

== Geokit Modifications

I've made a few modifications to GeoKit to get it to work inside the extension and to maintain certain Radiant paradigms. 

* Geokit is included as a library to the extension rather than as a plugin
* All references to the configuration values have been changed to use Radiant::Config

== Finding Results in space

To process search requests for locations you must create a Location Page. use <r:location> to find and return locations.

The parameters you can use to "find" locations are:

=== start point

The start point is some point in space relative to which we will find locations. This allows a user to say "Find location near Main Street and First Street, My Town, BC, Canada". 

When a start value is specified (using either *address* or *lat*&*lng*), then it will be always be used to calculate a distance to each returned location. If a distance is requested, we will return all the locations with that distance of the start point.

==== *address* 

If supplied, this will be an address that will be geocoded using the configured geocode providers. Once a latitude & longitude are calculated, they form the start point for the request.

==== *lat* & *lng* 

If both parameters are supplied, they are used as the start point. They always take precedence over *address*. 

=== *distance*

When specified, all the locations within this distance of the start point are returned. If no distance is specified, _all_ locations are returned

=== *units*

The units are used for calculating distance from a location to the start point. The default value is "km"

=== *count*

The number of results to return. Defaults to returning ALL results

=== *offset*

The number of the first result to return. This allows you to build pagination into your code

radiant-location-extension's People

Contributors

littlefyr avatar saturnflyer avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.