MapServer / MapServer-import

3 stars 2 forks source link

Adding to an expression with PHP ( help! ) #1640

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: calmeida@orchidsuites.net Date: 2006/02/03 - 22:35

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
tbonfort commented 12 years ago

Author: assefa Date: 2006/02/04 - 15:17


*** This bug has been marked as a duplicate of 1641 ***