[mapserver-commits] r12746 - in branches/branch-6-0/docs/en/mapscript: . php

svn at osgeo.org svn at osgeo.org
Thu Nov 3 10:13:01 EDT 2011


Author: aboudreault
Date: 2011-11-03 07:13:01 -0700 (Thu, 03 Nov 2011)
New Revision: 12746

Modified:
   branches/branch-6-0/docs/en/mapscript/mapscript.txt
   branches/branch-6-0/docs/en/mapscript/php/index.txt
Log:
Backport 6.0: Doc update for label styles (#4038)

Modified: branches/branch-6-0/docs/en/mapscript/mapscript.txt
===================================================================
--- branches/branch-6-0/docs/en/mapscript/mapscript.txt	2011-11-03 14:07:00 UTC (rev 12745)
+++ branches/branch-6-0/docs/en/mapscript/mapscript.txt	2011-11-03 14:13:01 UTC (rev 12746)
@@ -781,6 +781,9 @@
 minsize : int
     Minimum height in pixels.
 
+numstyles : int
+    Number of label styles
+
 offsetx : int
     Horizontal offset of label.
 
@@ -824,6 +827,24 @@
     Get the attribute binding for a specified label property. Returns
     NULL if there is no binding for this property.
 
+getStyle( int index ) : styleObj_
+    Return a reference to the styleObj at *index* in the styles array.
+
+insertStyle( styleObj_ style [, int index=-1 ] ) : int
+    Insert a **copy** of *style* into the styles array at index *index*.
+    Default is -1, or the end of the array.  Returns the index at which the 
+    style was inserted.
+
+moveStyleDown( int index ) : int
+    Swap the styleObj at *index* with the styleObj *index* + 1.
+    
+moveStyleUp( int index ) : int
+    Swap the styleObj at *index* with the styleObj *index* - 1.
+
+removeStyle( int index ) : styleObj_
+    Remove the styleObj at *index* from the styles array and return a
+    copy.
+
 removeBinding( int binding ) : int
     Remove the attribute binding for a specfiled label property.  
 

Modified: branches/branch-6-0/docs/en/mapscript/php/index.txt
===================================================================
--- branches/branch-6-0/docs/en/mapscript/php/index.txt	2011-11-03 14:07:00 UTC (rev 12745)
+++ branches/branch-6-0/docs/en/mapscript/php/index.txt	2011-11-03 14:13:01 UTC (rev 12746)
@@ -273,23 +273,6 @@
    Delete the style specified by the style index. If there are any
    style that follow the deleted style, their index will decrease by 1.
 
-   .. note::
-      if you are using the numstyles parameter while using the 
-      deletestyle function on the class object you need to refetch 
-      a new class object. 
-    
-      Example :
-    
-      .. code-block:: php
-          
-         //class has 2 styles
-         $class = $oLayer->getclass(0);
-         $class->deletestyle(1);
-         echo $class->numstyles; : will echo 2
-
-         $class = $oLayer->getclass(0);
-         echo $class->numstyles; : will echo 1 
-
 int drawLegendIcon(int width, int height, imageObj im, int dstX, int dstY)
     Draw the legend icon on im object at dstX, dstY.
     Returns MS_SUCCESS/MS_FAILURE.
@@ -710,6 +693,7 @@
 int             minfeaturesize
 int             minlength
 int             minsize
+int             numstyles
 int             offsetx
 int             offsety
 colorObj        outlinecolor
@@ -729,6 +713,10 @@
 Methods
 ...............................................................................
 
+int deleteStyle(int index)
+   Delete the style specified by the style index. If there are any
+   style that follow the deleted style, their index will decrease by 1.
+
 string getBinding(const labelbinding)
     Get the attribute binding for a specified label property. Returns
     NULL if there is no binding for this property.
@@ -740,11 +728,29 @@
         $oLabel->setbinding(MS_LABEL_BINDING_COLOR, "FIELD_NAME_COLOR");
         echo $oLabel->getbinding(MS_LABEL_BINDING_COLOR); // FIELD_NAME_COLOR
 
+styleObj getStyle(int index)
+    Return the style object using an index. index >= 0 &&
+    index < label->numstyles.
+
 void free()
     Free the object properties and break the internal references. 
     Note that you have to unset the php variable to free totally the
     resources.
 
+int moveStyleDown(int index)
+    The style specified by the style index will be moved down into
+    the array of classes. Returns MS_SUCCESS or MS_FAILURE.
+    ex label->movestyledown(0) will have the effect of moving style 0
+    up to position 1, and the style at position 1 will be moved
+    to position 0.
+
+int moveStyleUp(int index)
+    The style specified by the style index will be moved up into
+    the array of classes. Returns MS_SUCCESS or MS_FAILURE.
+    ex label->movestyleup(1) will have the effect of moving style 1
+    up to position 0, and the style at position 0 will be moved
+    to position 1.
+
 int removeBinding(const labelbinding)
     Remove the attribute binding for a specfiled style property.  
     
@@ -2466,13 +2472,15 @@
 Constructor
 ...............................................................................
 
-Instances of styleObj are always embedded inside the `classObj`_.
+Instances of styleObj are always embedded inside a `classObj`_ or `labelObj`_.
 
 .. code-block:: php
 
    new styleObj(classObj class [, styleObj style])
+   // or
+   new styleObj(labelObj label [, styleObj style])
 
-or using the old constructor
+or using the old constructor (do not support a labelObj at first argument)
 
 .. code-block:: php
     



More information about the mapserver-commits mailing list