Hi, Using MapScript PHP API, I want to create a label object (using tostring expression) and put 2 columns with a linebreak between them. The example above is working well on a single line, but I don’t know how to make the linebreak (carriage return).
$text = "(tostring([vol],'%.2f')+'[vol]')"; $classObj = new classObj($layer); $classObj->setText($text); $classObj->addLabel(CreateNewLabel($labelProperties)); I've tried multiple combination of \r\n but none of them work (map rendering work, but the label completely disappear). $text = "(tostring([vol],'%.2f') + '\r\n[vol]')"; $text = "(tostring([vol],'%.2f') + '\r\n' + '[vol]')"; If I don’t use the expression, the line break work $text = "'[vol]\r\n[vol]'"; By the way, the TEXT property is on the classObj, the setText method doesn’t work on the labelObj. With best regards, MapServer 7.4.4 (under ubuntu 16.04) PHP 5.6.40 Jean-Philippe
_______________________________________________ mapserver-users mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/mapserver-users
