Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

optimize map loading on main search page #56

Open
emylonas opened this issue Feb 5, 2020 · 4 comments
Open

optimize map loading on main search page #56

emylonas opened this issue Feb 5, 2020 · 4 comments
Labels
Milestone

Comments

@emylonas
Copy link
Contributor

emylonas commented Feb 5, 2020

The page is non-functional until all the facet data and the map have loaded. This is especially burdensome in places with slow net connections. It would be great to figure out a way to optimize the loading.

@emylonas emylonas added this to the future milestone Feb 5, 2020
@emylonas emylonas modified the milestones: future, now Mar 3, 2020
@emylonas
Copy link
Contributor Author

This is probably happening because the map coordinates are being loaded from Pleiades each time the page is loaded. If this is the case, one solution is to look up coordinates when inscriptions are being indexed - this would require a change to the solr xsl and a change to the search page code.

@emylonas emylonas added bug and removed enhancement labels Apr 14, 2021
@emylonas emylonas modified the milestones: future, next, 2021 Summer Apr 14, 2021
@atbradley
Copy link
Collaborator

I've made a few minor changes to the mapsearch.js script running on dlib. It should be a little faster, especially on slower connections. https://dlibwwwcit.services.brown.edu/iip/mapsearch/

@atbradley
Copy link
Collaborator

The query that's used to build the map just gives Pleiades URLs and counts for each. It's not looking at item-level details, so it wouldn't get any Pleiades data we index in Solr. If we want to limit the number of queries, we could download the Pleiades data and build a simple API that takes a list of Pleiades IDs and returns geodata for all of them in a single request.

I think my pull request above has the highest improvement:effort ratio we can manage here. For anything else, I'd probably have to refactor or rewrite large chunks of the map script. I could remove a lot of the code smell, but I don't know how much the end user would notice.

@atbradley
Copy link
Collaborator

Actually it looks like there are multiple steps in building the map. The bit that creates the map markers uses the location name and region from Solr for the first search result in that location. That still doesn't have to happen when originally setting up the page and should probably be put off until the user clicks on a circle on the map.

I've spent this morning looking at the script and I think I was right yesterday--the code is spaghetti-ish enough it'd probably be easier to rewrite than to make more improvements.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants