|
Actually after further testing it looks as
though this only happens with my raster layers. My vector layers all
query just fine. Is there anything else I need to do for a
raster layer (ArcInfo Coverage) to allow queries to work? I’ve got
the template defined in the map file. Thanks, Chris From: UMN MapServer Users
List [mailto:[EMAIL PROTECTED] On
Behalf Of Christopher Condit I have a question about QueryByPoint in C# MapScript.
I’ve subclassed the layerObj and want to run QueryByPoint from this
object. getNumResults always returns 0, however. I have a template
defined for the layer – and results are returned from the mapserver CGI. Is there some special way to run a query from inside a
layerObj (or subclass)? Thanks, Chris public class elevationLayer : layerObj {
public
elevationLayer(mapObj map) : base(map)
{
name = "Elevation";
type = MS_LAYER_TYPE.MS_LAYER_RASTER;
data =
""
}
public string QueryLayer(double x, double y)
{
string
ret = null;
int res =
queryByPoint(map, new
pointObj(x, y, 0, 0), mapscript.MS_SINGLE, 0.25 );
ret = "<b>Depth: </b>";
if (0 == getNumResults())
ret += "Unknown";
else
{
open();
resultCacheMemberObj result =
getResult(0);
if
(null != result)
{
shapeObj
shape = getFeature(result.shapeindex, result.tileindex);
ret += int.Parse(shape.getValue(2))
* -1 + " m.<br
/>";
}
close();
}
return
ret;
} } |
