PHP Highlight list of Parcels Passed In

Abe Gillespie agillesp at VT.EDU
Sat Jan 22 20:01:22 EST 2005


If you go to:
http://mapserver.gis.umn.edu/doc44/mapfile-reference.html

And either search the page (if you don't know where to look) or click
on the Map Object link you'll see that QUERYMAP is a child of MAP.  So
what you need is something like:

MAP
  ...
  QUERYMAP
   COLOR 255 0 0
   STYLE hilite
  END

  LAYER
   NAME "selected_parcels"
   ...
  END
END

-Abe

On Jan 22, 2005, at 7:12 PM, Steve Lehr wrote:

> Abe I've never used the QUERY MAP before, I tried putting it in the
> layer
> and it did not like that?
>
> My initial layer looks like:
>
> I changed my code to pass Pipe delimited.
>
> But I'm not quite certian I'm still getting what I need to do to my
> .map.
>
> Thanks for the help..below is the layer repeated my EXPRESSION is
> trashed I
> realize.
>
>>   LAYER
>>     NAME "selected_parcels"
>>     DATA parcels
>>     STATUS DEFAULT
>>     TYPE POLYGON
>>     CLASSITEM QPID
>>     CLASS
>>       EXPRESSION "/%parcels%/"
>>       COLOR 255 0 0
>>     END
>>   END
>
>
> Steven Lehr
> Assistant Professor
> Freshmen Program
> College of Engineering
> Embry-Riddle Aeronautical University (LB159)
> 600 S. Clyde Morris Blvd.
> Daytona Beach, FL 32114-3900
> 386-226-7740
>
> -----Original Message-----
> From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]On
> Behalf Of Abe Gillespie
> Sent: Saturday, January 22, 2005 7:05 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-USERS] PHP Highlight list of Parcels Passed
> In
>
>
> For the red you need to setup the QUERYMAP.  For the PHP it will be
> something like this:
>
> $target = use_appropriate_string_func_to_conver_semi_to_pipe($parcels);
> // $target should look like "1|2|3|4" ... where the numbers are the
> IDs.
> $layer = $map->getLayerByName("parcels");
> $layer->queryByAttributes("parcel_id_field", "/".$target."/",
> MS_MULTIPLE);
>
> Also, don't forget to add the TEMPLATE "x" tag in your LAYER
> definition.
>
> I'm not a RegEx expert, so someone please put me in check if I'm
> leading Steven astray.
>
> -Abe
>
> On Jan 22, 2005, at 6:37 PM, Steve Lehr wrote:
>
>> I'm trying to write some PHP that I can send extents and list of
>> parcels to
>> get it to highlight the parcels.
>>
>> I'd like to highlight all the found parcels in RED.
>>
>> My php gets a variable by post called parcels and contains at this
>> time a
>> semi colon delimited list of ids in the attribute column QPID of the
>> parcels.dbf.
>>
>>   LAYER
>>     NAME "selected_parcels"
>>     DATA parcels
>>     STATUS DEFAULT
>>     TYPE POLYGON
>>     CLASSITEM QPID
>>     CLASS
>>       EXPRESSION "/%parcels%/"
>>       COLOR 255 0 0
>>     END
>>   END
>>
>>
>> I've got my extents.  I've got the list of parcels.  Now I want to
>> highlight
>> the list of parcels with something like the below.  But I have to do
>> something in php to take that ; delimited list and the turn on all the
>> matching attributes.  (I belive its a QUERYMAP with MULTIPLE_SELECT)
>> but I'm
>> having trouble getting my brain around what I need to code - might
>> someone
>> have a sample.
>>
>> Thanks
>>
>> Steven Lehr
>> Assistant Professor
>> Freshmen Program
>> College of Engineering
>> Embry-Riddle Aeronautical University (LB159)
>> 600 S. Clyde Morris Blvd.
>> Daytona Beach, FL 32114-3900
>> 386-226-7740
>>
>



More information about the mapserver-users mailing list