Skip to content

Commit 12ba9db

Browse files
committed
update activity
1 parent e49df44 commit 12ba9db

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

activity_03-01.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,9 @@ In this activity you'll be using CartoCSS and TileMill to make a choropleth map
3636
17. Let's make this choropleth happen! Go ahead and just delete<br><br>`polygon-opacity:1;
3737
polygon-fill:#2980b9;`<br><br>We don't need them as they are.
3838
18. We can now apply our conditional formatting. Let's try it by just applying fill to those tracts with less than 1% of the population claiming Hungarian ancestry. Underneath `line-width: 0.5` add:<br><br>`[p_hung<1] {polygon-fill: rgb(255,255,204);}`<br><br>Click **Save**. If there are no syntax errors, you should see that only a few census tracts have been filled in. The rest are transparent because they have no polygon-fill value at the moment. We'll change that next.<br><img src="https://maptastik.github.com/os-webmap-workshop/images/tm-map8.png" width=100% />
39+
19. Let's add the rest of our classes with the appropriate colors following the model from the last step:<br><br>`[p_hung>=1] {polygon-fill: rgb(194,230,153);}`<br>`[p_hung>=4] {polygon-fill: rgb(120,198,121);}`<br>`[p_hung>=7] {polygon-fill: rgb(49,163,84);}`<br>`[p_hung>=10] {polygon-fill: rgb(0,104,55);}`<br><br>Click **Save**. If all went as planned and there are no errors, you should see a choropleth map based on the classification scheme defined earlier.<br><img src="https://maptastik.github.com/os-webmap-workshop/images/tm-map9.png" width=100% />
40+
20. This is a pretty nice looking choropleth map, but there's no figure to ground relationship, no geographic context surrounding Lucas County. We could add additional state and county layers to create that context, but we can also place this choropleth map on top of a basemap. Although adding transparency to choropleth maps is a big no-no, in our enxt activity we'll be placing this map over a basemap well-suited for such a cartographic deviance.<br><br>To get that transparency in our polygon fill, we need to make a slight adjustment to our polygon-fill specifications. We can adjust transparency in RGB colors through the alpha channel, but at the moment our style doesn't address transparency. Our fill is fully opaque. To adjust that alpha channel is quite simple. Instead of `polygon-fill: rgb(...)` we need to use `polygon-fill: rgba(...)`. The **a** in rgba is our alpha channel and it allows us to add a fourth value in our color specification. We can select a number, 0 (totally transparent) - 1 (totally opaque), to adjust the opacity of the fill. Let's use 0.5. Your polygon fill formatting should look something like this:<br><br>`[p_hung<1] {polygon-fill: rgba(255,255,204,0.5);}
41+
[p_hung>=1] {polygon-fill: rgba(194,230,153,0.5);}
42+
[p_hung>=4] {polygon-fill: rgba(120,198,121,0.5);}
43+
[p_hung>=7] {polygon-fill: rgba(49,163,84,0.5);}
44+
[p_hung>=10] {polygon-fill: rgba(0,104,55,0.5);}`<br><br>Click **Save**<br><br><img src="https://maptastik.github.com/os-webmap-workshop/images/tm-map10.png" width=100% />

images/tm-map10.png

82.2 KB
Loading

images/tm-map9.png

70.6 KB
Loading

0 commit comments

Comments
 (0)