if (style == null) return;
if (layer.hasResource(FeatureSource.class)) {
IGeoResource resource = layer.findGeoResource(FeatureSource.class);
SimpleFeatureSource featureSource
= resource.resolve(SimpleFeatureSource.class, m);
if (featureSource != null) {
//match up the feature type style name and the feature type name
SimpleFeatureType type = featureSource.getSchema();
FeatureTypeStyle fstyle = SLDs.featureTypeStyle(style,type);