<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
</head>
<body bgcolor="#ffffff" text="#000000">
Hy all<br>
<br>
Can someone help me with this?<br>
<br>
$layer = $map->getLayerByName('sde1','sde2','sde3','sde4');<br>
<br>
// xy pix -> geo pt<br>
<br>
$xPixel = $_REQUEST['x'];<br>
$yPixel = $_REQUEST['y'];<br>
<br>
$xGeo = $_SESSION['GEOEXT']['minx'] + (($xPixel/$_SESSION['mapwidth'])
* ($_SESSION['GEOEXT']['minx']-$_SESSION['GEOEXT']['maxx']));<br>
$yGeo = $_SESSION['GEOEXT']['maxy'] - (($yPixel/$_SESSION['mapheight'])
* ($_SESSION['GEOEXT']['maxy']-$_SESSION['GEOEXT']['miny']));<br>
<br>
$pt = ms_newPointObj();<br>
$pt->setXY($xGeo, $yGeo);<br>
<br>
// proj<br>
$mapProjStr = $map->getProjection();<br>
$layerProjStr = $layer->getProjection();<br>
if ($mapProjStr && $layerProjStr && $mapProjStr !=
$layerProjStr) {<br>
$mapProjObj = ms_newprojectionobj($mapProjStr);<br>
$layerProjObj = ms_newprojectionobj($layerProjStr);<br>
$pt->project($mapProjObj, $layerProjObj);<br>
}<br>
<br>
// set map extent and size:<br>
$map->setExtent($_SESSION['GEOEXT']['minx'],
$_SESSION['GEOEXT']['miny'], $_SESSION['GEOEXT']['maxx'],
$_SESSION['GEOEXT']['maxy']);<br>
$map->setSize($_SESSION['mapwidth'], $_SESSION['mapheight']);<br>
<br>
$map->preparequery();<br>
<br>
// Use '@' to avoid warning if query found nothing<br>
@$layer->queryByPoint($pt, MS_SINGLE, -1);<br>
$pt->free();<br>
<br>
if ($layer->getNumResults() == 1) {<br>
$res = $layer->getResult(0);<br>
$layer->open();<br>
$shape = $layer->getFeature($res->shapeindex,
$res->tileindex);<br>
<b> $id = $shape->ID;</b><br>
<br>
$layer->close();<br>
}<br>
<br>
This code gets the x and y coordinates of the clicking ($xPixel =
$_REQUEST['x']) I have transformed it to Geo coords, and so on, and in
the end i want to search for my clicked shape's ID<br>
<br>
Am i right that the $id variable is contaning the ID value of the
clicked shape? i have bolded the line i talking about.. (The shape
file have an attribute table and mine have a ID column)<br>
<br>
Please if someone can help , do it:P<br>
<br>
thanks,<br>
Zsolt<br>
<br>
<br>
<br>
</body>
</html>