GFDRR / recovery_dashboard

http://gfdrr.github.io/recovery_dashboard/
0 stars 1 forks source link

Refactor Info Window #44

Closed milafrerichs closed 9 years ago

milafrerichs commented 9 years ago

What does this PR do?

It refactors the info windows into an angular directive. for easier reuse. Adds Test for directive. Only show properties of the feature when it has a value (fixes #31 )

Proposal

Move configuration of InfoWindows to layer configuration. So that the actual code would not really need to be touched when adding a new layer. something like:

{
  name: 'Buildings Layer'
  source: ...
  infoWindow: {
    featureProperty: 'properties'
    header: 'Name'
    showProperty: 'name'
    showValue: 'buildings'
    contents: [
      {
        label: 'Damaged Buildings'
        value: 'DAMAGED_B'
      },
      ...
    ]
}
....