1

I want read a google map url, convert the map to jpg & return the jpg map.

I suppose to have two markers in my map. however each time the map return to me only contains the first marker. Is there some characters that cannot be used thats why my url is cut short?

i.e.

<?php
$url = "http://maps.google.com/maps/api/staticmap?center=1.2993485,103.7875769&zoom=14&size=558x908&sensor=false&markers=color:blue|size:small|1.2993485,103.7875769&markers=color:blue|size:small|1.3050607723691974, 103.78171026706696";

$img = ImageCreateFromPng($url);

if($img) {
  header("Content-Type: image/jpeg");
  Imagejpeg($img);
  ImageDestroy($img);
} 
?>
Dayzza
  • 1,561
  • 7
  • 18
  • 29

1 Answers1

1

I am guessing that the space between 1.3050607723691974, 103.78171026706696 is not being properly escaped (and that it's probably a mistake).

When you cut and paste the URL in your browser the space is probably being escaped with %20, which "corrects" the error.

GWW
  • 43,129
  • 11
  • 115
  • 108