php - Google Static Map not loading -


i retrieving values sql table displayed, , want display static map using latitude , longitude co-ordinates taken in.

<?php if(isset($row["address"])) {     echo"<b>address: </b>";     echo $row["address"];     echo "<br>"; }  $latitude = $row["latitude"]; $longitude = $row["longitude"];  $map = "https://maps.googleapis.com/maps/api/staticmap?center=".$latitude.",".$longitude."&zoom=13&size=300x300&key=[my key goes here]"; ?>  <img src="$map"> 

i have renewed key , tested link seperately, , loads fine in chrome browser tab. however, when try load through webpage, address section loads fine, instead of map there usual icon shows picture hasn't loaded. (not enough rep post picture of actual output).

this first time using api welcome!

the problem trying reference $map variable outside php code

you can try this

<?php if(isset($row["address"])) {     echo"<b>address: </b>";     echo $row["address"];     echo "<br>"; }  $latitude = $row["latitude"]; $longitude = $row["longitude"];  $map = "https://maps.googleapis.com/maps/api/staticmap?center=".$latitude.",".$longitude."&zoom=13&size=300x300&key=[my key goes      here]";  echo '<img src="'. $map . '">' ?> 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -