|
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; } } |
- [UMN_MAPSERVER-USERS] MapScript C# QueryByPoint Christopher Condit
- Re: [UMN_MAPSERVER-USERS] MapScript C# QueryByPoin... Christopher Condit
