Skip to content

Commit

Permalink
[BUGFIX] Fix highlighting for words (#1377)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
beatrycze-volk and sebastian-meyer authored Dec 16, 2024
1 parent 18a6ba4 commit 67835aa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Resources/Public/JavaScript/PageView/Utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,16 +646,16 @@ dlfUtils.scaleToImageSize = function (features, imageObj, width, height, optOffs
};

/**
* Search a feature collection for a feature with the given coordinates
* Search a feature collection for a feature with the given word in its fulltext
* @param {Array.<ol.Feature>} featureCollection
* @param {string} coordinates
* @param {string} word for highlighting
* @returns {Array.<ol.Feature>|undefined}
*/
dlfUtils.searchFeatureCollectionForCoordinates = function (featureCollection, coordinates) {
dlfUtils.searchFeatureCollectionForCoordinates = function (featureCollection, word) {
var features = [];
featureCollection.forEach(function (ft) {
if (ft.values_.fulltext !== undefined) {
if (ft.values_.fulltext.includes(coordinates)) {
if (ft.values_.fulltext.toLowerCase().includes(word.toLowerCase())) {
features.push(ft);
}
}
Expand Down

0 comments on commit 67835aa

Please sign in to comment.