fix: sharemap popup not displayed #1904
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1900
Moved the rendering of the popup to the featuresloadend event of the source as the layer event postrender seems to be fired before features have been fetched from the source. Or possibly fired several times where the first is in a useless extent that does not load any features. This is probably due to a change in open layers.
As a bonus it fixes a bug in fetureInfo.showFeatureInfo that threw an exception when only one feature was sent. Previous implementation of sharemap did not suffer from this as the postrender event caller swallowed the exception and the functionality that was cut short due to the exception was zooming to the feature, which no one was missing as sharemap always includes center and zoom in the links so the map was already panned to the desired extent.
Bonus 2: It is now possible to actually zoom to the extent of the feature instead of the sharemap center and zoom by creating a link that omits center and zoom.