<commit_before>define([
        'openlayers',
        'underscore',
        'knockout',
        'arches',
        'resource-layer-info',
        'map/resource-layer-model'
], function(ol, _, ko, arches, resourceLayerInfo, ResourceLayerModel) {
        var resourceFeatures = ko.observableArray();
        var layers = [];

        _.each(resourceLayerInfo, function (item, entitytypeid) {
            item.entitytypeid = entitytypeid;
            layers.push(new ResourceLayerModel(item, function(features) {
                resourceFeatures(resourceFeatures().concat(features));
            }));
        });

        return {
            layers: layers,
            features: resourceFeatures
        };
});<commit_msg>define ALL resource layers here using new layer models<commit_after>define([
        'openlayers',
        'underscore',
        'knockout',
        'arches',
        'resource-layer-info',
        'map/resource-layer-model',
        'map/layer_models/marker-layer-model',
        'map/layer_models/full-layer-model',
        'map/layer_models/polygon-layer-model',
        'map/layer_models/area-layer-model',
        'resource-types',
        'user-info'

], function(ol, _, ko, arches, resourceLayerInfo, ResourceLayerModel, MarkerLayerModel, FullLayerModel, PolygonLayerModel, AreaLayerModel, resourceTypes, userInfo) {
        var resourceFeatures = ko.observableArray();
        var layers = [];
        
        var layerModelMap = {
            'area':AreaLayerModel,
            'poly':PolygonLayerModel,
            'marker':MarkerLayerModel,
            //'project_areas':ActivityLayerModel
        }
        
        _.each(resourceTypes, function (item, entitytypeid) {
            
            //exclude if not mappy resource
            if (item.makeLayer == false){return true;}
            
            //exclude based on user permissions
            if (userInfo.name == 'anonymous' && item.restricted){return true;}
            
            item.entitytypeid = entitytypeid;
            item.onMap = true;
            
            item.active = false;
            if (entitytypeid == "INVENTORY_RESOURCE.E18"){
                item.active = true;
            }

            //select which layer model to use based on resource type layer_model value
            var newLayerModel = layerModelMap[item.layerModel];

            layers.push(new newLayerModel(item, function(features) {
                resourceFeatures(resourceFeatures().concat(features));
            }));
        });

        return {
            layers: layers,
            features: resourceFeatures
        };
});
{'fraction_non_alphanumeric': 0.1091186570011446, 'fraction_numerical': 0.0007630675314765357, 'mean_word_length': 1.9328859060402686, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5919451', 'n_tokens_mistral': 682, 'n_tokens_neox': 662, 'n_words': 133}