failing getting map's coords.
temiz
temiz at DEPREM.GOV.TR
Wed Sep 1 23:53:49 PDT 2004
sorry in advance for my asking the long code
but I am rying for a while but it fails. I just adapted the code
which resides in wiki's site to my purpose.
~~~~~~~~~~~~~~~~~~~~~~~~~~~
<?php
if (!extension_loaded('php_mapscript.so')) {
if (!dl('php_mapscript.so')) {
exit;
}
}
function click2map ($click_x, $click_y) {
global $map;
$e= &$map->extent; //for saving writing
$x_pct = ($click_x / $map->width);
$y_pct = 1 - ($click_y / $map->height);
$x_map = $e->minx + ( ($e->maxx - $e->minx) * $x_pct);
$x_map2=$_GET['$x_map'] ;
$y_map = $e->miny + ( ($e->maxy - $e->miny) * $y_pct);
return array($x_map, $y_map);
}
$map_file="./kara.map";
$map = ms_newMapObj($map_file);
$jeolayer = $map->getLayerByName("jeo");
$jeoClass0 = $jeolayer->getClass(9);
$jeoStyle = $jeoClass0->getStyle("*");
$jeoStyle->color->setRGB(0,255,0);
$map_pt = click2map($_GET['image_x'],$_GET['image_y'],$map->extent);
//Create the point
$pt = ms_newPointObj();
$pt-> setXY($map_pt[0],$map_pt[1]);
$img = $map->draw();
$layer = $map->getLayerByName('fay');
$url = $img->saveWebImage();
?>
<HTML>
<HEAD>
<TITLE>Example 1: Displaying a map</TITLE>
</HEAD>
<BODY>
<form method="get" action="query2.php" >
<input style="border:thin solid black;" type="image"
name="image" src="<?php echo $url?>" >
</form>
</BODY>
</HTML>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
query2 .php:
-------------
<?
print_r($_GET);
print_r($x_map);
print_r($x_map2);
echo $HTTP_GET_VARS['dene'];
?>
--------------------
I only get image's coordinates. But I could get nothing about map's
coordinates
and any variable from 1st php file during running of query2 .php.
Are there anyone having any idea ?
kind regards
Ahmet Temiz
TURKEY
______________________________________
Inflex - installed on mailserver for domain @deprem.gov.tr
Queries to: postmaster at deprem.gov.tr
______________________________________
The views and opinions expressed in this e-mail message are the sender's own
and do not necessarily represent the views and the opinions of Earthquake Research Dept.
of General Directorate of Disaster Affairs.
Bu e-postadaki fikir ve gorusler gonderenin sahsina ait olup, yasal olarak T.C.
B.I.B. Afet Isleri Gn.Mud. Deprem Arastirma Dairesi'ni baglayici nitelikte degildir.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20040902/f3172655/attachment.htm>
More information about the MapServer-users
mailing list