Skip to content
This repository has been archived by the owner on Jan 16, 2020. It is now read-only.

.dbk-title onclick event handler stacks up when new feature selected #32

Open
matthijsln opened this issue Dec 31, 2015 · 0 comments
Open
Assignees
Labels
Milestone

Comments

@matthijsln
Copy link
Member

In public/js/dbkjs/protocol/jsonDBK.js, function process():

                $('.dbk-title')
                    .text(feature.data.formeleNaam + ' ' + feature.data.informeleNaam)
                    .css('visibility', 'visible')
                    .on('click', function() {
                        dbkjs.modules.feature.zoomToFeature(feature);
                    });

The click handler is added to the class, but all handlers before that for previous features will still be called. This leads to sluggishness when a lot of features are selected without a page reload.

Solution is to register the onclick handler at startup which zooms to the feature (not dbkjs.options.feature, this is the JSON object, zoomToFeature() needs the OpenLayers feature to zoom to pand geometry). So save the OpenLayers feature to zoom to in process() function.

Check if fixed in nodeless override

@matthijsln matthijsln added the bug label Dec 31, 2015
@matthijsln matthijsln self-assigned this Dec 31, 2015
@matthijsln matthijsln added this to the 3.1 milestone Dec 31, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant