Google map pin
1 2 def pin(x,y,char=None): 3 # top-left is x-5, y-17 4 points = [ (0,0), (-2,-6), (-5,-10), (-5,-14), (-2,-17), \ 5 (2,-17), (5,-14), (5,-10), (2,-6)] 6 c.polygon([(x+dx,y+dy) for dx,dy in points], 0, (255,119,107), 1) 7 if char: 8 c.text((x-2, y-7), unicode(char)) 9 else: 10 c.point((x,y-12), 0, width=5)
Instead of adding a pin image to the program, this function
will draw a google map pin at point (x,y) instead.
If you give it a char, it will put that char in the middle of
the pin as well
1 2 pin(20,20,'A') # A in the pin 3 pin(40,40) # just bull-eye