Hi,
I’ve upgraded from to 5.2 (from 5.0) and now find that “ApplyExpression” no longer works for me when using category expressions to show images for points in a shapefile.
I’m creating categories like below, where “key” is an identifier of the type of “node” the point is:
myCategory.Expression = “[Type] = “” + key + “””;
then calling:
myCategory.DrawingOptions.PointType = MapWinGIS.tkPointSymbolType.ptSymbolPicture;
myCategory.DrawingOptions.Picture = MyResource.IconImages[key];
and finally:
shp.Categories.ApplyExpression(categoryIndex);
This used to work fine and has done for a long time. However now I get no symbols, just the default point style, except for the 63rd point/node which DOES show a symbol (but the wrong one, the first one in my IconImages list as it happens, probably not coincidence). I’ve tried a couple of fields and it was the 63rd point in each case!
Also, shp.Categories.ApplyExpressions DOES work. However, I switched to the single ApplyExpression a while ago as it is much quicker for this scenario for some reason, so I’m keen to carry on using it.
Regards,
Rob H