NYC Swipe Map


To create a swipe map you need 2 layers: 1) a base map with a background and transparent marks/polygons and 2) a duplicate map with colored marks/polygons and no base map. The 2nd map needs to be overlaid on top of the base map with a transparent background. 

To create the swipe effect add a parameter based on the longitude. The color is and IF THEN calx tied to the parameter. If the map longitude is less than the parameter longitude (left of line) then set a negative normalized value. And if the map longitude is higher than the parameter longitude (right of the line) then set a positive, second normalized value. The two normalized values in the above case are median household income and health insurance coverage. 



Finally, add a reference line to 2nd map tied to parameter. Then just line up the two maps with the parameter and bing bango: swipe map.

Download my version to reverse engineer. Let me know if you have any questions.

1 comment:

  1. This is amazing. Thanks for this tutorial! Not sure how to add a reference line to a map thought. Can you elaborate on that?

    ReplyDelete

div#ContactForm1 { display: none !important; }