-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Issue: Currently the search.py script used to generate the config.search.json file used by the application. This script generates an array of search items which follow the format of [<id>,<name>,<lower-left-x>,<lower-left-y>,<upper-right-x>,<upper-right-y>], but this format is not used by the core library.
The lookahead service expects search items in the following format;
items: [
{
'id':'<id>',
'name': '<name>',
'label': '<label>',
'extent': [[<ll-x>,<ll-y>],[<ur-x>,<ur-y>]]
}, ...
]Since the search.py script doesn't generate search items in the expected format, the app has a mapping function to update these items when the search control is added. See AddSearch() method in the lode-viewer application.js file, for an example. Instead of having the client generate the required format, the expected format could be generated by the search.py.
Solution: Instead of having the client format the data for the app before using it, it would be better to generate data in the expected format. This change will require the following;
- Update the
search.pyscript to generate search items in the expected format - Re-generate the
config.search.pyusing the updatedsearch.py - Remove the map function in the
AddSearch()method in theapplication.jsfile.