private static Map < VectorLayer , List < Feature > > convertFromDto ( Map < String , List < org . geomajas . layer . feature . Feature > > dtoFeatures , MapModel model ) { Map < VectorLayer , List < Feature > > result = new LinkedHashMap < VectorLayer , List < Feature > > ( ) ; for ( Entry < String , List < org . geomajas . layer . feature . Feature > > entry : dtoFeatures . entrySet ( ) ) { if ( ! entry . getValue ( ) . isEmpty ( ) ) { List < Feature > convertedFeatures = new ArrayList < Feature > ( ) ; VectorLayer layer = convertFromDto ( entry . getKey ( ) , entry . getValue ( ) , convertedFeatures , model ) ; if ( layer != null ) { result . put ( layer , convertedFeatures ) ; } else { // TODO couldn't find layer client-side ?? maybe should throw an error here GWT . log ( "Couldn't find layer client-side ?? " + entry . getKey ( ) ) ; } } } return result ; }
This also adds the features to their respective layers so no need to do that anymore .