The assumptions here seem a little urban-centric. Maybe in a downtown area, the only places you shouldn't show potential customers is in the middle of bodies of water; but what about a more rural or wild location - are you going to show a business that you can find them potential customers in the middle of fields? mountaintops? military testing ranges?<p>A better approach might be to use block-level census data to give you a probability density function to where you should plot your random made-up fake 'potential customer' icons. Less risk that when a roadside truckstop in alaska brings up your site you wind up making the misleading claim that you can find them fifty customers within walking distance...
Or you could just use OpenStreetMap which, y'know, gives you access to the Actual Map Data rather than having to reverse-engineer it from the rendered image...
Interesting, although I'm not sure why they are setting an invalid value for Image.crossOrigin. The only valid values for this are "anonymous" and "use-credentials". Setting an invalid value (like a URL) is treated as "anonymous".<p>EDIT: And when running the jsfiddle demo, it looks like Google isn't sending any CORS headers from the given map image, breaking the demo entirely:<p><a href="http://maps.googleapis.com/maps/api/staticmap?scale=2&center=40.7300694,-74.0024224&zoom=13&size=1024x160&sensor=false&visual_refresh=true" rel="nofollow">http://maps.googleapis.com/maps/api/staticmap?scale=2&center...</a>
I don't see the need to treat water different from earlier placed markers.<p>Here's how I would hack this: whenever you place an icon, draw a slighty larger circular 'lake' on top of that hidden canvas. That added lake prevents you from placing another icon in the neighborhood of that icon.
I did something funny like that a few years back trying to apply textures to roads for a game on top of the map. I normalized all the road colors to make it easy to pick out, then drew the texture on them with canvas (my memory is a little hazy here). It worked well, surprisingly.
Cool article from a technical perspective.<p>I dont understand the business ask for drawing a map to show potential customers, then placing them randomly on the map. Why not just give rough volume numbers or something instead? It seems at least misleading.