Teaching and doing digital history.

Great Expectations

I had partial success with my mapping project this weekend.

I had originally planned to map each state with little popup boxes showing details on the numbers for each state. It turns out that I greatly underestimated both my skills with JSON files and the Google APIv3 for maps.

But let me back up. I did have success mapping multiple points on a map. I also successfully mapped a point on a map with a detail window on click (click on the marker to see the details.) However, when I tried to map multiple points on a map with detail boxes, that’s where the train went off the rails.

Apparently, the Google Maps API has issues with looping through a long list of details to set markers and info boxes. It only pulls the last info box in the list. There are a nice bunch of tutorials on how to fix the issue, BUT since I am not as well schooled in javascript and calling JSON information, I could not get it to work.. although I did try. My attempt to get it to work is avail here and frankly, I think it’s a big old mess. For one, I’m not sure how to call the separate JSON file. [The tutorial I was using is here. I have his book and his examples were working well for me up until this point, which makes me think it’s a js/json problem.]

For reference, here is my JSON data.


I’ll continue to try to debug and hack at it to get it to work, but I’m finding the online documentation only partially helpful. One big problem is that I’m not totally confident that I know how to code the start and end to each file. So when I find code snippets of “solutions” to common problems, I’m not entirely sure where to put the code. Since the order is really important, I’m sure I have some things out of order.

Full code examples would be more helpful so that I can see it in context, but I know this is a learning curve problem, and that it will diminish with time. These “help” blog posts are written for experienced coders and right now I’m a hack at best. So for the time being, I’m embracing my hack status and putting this to the side as a problem for another day.

Speak Your Mind