Google Latlng Lookup

Developer

No Two The Same

3rd Party (Free)

453 downloads (last 90 days)

Download v1.1

EE Version Support

  • ExpressionEngine 2

Compatibility

If an item is crossed out, it might be untested, not applicable or incompatible. Contact the developer to be sure.

  • Updater
  • Multi Site Manager
  • Stand Alone Entry Form
  • Low Variables
  • Content Elements
  • Better Workflow
  • Matrix
  • Grid
  • Webservice
  • Publisher

Requirements

Add-On Type(s)

Fieldtype

Tags

Geocode look up of Latitude and Longitude using Googles Geocode service for the CP. The fieldtype has 3 fields: one is editable for the address and the other two show the returned co-ordinates. All three fields or the combined co-ordinate is available. There's also a little map preview of the returned co-ordinates so the user can check if Google has found the right place!

Description

Google Maps V3 is a great (mostly free) Maps service to use on your clients websites. This fieldtype was developed to overcome the requirements for Google Map’s markers.

Google Maps requires the Latitude and Longitude to place a marker. Generally people don’t know their position on the earth by this data! Handily Google also has geocoding to look up written address details and return the the Lat/Lng co-ordinates. It is possible to add a standard text area fieldtype to EE for the user to enter an address and then in the template use geocoding to find the Lat/Lng and then position a marker on the Map.

The problem with this approach is, if you had 20 markers to place on the map every page refresh will hit Geocode 20 times for the same data. This isn’t very efficient and could use up your usage limit. These co-ordinates should be stored for later usage. This fieldtype does the Geocode lookup in the CP so the Lat/Lng is stored in EEs database.

The fieldtype has 3 fields, 1 is editable for the address and the other 2 show the returned co-ordinates. All 3 fields or the combined co-ordinate is available.
There’s also a little map preview of the returned co-ordinates so the user can check if Googles found the right place! There’s Global Settings for default values every time the fieldtype is added to a field group and default settings at a field group level.

**Note**

This fieldtype only uses Google Maps CP side so once you have the Lng/Lat you can use any mapping service front-end you like.

Technically this isn’t true, https://developers.google.com/maps/documentation/geocoding/

The Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.

If you use this Fieldtype let me know! Twitter: ElliotLewis

GitHub Page

Usage

Installation

1. Add-ons -> Fieldtypes -> Google Maps Lat Lng Lookup -> Install]
2. The title (Google Maps Lat Lng Lookup) becomes a link, click to change the Global default.
3. Admin -> Channel Fields -> Add New Field.
4. Change the default settings for this Channel Field.

Template Tags

Eg. Assuming you’ve named your fieldtype ‘geo_address’ in step 4 above.

{geo_address}
Outputs Latitude and Longitude comma separated for direct usage with Google Maps. 
Eg. 51.5077227,-0.1279623000000356

{geo_address:address}
The address the user entered. In case you need to display that as well. 
Eg. Trafalgar Square, City of Westminster, WC2N 5DN

{geo_address:latitude}
Just the Latitude. 
Eg. 51.5077227

{geo_address:longitude}
Just the Longitude. 
Eg. -0.1279623000000356

Version History

1.1, 10/03/14
  - Data saved to DB as pipe delimited string, so added validation against address field containing | character. https://github.com/elliotlewis/Google-Latlng-Lookup/issues/4
1.0.3, 27/11/12
  - Altered validate method so empty values validate (thanks to Creative Lynx)
  - Added SafeCracker compatibility
1.0.2, 31/08/2012
  - Allowed fine tuning of co-ordinates by adjusting form values
1.0.1, 15/06/2012
  - Fixed silly error where I was directly accessing the LatLng object instead of using built in function to return the co-ordinates
  - Added more error feedback
  - Feedback on type of result returned, Eg. Approximate location
1.0, 12/06/2012
  1st release. Global and Channel Field default settings

Download Google Latlng Lookup

EE Support Downloads Add-On Version Release Date
Not Specified Download 1.1 Jun 12, 2012

This entry was created June 14, 2012, 11:54 am.
This entry was last updated March 10, 2014, 9:24 am.

Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!

Returns: devot:ee has a 30-day return policy on all commercial add-ons sold through devot-ee.com. If you need to return an add-on, do not go to the developer or the developer's site, but rather visit our returns page at https://devot-ee.com/returns to initiate your return. If you have questions, email support@devot-ee.com.

1 Review:

Giraffentoast 08.24.12

Giraffentoast
Rating - {addon_rating_average}

Awesome. Just upload, enable and that’s it. Not only does it return the coordinates - it also comes with a map. :D

Great work, guys!