Author Topic: Mapview starting location  (Read 16687 times)

0 Members and 1 Guest are viewing this topic.

Online vdeane

  • Sr. Member
  • ****
  • Posts: 424
  • Gender: Female
  • Last Login:Today at 09:45:39 pm
    • New York State Roads
Re: Mapview starting location
« Reply #15 on: September 22, 2023, 10:12:04 pm »
I'm using Edge, which is based on the Chrome engine.

If you zoom out to, say, the entire US, obviously it would take a long time to load all that data. But if it retained the ability to silently cancel the load and restart it over a new area if I zoomed and panned, then it would be fine. But it reliably freezes on me after ten seconds, making it impossible to pan or zoom until it's finished. And over a large area, it seems never to finish. If I try to pan or zoom while it's frozen, Edge pops up "This page isn't responding", giving me "Wait" or "Exit page" choices. Eventually, I have to reload the page. So this could be a Chrome-ism. So it would be nice if the software managed to avoid getting into that state.

Firefox still hangs for a bit sometimes, but always seems to recover.
Interesting.  I don't think I've let it sit that long with intent to pan/zoom elsewhere before it finished loading.  I wonder if there's a way it could be coded to keep the window responsive if the user wants to move.

Incidentally, as mentioned, the "hang" isn't really a hang.  Large areas with lots of routes take a while.  Loading all of usai takes a couple minutes and loading all of usaus takes at least 8.
Please note: All comments here represent my own personal opinion and do not reflect the official position of NYSDOT or its affiliates.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2854
  • Last Login:Today at 09:27:40 pm
Re: Mapview starting location
« Reply #16 on: September 23, 2023, 07:33:53 am »
I wonder if there's a way it could be coded to keep the window responsive if the user wants to move.

I'm sure there is, but I don't know of a good way.  Maybe it could break up the SQL query into smaller requests and respond to the UI in between.  Bottom line, JS is single-threaded, and when JS code is executing, your browser window's not doing anything else until the JS code yields control back to the browser UI.  When it's taking in a huge chunk of data from the DB, processing it, and adding thousands of things to the Leaflet map, it's going to look like it's hanging.  Given enough memory for your browser and patience of the user, you can pretty much load anything you want.  It's just going to take a long time.

TM's been in somewhat desperate need of a true web developer since the start.  An analysis and possible redesign by DB expert wouldn't hurt either.  I've pieced a lot of things together over these 8 or so years but I'm the first to admit that I'm no web development or database expert.  If someone were willing to do for the DB and the web front end what yakra has done for the site update process, I am sure we would have a pretty incredible site.