Google Latlng Lookup
3rd Party (Free)
89 downloads (last 90 days)
- Multi Site Manager
- Stand Alone Entry Form
- Low Variables
- Better Workflow
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!
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.
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.
If you use this Fieldtype let me know! Twitter: ElliotLewis
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.
Eg. Assuming you’ve named your fieldtype ‘geo_address’ in step 4 above.
Outputs Latitude and Longitude comma separated for direct usage with Google Maps.
The address the user entered. In case you need to display that as well.
Eg. Trafalgar Square, City of Westminster, WC2N 5DN
Just the Latitude.
Just the Longitude.
- Altered validate method so empty values validate (thanks to Creative Lynx)
- Added SafeCracker compatibility
- Allowed fine tuning of co-ordinates by adjusting form values
- 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
1st release. Global and Channel Field default settings
Download Google Latlng Lookup
|EE Version||Downloads||Add-On Version||Release Date|
|2.+||Download||1.0.3||2012-06-12 11:38 PM|
This entry was created June 14, 2012, 11:54 am.
This entry was last updated November 27, 2012, 5:08 pm.
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!