When you lot buy a Mogwai it comes alongside a alarm -
'Avoid H2O at all costs!'
The map evolution squad at Belly late had a like work - exclusively inwards their instance it was how to avoid placing randomly located map markers inwards bodies of water.
The Belly squad needed to exercise a map that showed the location of a describe of piece of work organisation alongside randomly located map markers displayed merely about the describe of piece of work organisation to correspond potential customers. Adding random markers to a map is easy. The Google Maps API documentation fifty-fifty includes a skilful example of adding v map markers to a map at random.
The work that the Belly squad had was that they didn't desire to exercise a map where potential customers were shown to alive inwards lakes in addition to oceans. They hence needed to come upwards 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 decide if a location is the color of H2O on the map, The hack involves a chip of a occur the business office of the developer but it appears to locomote really well.
The exclusively other fourth dimension I've encountered this ask for a 'Gremlin Hack' was inwards the Yarr, Pirate Map. The Yarr, Pirate Map uses the Google Maps API to exercise 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 exclusively placed inwards the sea in addition to sea-gulls exclusively seem nigh the shore. In this instance the developer used the Google Maps API Elevation Service to decide sea in addition to shore locations.
Detecting sea grade plant really good nigh the ocean. However it isn't a consummate solution to avoiding H2O on Google Maps. Sometimes locations on province tin besides live on located at sea grade and, inwards the instance of our pirate map, you lot tin terminate upwards alongside ships stranded inwards the desert.
The wages of the Yarr, Pirate Map hack is that it is fairly elementary to implement. If you lot ask a solution that manages to avoid H2O virtually of the fourth dimension but isn't perfect so using the Elevation Service is a skilful agency to go. If, however, you lot ask to avoid H2O at all costs so I would suggest trying the pixel detection method. It is a consummate Gremlin hack.
Buat lebih berguna, kongsi: