Hi, i'm no a coder but i'm trying to put directions form in infowindow tab with views. I added this form at line 178 of gmap_views.module

return $marker_label.'<form action="http://maps.google.com/maps" method="get" target="_blank"><b>Ottieni indicazioni stradali</b><br /><span class="descriptor">Indirizzo di partenza:</span><br /><input type="text" SIZE=40 MAXLENGTH=40 name="saddr" id="saddr" value="Viale Tricesimo 103 33100, Udine" class=descriptor  onFocus="this.value=\'\';" /><br><INPUT value="Get Directions" TYPE="SUBMIT" class=descriptor><input type="hidden" name="daddr" <strong>value="' '</strong>
  "/></form>';
}

but i can't pass longitude ad latitude parameters on views entry. Any suggestion (or different approaches)?

Comments

zaphod280380’s picture

sorry

"but i can't pass longitude ad latitude parameters on views entry. Any suggestion (or different approaches)?"

in "daddr input value" in the form

zaphod280380’s picture

I found a simple solution. Create a cck computed field and put this in computed code:

$end=$node->locations[0]['street'].', '.$node->locations[0]['postal_code'].', ' .$node->locations[0]['city'];
$start = 'xxx xxx 103, 33100 xxx';

$node_field[0]['value'] ='<form action="http://maps.google.it/maps" method="get" target="_blank"><strong>Ottieni indicazioni stradali</strong><br /><span class="descriptor">Indirizzo di partenza:</span><br /><input type="text" SIZE=40 MAXLENGTH=100 name="saddr" id="saddr" value="'.start.'" class=descriptor  onFocus="this.value=\'\';" /><br /><br /><INPUT value="Invia" TYPE="SUBMIT" class=descriptor><input type="hidden" name="daddr" value="'.$end.'""/></form>';

then put this in display format : $display = $node_field_item['value'];

Now you can expose this field in gmap views.

zaphod280380’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.