Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi
I have a cck text field for "address"
Is there any way I can add a code somewhere (Maybe Views?) that would say "Map it". All I want it to do is take whatever is in the address cck field and open it in a new page on a google map.
So, When the link "Map It" is clicked, it would open http://maps.google.com with the cck fields input mapped.
----------------------
Id like to have this available as an alternative to the GMAP mod.
Thanks,
Chris
Comments
Comment #1
muhammadweb CreditAttribution: muhammadweb commentedHi Chris,
I prefer gmap and location module for Google map configurations..
These module provides the location and map views..
Regards
Muhammad
Comment #2
glitz CreditAttribution: glitz commentedi have tried to install this but was unable to make it work without the user having to enter a longitude and latitude coordinates.
Ill have to reattempt this module.
Thanks
Comment #3
muhammadweb CreditAttribution: muhammadweb commentedHi Chris,
Add the following code to your custom module with passing city name.It will converts a place to Latitude and Longitude.
function get_lat_long(CITY-NAME){
$geocode=file_get_contents('http://maps.google.com/maps/api/geocode/json?address='CITY-NAME'&sensor=false');
$output= json_decode($geocode);
$lat = $output->results[0]->geometry->location->lat;
$long = $output->results[0]->geometry->location->lng;
return array($lat, $long);
}
References:
http://code.google.com/apis/maps/documentation/geocoding/index.html
http://amiworks.co.in/talk/how-to-get-latitudelongitude-from-an-address-...
Regards
Muhammad
Unimity solutions
Comment #4
glitz CreditAttribution: glitz commentedok thanks i will try this today