Monday, April 25, 2016

All About Density Maps

Want to know what a density map looks like before AQ makes
it all nice and pretty for you? This is it! =) Each state (and DC) has a different
palette index so AQ only needs to change one color for each state 
rather than dealing with the complex boundaries of the state. (I gave each
state a different color to make it easier for ME to see the boundaries,
but all of the colors are replace dynamically while generating the map
so it doesn't matter what the colors are at this point. Canada, Mexico,
Caribbean islands and the ocean are the only colors that don't get changed..
Then an outline of the states with the AQ logo is applied on top
to give it a polished look. Then AQ prints what map you're viewing--
who the map is for and the "action" (see below) at the top.
And presto! This ugly thing turns into a beautiful density map! =)
I teased in my last post that I had a lot more to write about those new density maps on the profile page, and here's my follow-up! For those who've been sleeping the last few days, I added a new premium member perk which allows premium members to see density maps of their plants and finds (in the United States) on their profile page. Very cool stuff! =)

But it's so much more! You can actually include them pretty much on any website you want. It's just an image, after all. You can post them to Facebook, or blogs, or... well, anywhere you can normally upload images. The URL, at it's most basic, is:

http://www.atlasquest.com/syndicate/us-box-map.png

This displays a density map of all boxes listed in the United States on Atlas Quest. You can customize the map with a few parameters. It helps if you have at least a little technical background because to change it requires some URL manipulations. There's no page to set the parameters automatically. (Perhaps someday, but it's not a high priority for me.) But URL manipulation is easy and opens up a whole lot of new options...
  • memberId: Specifies the member ID of the person whose plants and finds you want to create a density map for. You can find your member ID at the top-right corner of your profile page. And since this is a premium member only perk, it only works for members who are premium members. (You'll just see an error message saying that density maps are a premium member perk if you try to point to a non-premium member.)
  • color: A 6-digit hexadecimal number for the color to use on the map in the form rrggbb. All of the shades of color are based off this color and become progressively darker the larger percentage of plants/finds are in the state. Generally speaking, using bright, light colors works best since shades only get darker. If you use a dark color (like black), you just get... black. For everything. 50 Shades of Black. (Ha!) =)
  • action: Can be set to plants, finds, attempts, owns or carves. If none is specified, it default to plants. So yes, this means you can display density maps of your attempts, boxes where you're the officially listed owner, or boxes with stamps that you've carved. I don't display them on the profile page because I don't think they're as interesting and I don't think most of you are as interested in them, but the option is available!
  • width: The maximum width (in pixels) that the map should be. It defaults to 600 when none is provided.
  • height: The maximum height (in pixels) that the map should be. It defaults to 600 when none is provided.
So! Here are a few more examples of maps that you can generate with a little URL manipulation:

My carves, with a reddish color (ff8888), set to a width of 300 pixels.
http://www.atlasquest.com/syndicate/us-box-map.png?memberId=1;color=ff8888;action=carves;width=300

 

My attempts, with a purplish color (ff88ff), set to a width of 400 pixels.
http://www.atlasquest.com/syndicate/us-box-map.png?memberId=1;color=ff88ff;action=attempts;width=400


Boxes I own, with a greenish color (ff88ff), set to a width of 500 pixels.
http://www.atlasquest.com/syndicate/us-box-map.png?memberId=1;color=88ff88;action=owns;width=500

BUT! That's not all.... Those are all parameters this feature was specifically designed to handle. These parameters are unique to this feature and this URL. There's a heck of a lot more parameters it supports, however, because these maps are really just an advanced search that spits out its output in a very unique manner. Almost all of the parameters you can use for advanced searches also applies to these maps as well! You can create maps of your active plants. Or all of your finds that you've tagged yellow. Or all boxes you've found that have the word "flower" in it. Or all boxes you've found that are a mental puzzle. Or whatever!

Like I said... these maps.... they're nothing more than an advanced search with a very special output!  (However, the mapping code isn't smart enough to label your map with all of your search options--just who the map is for and what action is being used.)

So, let's take a look at a map of my active plants still in existence:

To display only my active plants, I add status=1 to the URL
http://www.atlasquest.com/syndicate/us-box-map.png?memberId=1;status=1;color=88ff88;action=plants


This map is a more interesting one.... compared to the map of all of my plants, this one has a lot more holes in it. Particularly in those states where I only had one or two plants to my name to start with. Those go missing, and poof--I lose the state!

Or maybe look at my plants that have the mental puzzle icon involved. Which means setting the attribs tag to 128. (You'll probably want to run an advances search and just use the same parameters it sends you to. That's how I got these numbers!)

http://www.atlasquest.com/syndicate/us-box-map.png?memberId=1;attribs=128;color=ffff88;action=plants

So there you go.... all sorts of map options you probably didn't even realize you had! The only advanced search options that don't work is the location (it'll ignore whatever you specify and change the location to "all boxes in the United States") and anything in the "participants" section (the owner, carver, finders, etc.) which is overwritten by the memberId and action parameters. All other advanced search options work! =)

And you might be thinking... but Ryan! I want to add a map of my active plants to my profile too! How do I do that?!

And... well, you'll have to fall back on the old hack of including the URL in the free-flowing thoughts section of your profile. I've gone ahead and done that to my profile so you can see an example of it in action. It's separated from the other maps, which isn't ideal, but I didn't have the time or inclination to set up a whole range of all possible map options that I figured most people wouldn't be interested in. I picked the two that I felt most people would be interested in and everything is an advanced feature. =)

Technical note: It's entirely okay to use & between parameters rather than the semicolon that I used in my examples. Semicolons cause me less trouble than the special character & (where I often need to convert it into "&" in HTML), so I generally make a habit of using semicolons on AQ even though it's not normal on other websites and, in fact, wouldn't work at all on most other websites. =)

1 comment:

Anonymous said...

Fascinating and very LBer type fun! But someone from KY might think you have issue...

Foxfriend