[Date Prev][Date Next] [Chronological] [Thread] [Top]

[mapserver-users] queryUsingPoint seg fault on demo maps



I get a segfault when try to do a queryUsingPoint...I am testing with the demo maps....My map browsing works like zooming and panning, but now I want to query the map data when I click on an area, and return data from the attribute data. Like the area of the lake and miles and stuff.
 
 
I get a segfault, and the rest of the script doesnt run....
also, I renamed the demo.map file to romney.map
 
if ( $map_x && $map_y ) {
 $mapObj = ms_newMapObj("/home/htdocs/maptest/romney.map");  
 $ptClicked = ms_newPointObj();
 $ptClicked->setXY($x,$y);
 $layerObj = $mapObj->getLayerByName("lakes");
 $queryObj = $layerObj->queryUsingPoint( $ptClicked,MS_MULTIPLE,3 );
 
 print  "click X Y:" . $map_x . " x " . $map_y . "<br>\n";
 print "mapObj->name:" .  $mapObj->name . "<br>\n";
 print "mapObj->numlayers:" . $mapObj->numlayers . "<br>\n";
 print "layerObj->numqueries:" . $layerObj->numqueries . "<br>\n";
 print "layerObj->other:" . $layerObj->queryitem . "<br>\n";
 print "queryObj->numresults:" . $queryObj->numresults . "<br>\n";
}
 
the layer definition in the map file...
 
 
LAYER
  NAME lakes
  TYPE POLYGON
  STATUS ON
  DATA lakespy2
 
  CLASS
    NAME 'Lakes & Rivers'
    COLOR 49 117 185
  END
 
  HEADER "demo/lakespy2_header.html"
  FOOTER "demo/lakespy2_footer.html"
 
  QUERY
    TEMPLATE "demo/lakespy2.html"
  END
  TOLERANCE 3
END # lakes