Hello,

I have a site with both the gmap and gmap_location moduled installed. When I create a new node and want to set the location of that node, all is well - I can use the gmap to specify the location.

My question is when I'm editing an existing node - the gmap does not default to the present location of the node - it shows the default state of the map (just like I was adding a new node). Is it possible for the map to show the present location of the node?

Thanks in advance,
-mike

Comments

Antorkh’s picture

Yes i have the same Problem, the default setting is always showing europe although the user already set Australya... it just wont show the current setting, although it is saved.

What to do?

Best regards,
Ant

Antorkh’s picture

Hey why not try this:

Insert into gmap.module after " if (isset($fields['address'])) {" in 753


$form['coordinates']['find_loc_longlang_text'] = array('#value' => variable_get('contact_form_information', t('
	<script language="javascript">
	function set_default(){
		gmap_geocodeaddress('.$map['id'].', document.getElementById(\'gmap-latitude\').value+\', \'+document.getElementById(\'gmap-longitude\').value);
	};
	</script>
	Click here to update Google-Map according to Longitude Latitude: <input type="button" value="Find Location by long/lat" onclick="set_default();">')),);

Problem is: It updates only after pressing the button, automatically starting the function "set_default" dauses error:"geocoder has no properties"

best regards,
Ant

YoshiN’s picture

This seems to fix the probrem.

add 2 lines

$lonform = $form[$fields['longitude']];
$latform = $form[$fields['latitude']];

in gmap.module, within function gmap_location_form_alter,
before if ($lonform['#default_value']!=0 || $latform['#default_value']!=0) {

I checked this with v 1.45.2.2 (2006/10/27)