-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] re-introduce search for coordinates in ol.Feature Array
Rewrite displayHighlightWord to represent overwritable forward-function to utility.js
- Loading branch information
1 parent
4b3a130
commit fc386c5
Showing
2 changed files
with
39 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -645,13 +645,31 @@ dlfUtils.scaleToImageSize = function (features, imageObj, width, height, optOffs | |
return features; | ||
}; | ||
|
||
/** | ||
Check warning on line 648 in Resources/Public/JavaScript/PageView/Utility.js Codacy Production / Codacy Static Code AnalysisResources/Public/JavaScript/PageView/Utility.js#L648
|
||
* Search a feature collection for a feature with the given coordinates | ||
* @param {Array.<ol.Feature>} featureCollection | ||
* @param {string} coordinates | ||
* @return {Array.<ol.Feature>|undefined} | ||
*/ | ||
dlfUtils.searchFeatureCollectionForCoordinates = function (featureCollection, coordinates) { | ||
var features = []; | ||
featureCollection.forEach(function (ft) { | ||
if (ft.get('fulltext') !== undefined) { | ||
if (ft.getId() === coordinates) { | ||
features.push(ft); | ||
} | ||
} | ||
}); | ||
return features.length > 0 ? features : undefined; | ||
}; | ||
|
||
/** | ||
* Search a feature collection for a feature with the given word in its fulltext | ||
* @param {Array.<ol.Feature>} featureCollection | ||
* @param {string} word for highlighting | ||
* @returns {Array.<ol.Feature>|undefined} | ||
*/ | ||
dlfUtils.searchFeatureCollectionForCoordinates = function (featureCollection, word) { | ||
dlfUtils.searchFeatureCollectionForWords = function (featureCollection, word) { | ||
var features = []; | ||
featureCollection.forEach(function (ft) { | ||
if (ft.values_.fulltext !== undefined) { | ||
|