Location Mapper 2.0.6

Overview

This extension provides the ability to do radial proximitry searches for locations. This is accomplished by interfacing with Google Maps API geocoding for entries in a given channel.

You can see this in action on the demo page.

Help Development

Has this add-on helped you make money, save money, or please a client? If so, please consider a small donation (US$10) to help keep this project alive!

Settings

Once the extension has been installed and enabled in your EE install, you will be able to access the settings for the extension. These settings are used in the Geocaching process to retrieve latitude and longitude values for the addresses entered.

  • Locations Channel
    The channel that stores the entries to be mapped. (Required)
  • Address Field
    The channel field that stores address information. (Required)
  • Address Line 2 Field
    Another channel field that stores address information.
  • City Field
    Channel field that stores the location city.
  • State/Province Field
    Channel field that stores the location state or province.
  • Postal Code Field
    Channel field that stores the location postal code.
  • Country Field
    Channel field that stores the location country.
  • Latitude Field
    Channel field that stores the location latitude. (Required)
  • Longitude Field
    Channel field that stores the location longitude. (Required)

Note: Not all fields are required, but results may be improved if they are all used.

Usage

Version 2.0 brings big changes to the add-on. There are now separate methods for the search form and search_results which allow much more flexibility in their usage.

{exp:location_mapper:search_form}

You can call the search form either as a single tag and utilize the parameters for setting basic appearence needs, or as a tag pair to supply your own HTML code for the form. As a single tag, the following parmeters are utilized:

  • unit (mi|km) Use miles or kilometers for distance radius (default: mi)
  • radius_options A | delimited list of integers to use in select dropdown (default: 5|10|25|50|100)
  • show_radius (yes|no) Whether or not to show the radius dropdown (default: yes)
  • radius An integer of the forced radius to use for the search
  • show_categories (yes|no) Whether or not to show the category select field (default: yes)
  • category_group A | delimited list of category group ids (must be assigned to channel in CP)
  • category A | delimited list of categories to force on the search

When used as a tag pair, the following field names can be used to interact with the add-on:

  • lm_search: The search text field
  • lm_radius: The dropdown or hidden field containing integer values for radius
  • category[]: Multi-select field for categories

The following variables can be used in the tag pair:

  • search_string: The value of the submitted search string if available.
  • search_radius: The value of the submitted search radius if available.

{exp:location_mapper:search_results}

This tag provides you with a way to display your search results. Most of the tag parameters that are available to the channel entry tag is available here as well. The following are additional accepted parameters:

  • unit (mi|km) Use miles or kilometers for distance radius (default: mi)
  • distance_decimal: How many decimal places to return with search distances (default: 2)
  • search_string What to search for (Address, postal code, city name)
  • search_radius Numeric value of how many miles or kilometers from search location to include results from
  • always_display A Yes/No flag indicating whether to always show the map, or only if the search form has been submitted. (default: no)
  • override (post|param) A flag to indicate if posted values for search and radius should be used over parameter values or not. (default: post)

The code supplied between the start and ending tag for search_results will be used to display your result entries. This is the same code you would use inside a {exp:channel:entries} tag for your channel. There is one additional {distance} variable available as well whcih holds the numeric value of distance that location is from the search origin.

Hooks

  • entry_submission_end
  • channel_entries_query_result

Current Version Information

The most up-to-date files can be found via the GitHub repository for this project.

package Location Mapper
version 2.0.6
release date Jul 10, 2015
author Justin Koivisto
copyright Copyright © 2013-2014 Justin Koivisto
license LGPL
link http://koivi.com/ee-location-mapper