sg

Perşembe, Kasım 24, 2005

Re: Automatic Tile Cutter - HELP!


(reposted from another thread, hopefully in a better spot).

I am trying to get a custom map up, but I am going nuts with something,
perhaps you guys (who seem to have it down) might know what is up.

I am just using the basic scripts copied from the two tutorial pages on
MapKi
(which I am guessing you are the maintainer of). Everything seems to
go fine with the exception of the image serving .PHP script. It simply
returns garbage, or rather, a text output of a binary image.

Here is an example:
http://www.hikershangout.com/google/images/index.php?x=856&y=1542&zoom=5

If you go there you should get the garbage on the screen, instead of
the .gif file. Is this because the server is not handling .gif files
properly?

Here is the php script
-------------------------------------
<?php
define("NO_DATA", "./no_data.gif");
define("ZOOM_IN", "./zoom_in.gif");
define("ZOOM_OUT", "./zoom_out.gif");

$x = $_GET["x"];
$y = $_GET["y"];
$z = $_GET["zoom"];

$filename = "./Zoom5Maps/${x}_${y}_${z}.gif";

if ( $z < 2 ) {
$content = file_get_contents( ZOOM_OUT );
}else if ( $z > 5 ){
$content = file_get_contents( ZOOM_IN );
}else if (is_numeric($x) && is_numeric($y) && is_numeric($z)
&& file_exists($filename)){
$content = file_get_contents( $filename );
}else{
$content = file_get_contents( NO_DATA );
}

header("Content-type: image/gif");

echo $content;
?>
------------------------------------------

Any thoughts as to where I might go from here? Main page using this is
at:
http://www.hikershangout.com/google/cust_map.html

Many thanks!

Brian

0 Comments:

Yorum Gönder

<< Home


Komik Videolar   islam  şarkı sözleri  yemek tarifleri  gelibolu  huzur   sağlık