[mapserver-users] PHP Mapscript styleObj implementation broken?

Nicol Hermann mapserver at geoworld.de
Fri Jan 25 10:36:35 PST 2019


Hello Seth,

you are right. I am using PHP MapScript rather than then SWIG bindings.

Actually the question where the setPattern method belongs to was my
first question to the dev List.
http://osgeo-org.1560.x6.nabble.com/setPattern-in-symbolObj-in-PHP-MapScript-td5389111.html

As it is at least somehow working in conjunction with the styleObj it
believe it belongs to this object.
The examples in the Cartographical Symbol page also refers to the
styleObj.
https://mapserver.org/mapfile/symbology/construction.html 


Thanks
Nicol



Am Freitag, den 25.01.2019, 19:18 +0100 schrieb Seth G:
> Hi Nicol,
> 
> Not sure if this helps but in the Python MapScript bindings the API
> changed at some point, and now uses:
> 
> symbol.pattern = [0, 1]
> 
> https://github.com/mapserver/mapserver/blob/418e15cda5109e3a47c6691567e3e3e62e964187/mapscript/python/tests/cases/symbol_test.py#L135
> 
> This however is specific to Python:
> 
> https://github.com/mapserver/mapserver/blob/418e15cda5109e3a47c6691567e3e3e62e964187/mapscript/python/pyextend.i#L231
> 
> I'm guessing you are using PHP MapScript rather than the new SWIG
> generated SWIG MapScript bindings?
> 
> 
> Seth
> 
> --
> web:http://geographika.co.uk
> twitter: @geographika
> 
> On Fri, Jan 25, 2019, at 6:17 PM, Nicol Hermann wrote:
> > Hello,
> > 
> > after looking closer into the source code I was able to resolve the
> > issue of setting the 'linecap' property. The property expects
> > constants. It works if you are specifying one of them:
> > 
> > MS_CJC_NONE (0)
> > MS_CJC_BEVEL (1)
> > MS_CJC_BUTT  (2)
> > MS_CJC_MITER (3)
> > MS_CJC_ROUND (4)
> > MS_CJC_SQUARE (5)
> > MS_CJC_TRIANGLE (6)
> > MS_CJC_DEFAULT_JOIN_MAXSIZE
> > 
> > However I am still not able to figure out what's going on with the
> > setPattern() method.
> > 
> > Any hints are greatly appreciated.
> > 
> > Thanks
> > Nicol
> > 
> > 
> > Am Donnerstag, den 24.01.2019, 19:21 +0100 schrieb Nicol Hermann:
> > > Hello,
> > > 
> > > I have huge difficulties to use the styleObj in PHP MapScript
> > > (Mapserver 7.3-dev, PHP 7.1).
> > > I am struggling with the setPattern() method and the linecap
> > > property.
> > > If I am using
> > > $styleObj-> setPattern( array( 8.0, 12.0) );
> > > this gets translated to the following MapFile syntax
> > > 
> > > PATTERN
> > >  4620693217682128896.00 4622945017495814144.00
> > > END 
> > > 
> > > The attempt to set the linecap property
> > > $styleObj-> set('linecap', 'butt' );
> > > results in
> > > LINECAP NONE
> > > Specifying it as integer completely removes the property.
> > > 
> > > Can someone please advice if these are bugs or if I am doing
> > > something
> > > wrong as this is not documented?
> > > 
> > > Thank you very much
> > > Nicol
> > > 
> > > _______________________________________________
> > > mapserver-users mailing list
> > > mapserver-users at lists.osgeo.org
> > > https://lists.osgeo.org/mailman/listinfo/mapserver-users
> > 
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list