src/scripts/views/choropleth.js
function () {
    // Create hash table for easy reference
    var collectionValues = hashTable(this.collection.toJSON(), 'label', 'value')
    var filteredCollectionValues = hashTable(this.filteredCollection.toJSON(), 'label', 'value')

    // Add value from hash tables to geojson properties
    var idAttribute = this.boundaries.idAttribute
    var filtered = this.filteredCollection.getFilters().length
    this.boundaries.forEach(function (item) {
      var properties = item.get('properties')
      properties.value = collectionValues[properties[idAttribute]]
      if (filtered) {
        properties.filteredValue = filteredCollectionValues[properties[idAttribute]] || 0
      }
      item.set('properties', properties)
    }, this)
  }
function () {
    // Create hash table for easy reference
    var collectionValues = hashTable(this.collection.toJSON(), 'label', 'value')
    var filteredCollectionValues = hashTable(this.filteredCollection.toJSON(), 'label', 'value')

    // Add value from hash tables to geojson properties
    var idAttribute = this.boundaries.idAttribute
    var filtered = this.filteredCollection.getFilters().length
    this.boundaries.forEach(function (item) {
      var properties = item.get('properties')
      properties.value = collectionValues[properties[idAttribute]]
      if (filtered) {
        properties.filteredValue = filteredCollectionValues[properties[idAttribute]] || 0
      }
      item.set('properties', properties)
    }, this)
  }
function ( ) { // Create hash table for easy reference var collectionValues = hashTable ( this . collection . toJSON ( ) , 'label' , 'value' ) var filteredCollectionValues = hashTable ( this . filteredCollection . toJSON ( ) , 'label' , 'value' ) // Add value from hash tables to geojson properties var idAttribute = this . boundaries . idAttribute var filtered = this . filteredCollection . getFilters ( ) . length this . boundaries . forEach ( function ( item ) { var properties = item . get ( 'properties' ) properties . value = collectionValues [ properties [ idAttribute ] ] if ( filtered ) { properties . filteredValue = filteredCollectionValues [ properties [ idAttribute ] ] || 0 } item . set ( 'properties' , properties ) } , this ) }
Loop through features, find the matching dataset record, and put the specific field into the feature
Done via reference
Loop through features find the matching dataset record and put the specific field into the feature Done via reference