ThinkGeo.com    |     Documentation    |     Premium Support

How add style like adding color to polygon (feature) instead of layer

Hello,
we are working on project where we need to add the color to polygons(feature and not on layer) according to the classification( valid , invalid,new).so is it possible?please provide if there are any sample code.
Thanks,
Hrishikesh Konde.

Hi,

I guess your requirement is render the polygon based on some special value. Does it right?

You can try our value style for your scenario.

Regards,

Ethan

Hello Ethan,
suppose i have 20 polygons on same inmemmoryfeature layer in which
5 are valid ( i want it to be colored green),
5 are invalid( i want it to be colored red) and
10 are new ( i want it to be colored yellow)
thanks,
Hrishikesh Konde.

Hi,

Yes your scenario can be solved by value style.

You can build the features, then add the “valid”, “invalid” and “new” into its column value, and add the features into the inmemoryFeatureLayer.

After that you can set the value style, add it as the custom style.

For more detail code please refer the sample in my last reply.

Regards,

Ethan

Hello Ethan,
Thanks for your help. we have implemented as you said and it’s working good.we have one more question regarding this is that can we do same for the trackshapelayer just adding different styles say suppose i have group of vertices and i want to change the style for first and last vertex. we tried this but we were unable to implement it.
Thanks and Regards,
Hrishikesh Konde.

Hi,

I build a sample for you, please refer it.9119.zip (102.8 KB)

Regards,

Ethan

Hello Ethan,
Thank so much for your help.and your helped us to remove style error.which we were facing earlier.now we have different styles at beginning and at the end.
Thanks and Regards,
Hrishikesh Konde.

Hi,

I am glad to hear that’s helpful.

Regards,

Ethan