Closed (fixed)
Project:
Location
Version:
6.x-3.x-dev
Component:
Location_views
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Oct 2009 at 11:40 UTC
Updated:
10 Dec 2009 at 05:00 UTC
Hi,
I want to use the CCK Location Field in order to set map.setCenter of Google Maps I'm displaying via Contemplates in nodes. All I can find in Contemplates is print $node->field_location[0]['view'] (I named the CCK field 'location'), which displays the whole location, such as
Germany
51° 24' 46.4832" N, 10° 10' 24.024" E
See map: Google MapsIs it possible to get the values of latitude and longitude separately, like 51.412912 and 10.17334?
Comments
Comment #1
yoda-fr commentedHi,
I found the answer :
$lat = $field_location[0]['latitude'];
$long = $field_location[0]['longitude'];
"location" is the name of my field.
Hope it will help!
Comment #2
Robert Molenaar commentedIt helped,
I now use 'computed field' to fill the lat and lon values to a different cck field.
Thanks.
Comment #3
nickl commentedMoving this to the documentation project documentation/faq/help so that we don't loose any vital information collected here.