[Mapserver-users] Solved - Troubles w/ Dynamic Symbols in PHP/Mapscript
Dan Barron
dbarron at ddive.com
Wed Aug 13 18:50:55 PDT 2003
--=====================_14017031==.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed
Hello,
Disregard previous question, I had a small error in the way I was querying
my database. For the record the following works to change the symbol
dynamically.
Dan
>>>Map File<<<
symbolset "./symbols/symbols.list"
...
LAYER
name 'mylayer'
type POINT
class
name 'symbol'
style
symbol 'symbol_1'
end
end
END
>>>symbols.list<<<
SYMBOL
name'symbol_1'
type PIXMAP
image '..\graphics\symbol_1.gif'
END
SYMBOL
name'symbol_2'
type PIXMAP
image '..\graphics\symbol_2.gif'
END
>>>PHP Mapscript<<<
$layer = $map->getLayerByName('myLayer');
$symbolClass = $layer->getClass(0);
$symbolStyle = $symbolClass->getStyle(0);
$symbolStyle->set('symbol', 1);
--=====================_14017031==.ALT
Content-Type: text/html; charset="us-ascii"
<html>
<body>
Hello,<br><br>
Disregard previous question, I had a small error in the way I was
querying my database. For the record the following works to change
the symbol dynamically.<br><br>
Dan<br><br>
<br><br>
<tt>>>>Map File<<<<br><br>
symbolset "./symbols/symbols.list"<br><br>
...<br><br>
LAYER<br>
name 'mylayer'<br>
type POINT<br>
class<br>
name 'symbol'<br>
style<br>
symbol 'symbol_1'<br>
end<br>
end<br>
END<br><br>
<br>
>>>symbols.list<<<<br><br>
SYMBOL<br>
name'symbol_1'<br>
type PIXMAP<br>
image '..\graphics\symbol_1.gif'<br>
END<br><br>
SYMBOL<br>
name'symbol_2'<br>
type PIXMAP<br>
image '..\graphics\symbol_2.gif'<br>
END<br><br>
>>>PHP Mapscript<<<<br><br>
$layer = $map->getLayerByName('myLayer');<br>
$symbolClass = $layer->getClass(0);<br>
$symbolStyle = $symbolClass->getStyle(0);<br>
$symbolStyle->set('symbol', 1);<br>
</body>
</html>
--=====================_14017031==.ALT--
More information about the MapServer-users
mailing list