Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label Widget field list gets appended to #38

Open
kjohnsonGIS opened this issue Dec 8, 2017 · 2 comments
Open

Label Widget field list gets appended to #38

kjohnsonGIS opened this issue Dec 8, 2017 · 2 comments

Comments

@kjohnsonGIS
Copy link

Hi, I'm noticing on the label widget, after choosing to label a field on a certain layer, then choosing a different layer, the field list contains the fields of the first layer and the second. Just wondering if this has been noticed before and if i'm doing something wrong in the config.
Heres my current config:

            labelLayer: {
                title: 'Map Labels',
                id: 'labelLayer',
                include: true,
                type: 'titlePane', //titlePane
                position: 15,
                path: 'gis/dijit/Widgets/LabelLayer',
                options: {
                    // required!
                    map: true,
                    layerControlLayerInfos: true,
                    labelInfos: {
                      private: { // a string like 'assets'
                        exclude: true  //, // exclude this entire layer
                      },
                      BasemapLabels:{
                        exclude:false, 
                        4:{
                            exclude: false, 
                            fields:[{
                                alias: 'PIN',
                                name: 'PIN'
                            },{
                                alias: 'LASTNAME',
                                name: 'LASTNAME'
                            },{
                                alias: 'LOT',
                                name:'LOT'
                            }]
                        },
                        3:{
                            exclude: true
                        },
                        2: {
                            exclude: true
                        },
                        0: {
                            exclude: true
                        },
                        1: {
                            exclude: false
                        },
                        5: {
                            exclude: false
                        }
                      },
                      conservation: {
                          exclude: true
                      },
                      gps: {
                          exclude:true
                      },
                      regionalgeography: {
                          exclude:true
                      },
                      boundaries: {
                          exclude: true
                      },
                      parcels: {
                          exclude: true
                      },
                      distribution: {
                          exclude:true
                      }
                      
                    }
                }
            }  

BTW this is a great widget, i see it being super useful to our users! Thanks!

@green3g
Copy link
Owner

green3g commented Dec 11, 2017

Hm, I'm not super familiar with the code anymore but try this:

Add

this.emptyStore(this.labelSelectionStore);

to the start of this function here:
https://github.com/roemhildtg/cmv-widgets/blob/master/widgets/LabelLayer.js#L207

Let me know if that fixes it

@kjohnsonGIS
Copy link
Author

Thanks for getting back to me! That did the trick! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants