<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Hi Vladimir,<br></div><div><br></div><div>Could you try the following syntax?<br></div><div><br></div><pre><span class="n">new_style</span> <span class="o">=</span> <span class="n">new</span> <span class="n">mapscript.styleObj</span><span class="p">()
</span><span class="n">new_style</span>.symbolname = 'circle'
<span class="p"></span><span class="n">new_style</span>.size = 10
<span class="n">the_class</span><span class="o">.</span><span class="n">insertStyle</span><span class="p">(</span><span class="n">new_style</span><span class="p">)

</span><br></pre><div>Also make sure your variables aren't overriding the class names - e.g. maybe use different variable names than classObj. <br></div><div><br></div><div>Regards,<br></div><div><br></div><div>Seth<br></div><div><br></div><div id="sig62266145"><div class="signature">--<br></div><div class="signature">web:http://geographika.co.uk<br></div><div class="signature">twitter: @geographika<br></div></div><div><br></div><div><br></div><div>On Fri, Nov 15, 2019, at 6:12 PM, Vladimir wrote:<br></div><blockquote type="cite" id="qt"><div><div>Hi all!<br></div><div> <br></div><div>I unsuccessfully try to style ‘Point’ layer with following code:<br></div><div>(first)<br></div><div><div>    style = mapscript.styleObj(classObj)<br></div><div>     style.symbolname = 'circle'<br></div><div>     style.size = 10<br></div><div>     style.color = mapscript.colorObj(255, 0, 0)<br></div></div><div> <br></div><div>No error, no picture as result of using this method.<br></div><div>But similar approach works for ‘Line’ and ‘Polygon’ layers.<br></div><div> <br></div><div><div>Also I figured out working method for the ‘Point’ layer:<br></div><div>(second)<br></div><div style="background-color:rgb(255, 255, 255);color:rgb(0, 0, 0);font-family:"Droid Sans Mono", "monospace", monospace, "Droid Sans Fallback";font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"><div>classObj.updateFromString("CLASS STYLE COLOR 255 0 0 SIZE 10  SYMBOL 'circle' END END")<br></div></div><div> <br></div><div>O<span style="color:rgb(0, 0, 0)" class="colour">utput of ‘layer.convertToString()’ is the same </span>for both methods<span style="color:rgb(0, 0, 0)" class="colour">:</span><br></div></div><div><div style="background-color:rgb(255, 255, 255);color:rgb(0, 0, 0);font-family:"Droid Sans Mono", "monospace", monospace, "Droid Sans Fallback";font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"><div><div>LAYER<br></div><div>     CONNECTION \"dbname='db' host='db' user='user' password='1'\"<br></div><div>     CONNECTIONTYPE POSTGIS  <br></div><div>     DATA \"value FROM (SELECT value FROM points WHERE ST_Intersects(value, !BOX!)) AS subquery USING UNIQUE id USING srid = 3857\"<br></div><div>     LABELITEM \"name\"<br></div><div>     NAME \"points\"<br></div><div>     STATUS ON<br></div><div>     TYPE POINT<br></div><div>     UNITS METERS<br></div><div>     CLASS<br></div><div>         NAME \"points\"<br></div><div>         STYLE     <br></div><div>             COLOR 255 0 0<br></div><div>             SIZE 10     <br></div><div>             SYMBOL \"circle\"<br></div><div>         END # STYLE<br></div><div>     END # CLASS<br></div><div> END # LAYER<br></div></div><div> <br></div><div>How to get working ‘Point’ style using first method?<br></div><div>MapServer version: 7.2.1<br></div><div> <br></div><div>Thanks!<br></div></div></div><div><div><p><br></p><div>--<br></div><div> Regards, Vladimir.<br></div><p><br></p><p> <br></p></div></div></div><div>_______________________________________________<br></div><div>mapserver-users mailing list<br></div><div>mapserver-users@lists.osgeo.org<br></div><div>https://lists.osgeo.org/mailman/listinfo/mapserver-users<br></div></blockquote><div><br></div></body></html>