[mapserver-commits] r7142 - trunk/mapserver/mapscript/php3

svn at osgeo.org svn at osgeo.org
Mon Dec 3 18:42:19 EST 2007


Author: Assefa
Date: 2007-12-03 18:42:19 -0500 (Mon, 03 Dec 2007)
New Revision: 7142

Modified:
   trunk/mapserver/mapscript/php3/README
   trunk/mapserver/mapscript/php3/php_mapscript.c
Log:
Add true type symbol parameters #2418

Modified: trunk/mapserver/mapscript/php3/README
===================================================================
--- trunk/mapserver/mapscript/php3/README	2007-12-03 16:32:34 UTC (rev 7141)
+++ trunk/mapserver/mapscript/php3/README	2007-12-03 23:42:19 UTC (rev 7142)
@@ -1846,11 +1846,19 @@
                    the mapfile.
     double sizex;
     double sizey
-    int numpoints
+    int numpoints (Read-Only)
     int filled;
-    int patternlength;
-    int stylelength;  (Deprecated in v5.0, use patternlength instead.)
-
+    int patternlength; (Read-Only)
+    int stylelength;  (Deprecated in v5.0, use patternlength instead.) (Read-Only)
+    string imagepath; (Read-Only))
+    int transparent; 
+    int transparentcolor; 
+    string character; 
+    int antialias; 
+    string font; 
+    int gap; 
+    int position;
+ 
   Methods:
 
     int set(string property_name, new_value)
@@ -1886,7 +1894,9 @@
         Deprecated in v5.0, will be removed in a future release.
         Use getpatternarray() instead.
 
-    Example of usage : crete a symbol to be used as a dash line
+    Example of usage:  
+    
+      1- crete a symbol to be used as a dash line
 
         $nId = ms_newsymbolobj($gpoMap, "mydash");
         $oSymbol = $gpoMap->getsymbolobjectbyid($nId);
@@ -1907,8 +1917,15 @@
 
         $style->set("symbolname", "mydash");
 
-      
+      2- Create a TrueType symbol 
 
+         $nId = ms_newSymbolObj($gpoMap, "ttfSymbol"); 
+ 	 $oSymbol = $gpoMap->getSymbolObjectById($nId); 
+ 	 $oSymbol->set("type", MS_SYMBOL_TRUETYPE); 
+ 	 $oSymbol->set("filled", true); 
+ 	 $oSymbol->set("character", "D"); 
+         $oSymbol->set("font", "ttfFontName"); 
+
   OwsrequestObj Class: 
   -------------------------
 

Modified: trunk/mapserver/mapscript/php3/php_mapscript.c
===================================================================
--- trunk/mapserver/mapscript/php3/php_mapscript.c	2007-12-03 16:32:34 UTC (rev 7141)
+++ trunk/mapserver/mapscript/php3/php_mapscript.c	2007-12-03 23:42:19 UTC (rev 7142)
@@ -14454,12 +14454,21 @@
     /* TODO: stylelength deprecated in v5.0. To be removed in a later release*/
     add_property_long(return_value,   "stylelength", psSymbol->patternlength);
 
-    //PHPMS_ADD_PROP_STR(return_value,  "imagepath", psSymbol->imagepath);
-    //add_property_long(return_value,   "transparent",     psSymbol->transparent);
-    //add_property_long(return_value,   "transparentcolor", 
-    //                 psSymbol->transparentcolor);
+    /* MS_SYMBOL_PIXMAP */ 
+    PHPMS_ADD_PROP_STR(return_value,  "imagepath", psSymbol->imagepath);
+    add_property_long(return_value,   "transparent",     psSymbol->transparent);
+    add_property_long(return_value,   "transparentcolor", psSymbol->transparentcolor);
+
+    /* MS_SYMBOL_TRUETYPE */             
+    PHPMS_ADD_PROP_STR(return_value,  "character",  psSymbol->character); 
+    add_property_long(return_value,   "antialias",  psSymbol->antialias); 
+    PHPMS_ADD_PROP_STR(return_value,  "font",       psSymbol->font); 
+    add_property_long(return_value,   "gap",        psSymbol->gap); 
+    add_property_long(return_value,   "position",   psSymbol->position); 
+    
     //TODO : true type and cartoline parameters to add.
 
+    
     return symbol_id;
 }
     
@@ -14498,9 +14507,17 @@
     else IF_SET_DOUBLE(  "sizex",   self->sizex)
     else IF_SET_DOUBLE(  "sizey",   self->sizey)
     else IF_SET_LONG(  "filled",    self->filled)
+    else IF_SET_LONG(  "transparent", self->transparent) 
+    else IF_SET_LONG(  "transparentcolor", self->transparentcolor) 
+    else IF_SET_STRING("character",   self->character) 
+    else IF_SET_LONG(  "antialias",   self->antialias) 
+    else IF_SET_STRING("font",        self->font) 
+    else IF_SET_LONG(  "gap",         self->gap) 
+    else IF_SET_LONG(  "position",    self->position)        
     else if (strcmp( "numpoints", pPropertyName->value.str.val) == 0 ||
              strcmp( "patternlength", pPropertyName->value.str.val) == 0 ||
-             strcmp( "stylelength", pPropertyName->value.str.val) == 0)
+             strcmp( "stylelength", pPropertyName->value.str.val) == 0 ||
+             strcmp( "imagepath", pPropertyName->value.str.val) == 0)
     {
         php3_error(E_ERROR,"Property '%s' is read-only and cannot be set.", 
                             pPropertyName->value.str.val);



More information about the mapserver-commits mailing list