Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search.py script should generate search item data for application in expected format #22

Open
roikle opened this issue Jun 18, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@roikle
Copy link
Collaborator

roikle commented Jun 18, 2021

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;

  1. Update the search.py script to generate search items in the expected format
  2. Re-generate the config.search.py using the updated search.py
  3. Remove the map function in the AddSearch() method in the application.js file.
@roikle roikle added the enhancement New feature or request label Jun 18, 2021
@roikle roikle self-assigned this Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant