Well, your question wasn't that dumb, since the reason why the page was showing blank was because I defined
{cggm_poadd_dynint} tags after {CGGoogleMaps} one (it needs to be before) :P
However now I am facing another problem, which is passing the two addresses from the two {content block} into the UDT.
What I did :
In my CMS template :
Code: Select all
{capture name=pointc1 assign=addresspoint1}
{content block='point 1' oneline='true'}
{/capture}
{capture name=pointc2 assign=addresspoint2}
{content block='point 2' oneline='true'}
{/capture}
{cggm_poadd_dynint map="1" name='aaa' address=$addresspoint1} {cggm_add_dynpoint map="1" name='asda' address=$addresspoint2}
{content}
CGGoogleMaps template :
Code: Select all
...
{$google_map_js}
{cggm_getaddr}
<__script__ type="text/javascript">
{literal}
// map.setCenter(new GLatLng({/literal}{$MyGeoLocationLatLon}{literal}));
var polyOptions = {geodesic:true};
var polyline = new GPolyline([
new GLatLng({/literal}{$point1}{literal}),
new GLatLng({/literal}{$point2}{literal})
], "#f36c25", 5, 0.8, polyOptions);
map.addOverlay(polyline);
if (GBrowserIsCompatible()) {
map.addOverlay(polyline);
}
{/literal}
</__script>
<!-- end display map -->
UDT:
Code: Select all
global $gCms;
$cggm =& $gCms->modules['CGGoogleMaps']['object'];
$smarty->assign('point1',implode(',',$cggm->GetCoordsFromAddress($addresspoint1)) );
$smarty->assign('point2',implode(',',$cggm->GetCoordsFromAddress($addresspoint2)) );
Now what happens, the google map shows the two points, but doesn't show the polyline and displays the following error after the Map :
Warning: implode() [function.implode]: Invalid arguments passed in /XXXX/XX/XXXX/XXXX//lib/content.functions.php(771) : eval()'d code on line 4
Warning: implode() [function.implode]: Invalid arguments passed in /XXXX/XX/XXXX/XXXX/content.functions.php(771) : eval()'d code on line 5
If I replace
GetCoordsFromAddress($addresspoint1)) ); to
GetCoordsFromAddress(New York City, USA)) ); for example, the line will draw correctly.
So if I understand right, the $addresspoint1 and $addresspoint2 are for some reason not passed to the UDT...