I’ve often wondered why anyone would use OpenStreetMap (OSM) rather than Google Maps. The Google Maps API has so many bells and whistles and it’s so easy to use. Well, as I’ve been playing PaperJS recently, I wanted to explore some of its raster capabilities. Google has a static maps API, so I thought I’d load one of those images and play with its pixels. But wait! Apparently, Google Maps does not allow Cross Origin Resource Sharing (CORS), and according to the W3C wiki, they are not planning on enabling this any time soon (*). OpenStreetMap is CORS-enabled, though, so score one for open source. My example loads an OSM tile, converts it to a PaperJS raster and resamples it to a lower resolution.
*Note: apparently the Google Street View Panorama library is CORS-enabled, as displayed in this example (not my work).