Live data from Hacker News

Where'd The Water Go? Google Maps Water Pixel Detection With Canvas

tech.bellycard.com

1–10 of 22 posts

Re: Where'd The Water Go? Google Maps Water Pixel Detection With Canvas

#2
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".

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:

http://maps.googleapis.com/maps/api/staticmap?scale=2&center...

Re: Where'd The Water Go? Google Maps Water Pixel Detection With Canvas

#5
post #3

Cool article from a technical perspective. 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.

What's an ask?

Re: Where'd The Water Go? Google Maps Water Pixel Detection With Canvas

#6
post #3

Cool article from a technical perspective. 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.

The map, business logo, and people icons just help illustrate the feature. Volume and other value related benefits are communicated elsewhere in the page content, but aren't really additive to the blog post.

Re: Where'd The Water Go? Google Maps Water Pixel Detection With Canvas

#7

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...

That's true, although perhaps missing the point of the article. The example lets you used any particular image, rather than having to (for example) pull GeoJSON of the extent area, etc. It's a sweet hack.

Re: Where'd The Water Go? Google Maps Water Pixel Detection With Canvas

#9
I don't see the need to treat water different from earlier placed markers.

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.

Re: Where'd The Water Go? Google Maps Water Pixel Detection With Canvas

#10

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...

If only there was something like maps.google.com for OSM. Yes, there's openstreetmap.org but that doesn't have directions or location sharing. Also, if people started using it like maps.google.com, I'm sure the OSM project wouldn't be too happy, seeing as how tile serving on such a scale gets expensive fast.
Post reply on HN