The Daily Bucket is a place to catch your casual observations of the natural world and turn them into a valuable resource. Whether it's the first flowers of spring or that odd bug in your basement, don't be afraid to toss your thoughts into the bucket. Check here for a more complete description.
Remember yesterday when I said that the end of my Daily Kos Day Hike had been marked by the arrival of a really impressive thunder-snow? Well, that turned into a really, really impressive thunder-show that not only rattled the rafters but left something like 8" of fresh, moist whiteness on the ground.
Morning after the Thunder-Snow
So I've got nothing much to report in the way of observations except lots and lots of water ice.
Which is fine, because today I've promised to talk about making maps. That little map that I put at the bottom of each Daily Bucket is generated through the Google Static Maps API. Google offers a lot of different ways to use their mapping tools, but most of them share the same problem when it comes to dropping them into a post: most calls to the map require Javascript, and there are big limits on scripting in a diary or comment.
What makes the static map API work is that it can be used with a regular old image (IMG) tag, just like posting a picture. In the examples below, I'm making two changes. One, I'm changing angle brackets to plain old parentheses so that the site doesn't read it as a tag. I'm also changing http to xxxx so that the site doesn't see it as a link and obscure the rest of the information. Just remember that in the examples below ( = <, ) = >, and xxxx = http. Got it?
Say for example I want to create a map that covers the San Francisco area. There are several ways to do it.
I can create a map that's centered on San Francisco with just this call.
Example 1
(img src="xxxx://maps.google.com/maps/api/staticmap?center=SAN+FRANCISCO,CA&zoom=12&size=512x200&maptype=hybrid
&sensor=false")
Some of what's going on in this map is obvious.
The "center" attribute tells the map where to center, and Google is smart enough to take names rather than requiring coordinates. But if you have coordinates in latitude and longitude -- say if you're trying to pinpoint a location in the wilderness -- you can.
Zoom level tells how much area to show (a zoom of 0 means "show the whole world" while a zoom of 20 is about equal to showing a single block).
maptype has options of roadmap, terrain, satellite, and hybrid. I'll show some more examples to give an idea of the different types.
The sensor parameter is meant to support interaction with a coordinate source, like a GPS system. Just set it to false and you'll stay out of trouble.
If that looks simple enough, what I actually do for the map each day is even easier. It starts each day looking something like this:
Example 2
(img src="xxxx:/maps.google.com/maps/api/staticmap?size=512x200&maptype=terrain&
markers=size:mid%7Clabel:M%7Ccolor:blue%7CANTONIA,MO&sensor=false")
Notice that this one is lacking most of the stuff from the little San Francisco map. No zoom, no center. Instead there's a "marker." A marker is that little blue "pin" in the map, and the static map API will automatically expand your map to handle all the pins you throw at it.
Each marker contains three bits of info: size (tiny, mid or small), color (you can get detailed using a 24-bit hex color code, or just stick to a lowercase name like "green" or "blue"), and label (which has to be a single uppercase letter or a single number).
Once I have that map set up, all I do is copy that "marker" piece over and over and change the info to match the incoming message. For example, if the first new post of the day came from user HiThere in the city of Miami, Florida (where it's surely warmer than here) I could update the img tag like this.
Example 2
(img src="xxxx://maps.google.com/maps/api/staticmap?size=512x200&maptype=terrain&
markers=size:mid%7Clabel:M%7Ccolor:blue%7CANTONIA,MO&
markers=size:mid%7Clabel:H%7Ccolor:green%7CMIAMI,FL&sensor=false")
That's all there is to it. I scan the comments, look for those with an observation pinned to a location, and insert another marker. Then I do it again. And again.
The static map API actually has a lot more power than I've used so far. It can draw the path of hikes or outline the range of species. You can have markers, lines, polygons, etc. all at once. Theoretically, you might add enough markers to a map to overload the limit -- but I've never come close. Want to try today?
Today's observations come from these locations
Share your own observations in comments, and I'll add a marker to the map. Please give a city and state (as close as you feel comfortable in providing). Green pins for observations mostly about plants, brown for animals, and blue for weather or other inorganic items. The letter at the center of each pin will be the first letter of the user who provides the data.