Hi b255ccc,
First of all, thanks for your reply.I am posting the method that worked for some in brief here to carry this discussion with other people in the forums to help me get it out. Hope you too would find this informative when somebody really makes out how it could be done for this issue..
I have modified the body onload script initMap with the script in mapki. I am pasting the code as below..
-----------------------initmap script ------
map = new GMap(document.getElementById("map"));
//copy object function
function copy_obj(o){
var c = new Object();
for (var e in o)
{
c[e] = c [o];
}
return c;
}
//copy mapType
hbMapType = copy_obj(map.mapTypes[0];
//setting path to our map type
hbMapType.baseUrls = new Array();
hbMapType.baseUrls[0] = "http://tech2sol.com/scvmap/index.php? ";
hbMapType.lowResBaseUrls = new Array();
hbMapType.lowResBaseUrls[0] = " http://tech2sol.com/scvmap/index.php?";
hbMapType.getLinkText = function () {
return 'APPELATIONS';
}
map.mapTypes[map.mapTypes.Length] = hbMapType;
map.setMapType(map.MapTypes[map.mapTypes.length-1]);
map.addControl(new GMapTypeControl());
map.addControl(new GSmallZoomControl());
----------------------
index.php in scvmap folder
------------------------<?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 = "./maptiles/${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;
//get header send by the client.
$headers = emu_getallheaders();
// Checking if the client is validating his cache and if it is the current.
if(isset($headers['If-Modified-Since']) && (strtotime($headers['If-Modified-Since']) == filemtime ($filename))){
header('Last-Modified: '.gmdate('D, d m Y H:i:s', filemtime($filename)).' GMT', true,304);
} else {
//Winery maps not cached or cache outdated, we respond '200 OK' and output the image.
header('Last-Modified: 'gmdate('D, d m Y H:i:s', filemtime($filename)).' GMT', true, 200);
echo ($content);
}
function emu_getallheaders(){
foreach($_SERVER AS $h=>$v)
if(ereg('HTTP_(.+)',$h, $hp))
$headers[$hp[1]]=$v;
return headers;
}
?>
------------------------
I have a map image say australia.gif and australia.jpg.
My simple need is that i should be able to load this map instead of other maps. I used the automatic tile cutter and it gave me at zoom level 5 images like 1204_1204_5.gif. I am still now able to make out how this action of reloading is done though i understand the scripts. I read that 1204,1204,5 is send by google API on user click or event. But what i want now is a australia.gif as default laod image and pan and zoom feature. I am not able to do this simple enhancement as told in your threads nor in mapki...
What am i doin wrong? what should i correct? I request your help very sincerely and thanking you in advance for the request.Is the path in the index.php scvmap folder need to be corrected or i should note of anything here extra...
I know this is done by a few and only myself seems stuck with this.
regards
Harish