Create a symbol from a image in php mapsrcript

183 views Asked by At

I need to make a image symbol in code and mapscript. How should I do that?

desired output:

enter image description here

1

There are 1 answers

0
MSS On

I succeed :

$oSymbol = new symbolObj($map, "imtest");
$oSymbol->set("type", MS_SYMBOL_PIXMAP);
$oSymbol->setImagePath('symbols/images/star-symbol.png');
$oSymbol->set("filled", MS_TRUE);
$oSymbol->set("sizex", 1);
$oSymbol->set("sizey", 1);
$oSymbol->set("inmapfile", MS_TRUE);



//$style->set("symbolname", "mydash");

/*
 * @ create CLASS for LAYER
 */
$class = new ClassObj($layer);

if ($type_feature == 'polygon') {
    //die('polygon');
    $symbol = 'mapinfo-sym-41';


    $symbol_style_opacity = 100;
    $symbol_style_color = array(0, 0, 255);
    $class->updateFromString("
    CLASS
        STYLE
            SYMBOL 'imtest'
            COLOR 0 0 255
            ANGLE 30
            SIZE 10
            WIDTH 1
            OPACITY 100
        END
    END
");
}