Opened 18 years ago

Closed 18 years ago

#1640 closed defect (duplicate)

Adding to an expression with PHP ( help! )

Reported by: calmeida@… Owned by: mapserverbugs
Priority: high Milestone:
Component: MapScript-PHP Version: unspecified
Severity: normal Keywords:
Cc:

Description

I've been trying to use this USA/States map that have predefined classes for 
every color that you would want to make each state/county.

Snip:

    LAYER
        NAME "co"
        TYPE POLYGON
        STATUS OFF
        DATA         co99_d00
        LABELITEM "NAME"

        PROJECTION
            "proj=latlong"
            "ellps=GRS80"
            "datum=NAD83"
        END
        CLASS
            NAME "Aqua counties"
            EXPRESSION ([STATE]=56 AND %aquaexpr%)
            COLOR 0 255 255
            OUTLINECOLOR 99 101 99
        END

I've used the mapserv cgi to get what I want, but I really need to get the PHP 
version working. The syntax for aquaexpr is [COUNTY]=34 <-- state fips number.

I've gotten this far:

$map = ms_newMapObj($map_path."state-wy.map");
$outLayer = $map->getlayerbyname("co");
$outLayer->set("status", 1);

    $oClass = $outLayer->getClass(0);
    $oClass->set("aquaexpr","[COUNTY]=15");  // Does not work.


$image=$map->draw();
$image_url=$image->saveWebImage();

Please give me some advice as to how I should either reset the expression or 
set that %aquaexpr% var.

Thanks!

- Chris

Change History (1)

comment:1 by assefa, 18 years ago

Resolution: duplicate
Status: newclosed

*** This bug has been marked as a duplicate of 1641 ***
Note: See TracTickets for help on using tickets.