Json Geometry Object - how to set size of point marker symbol?

508
1
08-22-2011 06:30 AM
ChrisBuckmaster1
Occasional Contributor
Hi


I am using the Map2PDF REST service provided by Rahul Ravikumar and am trying to set the point symbol's style when graphics are added to the map. When I set this within my API it does not seem to translate over to the js file so I am looking at altering the code within the js file itself...


The following code is what is provided when setting the point symbol:-


else if (geometry instanceof esri.geometry.Point) {
          geometries.push({
            "geometryType" : "esriGeometryPoint",
            "x" : geometry.x,
            "y" : geometry.y,
            "symbol" : graphics.symbol.toJson()
          });


How can this be modified to specifically set the size of the point?


Thanks
0 Kudos
1 Reply
JeffPace
MVP Alum
Well right now you are just pushing in the existing symbol.  So before the push, you can override the symbology.

else if (geometry instanceof esri.geometry.Point) {
var symbol = graphics.symbol;
symbol.setColor(new dojo.Color([255,255,0,0.5])); //change to what you want here
//then pass the modified symbol instead of the default
          geometries.push({
            "geometryType" : "esriGeometryPoint",
            "x" : geometry.x,
            "y" : geometry.y,
            "symbol" : symbol.toJson()
          });



Hi


I am using the Map2PDF REST service provided by Rahul Ravikumar and am trying to set the point symbol's style when graphics are added to the map. When I set this within my API it does not seem to translate over to the js file so I am looking at altering the code within the js file itself...


The following code is what is provided when setting the point symbol:-


else if (geometry instanceof esri.geometry.Point) {
          geometries.push({
            "geometryType" : "esriGeometryPoint",
            "x" : geometry.x,
            "y" : geometry.y,
            "symbol" : graphics.symbol.toJson()
          });


How can this be modified to specifically set the size of the point?


Thanks
0 Kudos