Friday, June 19, 2015

Better display method

After reading some articles about using Google Maps I found a better solution to the current "too many markers" problem, called MarkerClusterer. It groups markers into clusters, and only displays cluster centers when zoomed out to a certain point. I have to download the given javascript source, then point to it from my HTML, then it just works. Performance is vastly improve, and it looks a lot better.



I still want to add more info to the markers.

An issue I'm having is the run time of creating all 672 HTML files. I timed it today, it takes almost 6 hours to run. I think I need to come up with a better way to implement and test repeatedly. I can cut down the number of points, or just try to improve the code. Right now, it scans through the entire JSON for every time slot, which comes out to something like 300,000 x 672, which is too much. The better approach would be to scan the JSON once, and find the appropriate index file(s) to write into. This adds complexity. I'll have to either keep all those files open and write to them correctly, which seems hard to organize. Or I could keep the index list's for each file, writing to them as I go, then write every file all at the very end. Or I could try to multithread the code and find a super powerful machine to run on. Finally, I recall Tomer talking about something called "pypy", which apparently runs python code but much faster.

Immediate next steps I want to tackle:
  1. Display data through the markers, either mouse over text or click marker and bubble pops up.
  2. Put the maps into a smaller "container" or "window", instead of taking up the whole web page. That way I can start adding buttons and sliders and what not to change between time slots.
  3. Improve speed of creating HTMLs. Or, use smaller data set.

No comments:

Post a Comment