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

muhammadweb’s picture

Hi Chris,

I prefer gmap and location module for Google map configurations..

These module provides the location and map views..

Regards
Muhammad

glitz’s picture

i 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

muhammadweb’s picture

Hi 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

glitz’s picture

ok thanks i will try this today