[mapserver-users] Questions about PHP Mapscript and Queries

Hankley, Chip Chip.Hankley at GASAI.Com
Tue Jul 30 08:11:51 PDT 2002


Frank...

I guess I was trying to logically "weed out" where the problem might lie.
Your check in AV pretty much rules out a problem with the conversion from
pixel to geo. I'd go back to your original function, and look at something
else.

The next place I'd look is your mapfile, and the syntax around your
queryByPoint.

Mine looks something like this:

    @$map->queryByPoint($click_pt, MS_MULTIPLE, -1);
    $Layer = $map->GetLayerByName($lyr);
    $count_results = $Layer->getNumResults();

    //$lyr would be the NAME specified in the mapfile.

The layer definition for a layer I was querying would look like this:

Layer
  NAME FIBEROPTIC <-- THIS is the name you specify above
  Type Line
  STATUS ON
  MAXSCALE 15000
  TOLERANCE 10
  TOLERANCEUNITS feet
  DATA "fiber_new"
  METADATA <-- THE 'METADATA' section is crucial if you want to retrieve
some data
    "DESCRIPTION"   "FIBER_INFO"
    "RESULT_FIELDS" "ID MH1 MH2 HYPERLINK"
  END
  CLASSITEM 'ID'
    CLASS
      NAME 'selected'
      TEMPLATE "ttt_query.html" <-- THIS line is critical
      EXPRESSION ' '
      SYMBOL 'solid_line'
      SIZE 2
      COLOR 255 0 0
    END
    CLASS
      NAME 'existing'
      TEMPLATE "ttt_query.html" <-- THIS line is critical
      EXPRESSION /./
      SYMBOL 'solid_line'
      SIZE 2
      COLOR 0 255 0
    END
END



More information about the MapServer-users mailing list