All Projects → algolia → demo-geo-search

algolia / demo-geo-search

Licence: MIT License
Demo code illustrating the geo search features of Algolia

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects
ruby
36898 projects - #4 most used programming language

Geo-Search Demo

This is a sample project implementing a geo-search based website with Google Maps and Algolia.

Geo search You can also try the live demo or follow the in-depth guide.

Features

  • Full JavaScript (based on jQuery, Hogan.js, Google Maps and AlgoliaSearch + helper)
  • Search inside a bounding Box
  • Search inside a bounding Polygon
  • Search inside an union of Shapes
  • Search around a location (via Lat/Lng)
  • Search around a location (via IP Address)

Usage

We've included some credentials in the code allowing you to test the demo without any Algolia account. If you want to replicate this demo using your own Algolia credentials, you can use the npm run import script to send the data and configure the indices. You can also have a look at the data sent to the index by looking at the ./data/record.json file.

Usage:

bundle install
npm run import YourApplicationID YourAPIKey YourIndexName

Then, you'll need to replace the demo credentials with your own:

  • in js/app.js, set your own APPLICATION_ID instead of "latency" (which is our demo APPLICATION_ID),
  • in js/app.js, set your own SEARCH_ONLY_API_KEY instead of "6be0576ff61c053d5f9a3225e2a90f76",
  • in js/app.js, set your own INDEX_NAME name instead of "demo-geosearch".

Tutorial

Follow this tutorial to learn how this implementation works and how it has been built using the Algolia's Javascript API client and its helper.

Data Set

We've used a list of 3,282 airports from OpenFlight.org.

Run and develop locally

To hack and develop on this current repository:

git clone [email protected]:algolia/demo-geo-search.git
cd ./demo-geo-search
npm install
npm run dev
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].