BRG February 2016

Googlemap_Location does not print the correct map

I am having issue to display an iframe showing a google Map.

<html>
<head>
<?
    $map = new GoogleMap_Location( 'main' );

    echo $map->getHeaderJS();

    $sql = "SELECT Ortsteil FROM Ortsteile WHERE OrtID = '".$ortsteileID."'";
    $res = mysql_command( $sql );
    $ortsteile = mysqli_result( $res, 0, "Ortsteil" );


?>
</head>
<body  onload="onLoad();">
<div>
<h4>Map is here</h4>
</div>
<table>
<tr>
<td style="border:1px solid #DDDDDD">

<?
    $googlemap = new GoogleMap_Location( '$ortsteile' );
    $googlemap->setWidth( 400 );
  $googlemap->setHeight( 370 );
    $_coords = $googlemap->geoGetCoords( $ortsteile.', Liguria, Italy' );
    $googlemap->setCenterCoords( $_coords['lon'], $_coords['lat'] );
    $googlemap->printMapJS();
    $googlemap->printMap( );
?>


</td>
</tr>
</table>
</div>
</body>
</html>

The query is correct and when i do inspect Element on the website the iframe is there but not showing anything.

Any ideas?

Answers


dhruv jadia February 2016

change from

$googlemap = new GoogleMap_Location( '$ortsteile' );

to

$googlemap = new GoogleMap_Location($ortsteile);

Post Status

Asked in February 2016
Viewed 1,380 times
Voted 10
Answered 1 times

Search




Leave an answer