the beauty of mapping


Kode Iklan Disini

Sunday, October 31, 2021

The Google Maps Gremlin Hacks


When you lot buy a Mogwai it comes alongside a alarm -

'Avoid H2O at all costs!'

The map evolution squad at Belly lately had a like work - alone inwards their instance it was how to avoid placing randomly located map markers inwards bodies of water.

The Belly squad needed to produce a map that showed the location of a occupation organization alongside randomly located map markers displayed unopen to the occupation organization to correspond potential customers. Adding random markers to a map is easy. The Google Maps API documentation fifty-fifty includes a adept example of adding 5 map markers to a map at random.

The work that the Belly squad had was that they didn't desire to produce a map where potential customers were shown to alive inwards lakes in addition to oceans. They thus needed to come upward up alongside a hack that avoided placing markers inwards bodies of H2O on the map.

Their solution, Google Maps Water Pixel Detection With Canvas, is an ingenious method of determining H2O bodies on Google Maps. The hack involves using pixel detection to produce upward one's hear if a location is the color of H2O on the map, The hack involves a fleck of a operate on the purpose of the developer only it appears to operate rattling well.


The alone other fourth dimension I've encountered this demand for a 'Gremlin Hack' was inwards the Yarr, Pirate Map. The Yarr, Pirate Map uses the Google Maps API to produce a distinct pirate themed map, consummate alongside animated waves, birds in addition to pirate ships.

One impressive characteristic on this map is how the send in addition to moving ridge map markers are alone placed inwards the sea in addition to sea-gulls alone look nigh the shore. In this instance the developer used the Google Maps API Elevation Service to produce upward one's hear sea in addition to shore locations.

Detecting sea grade industrial plant rattling good nigh the ocean. However it isn't a consummate solution to avoiding H2O on Google Maps. Sometimes locations on acre tin too last located at sea grade and, inwards the instance of our pirate map, you lot tin goal upward alongside ships stranded inwards the desert.


The wages of the Yarr, Pirate Map hack is that it is fairly uncomplicated to implement. If you lot demand a solution that manages to avoid H2O nigh of the fourth dimension only isn't perfect in addition to so using the Elevation Service is a adept agency to go. If, however, you lot demand to avoid H2O at all costs in addition to so I would suggest trying the pixel detection method. It is a consummate Gremlin hack.