<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: pin code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 27 Jul 2008 00:09:49 GMT</pubDate>
    <description>DZone Snippets: pin code</description>
    <item>
      <title>Google map pin</title>
      <link>http://snippets.dzone.com/posts/show/778</link>
      <description>&lt;code&gt;&lt;br /&gt;def pin(x,y,char=None):&lt;br /&gt;    # top-left is x-5, y-17&lt;br /&gt;    points = [ (0,0), (-2,-6), (-5,-10), (-5,-14), (-2,-17), \&lt;br /&gt;                      (2,-17), (5,-14), (5,-10), (2,-6)]&lt;br /&gt;    c.polygon([(x+dx,y+dy) for dx,dy in points], 0, (255,119,107), 1)&lt;br /&gt;    if char:&lt;br /&gt;        c.text((x-2, y-7), unicode(char))&lt;br /&gt;    else:&lt;br /&gt;        c.point((x,y-12), 0, width=5)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Instead of adding a pin image to the program, this function&lt;br /&gt;will draw a google map pin at point (x,y) instead.&lt;br /&gt;If you give it a char, it will put that char in the middle of &lt;br /&gt;the pin as well&lt;br /&gt;&lt;code&gt;&lt;br /&gt;pin(20,20,'A') # A in the pin&lt;br /&gt;pin(40,40)  # just bull-eye&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 01 Oct 2005 19:11:37 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/778</guid>
      <author>korakot (Korakot Chaovavanich)</author>
    </item>
  </channel>
</rss>
