I'm trying to insert Google Static Maps into a site and am getting
running into problems when trying to replace coordinates for the
marker.

1. Showing the map using numbers for the centre and marker coordinates
produced the map correctly.
2. Showing the map using variables for the centre coordinates and
numbers for the marker coordinates produced the map correctly.
3. Showing the map using variables for both the centre and marker
coordinates resulted in a blank map.

There problem appears to be something to do with using variables for
the marker coordinates.

Can anybody throw any light on this? Thanks in advance.

Output is here: http://www.visitkievukraine.com/test/

Code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>



<body>
<?php
$dbm_lat = 50.450100;
$dbm_lon = 30.523400;
?>
<!--This works - regular static map input -->
<p><img src="http://maps.google.com/maps/api/staticmap?
center=50.450100,30.523400&amp;zoom=16&amp;markers=50.450100,30.523400&amp;size=500x300&amp;sensor=false"
 /
></p>

<!--This also works - replacing centre coordinates with php variables
-->
<p><img src="http://maps.google.com/maps/api/staticmap?center=<?php
$dbm_lat?>,<?php $dbm_lon?
>&amp;zoom=16&amp;markers=50.450100,30.523400&amp;size=500x300&amp;sensor=false"
> /
></p>

<!--This produces blank map - replacing marker coordinates with php
variables -->
<p><img src="http://maps.google.com/maps/api/staticmap?center=<?php
$dbm_lat?>,<?php $dbm_lon?>&amp;zoom=16&amp;markers=<?php $dbm_lat?>,<?
php $dbm_lon?>&amp;size=500x300&amp;sensor=false" /></p>

</body>
</html>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to