<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: iPhone Note #14: Drawing a Point, Line, Polygon on top of MKMapview</title>
	<atom:link href="http:///wordpress/2009/10/iphone-devnote-14-drawing-a-point-line-polygon-on-top-of-mkmapview/feed/" rel="self" type="application/rss+xml" />
	<link>/wordpress/2009/10/iphone-devnote-14-drawing-a-point-line-polygon-on-top-of-mkmapview/</link>
	<description>By Rupert</description>
	<lastBuildDate>Wed, 28 Jul 2010 21:15:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Ross Kimes</title>
		<link>/wordpress/2009/10/iphone-devnote-14-drawing-a-point-line-polygon-on-top-of-mkmapview/comment-page-1/#comment-4122</link>
		<dc:creator>Ross Kimes</dc:creator>
		<pubDate>Thu, 21 Jan 2010 05:08:50 +0000</pubDate>
		<guid isPermaLink="false">/wordpress/?p=534#comment-4122</guid>
		<description>Sorry for taking so long to respond.  I did not realize that you had replied.  Need to check back more often.

I was able to get polygons to stay on the map while panning and zooming by intercepting the touch at the UIWindow level and using a NSNotification to send out a message to update.

The problem that I am having now has to do with performance while updating.  For my application, I am displaying weather warning boxes over the map, so at any given time I can have 30 or 40 of these on the map.

When drawRect: is called for each warning for every touch then it has to continuously draw each warning over and over again.

My idea to fix this is to draw out the warning box in the internal views init method and just use drawRect: to adjust the size of the box.  I have tried this a few different ways, but anytime I change it I cannot get the warnings to display. Any ideas?

Thanks,
Ross</description>
		<content:encoded><![CDATA[<p>Sorry for taking so long to respond.  I did not realize that you had replied.  Need to check back more often.</p>
<p>I was able to get polygons to stay on the map while panning and zooming by intercepting the touch at the UIWindow level and using a NSNotification to send out a message to update.</p>
<p>The problem that I am having now has to do with performance while updating.  For my application, I am displaying weather warning boxes over the map, so at any given time I can have 30 or 40 of these on the map.</p>
<p>When drawRect: is called for each warning for every touch then it has to continuously draw each warning over and over again.</p>
<p>My idea to fix this is to draw out the warning box in the internal views init method and just use drawRect: to adjust the size of the box.  I have tried this a few different ways, but anytime I change it I cannot get the warnings to display. Any ideas?</p>
<p>Thanks,<br />
Ross</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rupert</title>
		<link>/wordpress/2009/10/iphone-devnote-14-drawing-a-point-line-polygon-on-top-of-mkmapview/comment-page-1/#comment-2537</link>
		<dc:creator>rupert</dc:creator>
		<pubDate>Sun, 06 Dec 2009 22:47:00 +0000</pubDate>
		<guid isPermaLink="false">/wordpress/?p=534#comment-2537</guid>
		<description>@Daniel Wood: What MKProtocol? Are you referreing to MKAnnotation Protocol? You might be missing a MapKit frameworks reference...</description>
		<content:encoded><![CDATA[<p>@Daniel Wood: What MKProtocol? Are you referreing to MKAnnotation Protocol? You might be missing a MapKit frameworks reference&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Wood</title>
		<link>/wordpress/2009/10/iphone-devnote-14-drawing-a-point-line-polygon-on-top-of-mkmapview/comment-page-1/#comment-2390</link>
		<dc:creator>Daniel Wood</dc:creator>
		<pubDate>Wed, 02 Dec 2009 12:18:33 +0000</pubDate>
		<guid isPermaLink="false">/wordpress/?p=534#comment-2390</guid>
		<description>I&#039;m trying to implement this method for a project I&#039;m working. I have a question though. The GeometryAnnotation says it adopts the MKProtocol however it doesn&#039;t use any of the methods. When I do this Xcode complains when I build, however in your sample this is not the case. Why is that?</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying to implement this method for a project I&#8217;m working. I have a question though. The GeometryAnnotation says it adopts the MKProtocol however it doesn&#8217;t use any of the methods. When I do this Xcode complains when I build, however in your sample this is not the case. Why is that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rupert</title>
		<link>/wordpress/2009/10/iphone-devnote-14-drawing-a-point-line-polygon-on-top-of-mkmapview/comment-page-1/#comment-2098</link>
		<dc:creator>rupert</dc:creator>
		<pubDate>Tue, 24 Nov 2009 00:54:48 +0000</pubDate>
		<guid isPermaLink="false">/wordpress/?p=534#comment-2098</guid>
		<description>&gt;Is there a way to keep the polygon on the screen when scrolling and have it pan and zoom with the map? I have seen some apps do that with Google maps, but I don’t see how they did it. Any ideas?

@Ross Kimes: IT IS POSSIBLE IF they are USING GoogleMaps Javascript API. You can overlay polygons, polylines on the map. However, in my tutorial, I am trying not to call any javascript and implemented using ObjC by drawing a geometry on top of the UIViews..</description>
		<content:encoded><![CDATA[<p>>Is there a way to keep the polygon on the screen when scrolling and have it pan and zoom with the map? I have seen some apps do that with Google maps, but I don’t see how they did it. Any ideas?</p>
<p>@Ross Kimes: IT IS POSSIBLE IF they are USING GoogleMaps Javascript API. You can overlay polygons, polylines on the map. However, in my tutorial, I am trying not to call any javascript and implemented using ObjC by drawing a geometry on top of the UIViews..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rupert</title>
		<link>/wordpress/2009/10/iphone-devnote-14-drawing-a-point-line-polygon-on-top-of-mkmapview/comment-page-1/#comment-2097</link>
		<dc:creator>rupert</dc:creator>
		<pubDate>Tue, 24 Nov 2009 00:50:22 +0000</pubDate>
		<guid isPermaLink="false">/wordpress/?p=534#comment-2097</guid>
		<description>Didn&#039;t know someone was posting comments. i have enabled comments to show on the sidebar now.. hmm maybe an email alert will be good. 

@justin: i have no quick answer for you mate.. 
1. is it only one touchView or multiple touchViews? i would guess multiple touchViews..
2. for each touchView created. Can you implement different colors for each stroke and fill. so we can see how the polygons will be drawn on top of each other.. Make sure that the path get closed and filled for a polygon... 
&lt;pre lang=&quot;objc&quot;&gt;
	CGContextClosePath(context);
			
	CGContextDrawPath(context, kCGPathFillStroke);
&lt;/pre&gt; 

3. Are you still drawing the points as vertexes of the polygons on top of mapview. If yes, note that viewForAnnotation gets called.

This is interesting.. I will be happy to have a wack at it if time permits..

Regards,
Rupert</description>
		<content:encoded><![CDATA[<p>Didn&#8217;t know someone was posting comments. i have enabled comments to show on the sidebar now.. hmm maybe an email alert will be good. </p>
<p>@justin: i have no quick answer for you mate..<br />
1. is it only one touchView or multiple touchViews? i would guess multiple touchViews..<br />
2. for each touchView created. Can you implement different colors for each stroke and fill. so we can see how the polygons will be drawn on top of each other.. Make sure that the path get closed and filled for a polygon&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">	CGContextClosePath<span style="color: #002200;">&#40;</span>context<span style="color: #002200;">&#41;</span>;
&nbsp;
	CGContextDrawPath<span style="color: #002200;">&#40;</span>context, kCGPathFillStroke<span style="color: #002200;">&#41;</span>;</pre></div></div>

<p>3. Are you still drawing the points as vertexes of the polygons on top of mapview. If yes, note that viewForAnnotation gets called.</p>
<p>This is interesting.. I will be happy to have a wack at it if time permits..</p>
<p>Regards,<br />
Rupert</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ross Kimes</title>
		<link>/wordpress/2009/10/iphone-devnote-14-drawing-a-point-line-polygon-on-top-of-mkmapview/comment-page-1/#comment-1604</link>
		<dc:creator>Ross Kimes</dc:creator>
		<pubDate>Tue, 10 Nov 2009 14:57:23 +0000</pubDate>
		<guid isPermaLink="false">/wordpress/?p=534#comment-1604</guid>
		<description>Is there a way to keep the polygon on the screen when scrolling and have it pan and zoom with the map?  I have seen some apps do that with Google maps, but I don&#039;t see how they did it. Any ideas?</description>
		<content:encoded><![CDATA[<p>Is there a way to keep the polygon on the screen when scrolling and have it pan and zoom with the map?  I have seen some apps do that with Google maps, but I don&#8217;t see how they did it. Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: justin</title>
		<link>/wordpress/2009/10/iphone-devnote-14-drawing-a-point-line-polygon-on-top-of-mkmapview/comment-page-1/#comment-1570</link>
		<dc:creator>justin</dc:creator>
		<pubDate>Mon, 09 Nov 2009 20:52:27 +0000</pubDate>
		<guid isPermaLink="false">/wordpress/?p=534#comment-1570</guid>
		<description>Hey, I\&#039;ve been trying to modify your code to allow multiple polygons to be added simultaneously. I\&#039;m having a problem when drawRect is called however.

I keep an array of all of the custom views for each array so every time regionChanged I will loop through every custom view and let it know it must drawRect. The problem is, the fill disappears on the polygons. Only the most recently drawn polygon retains its fill, all of the previous ones disappear. Any insight or tips? Could there be a problem with multiple internal views layering on each other? (or does clearColor take care of that)

Thanks</description>
		<content:encoded><![CDATA[<p>Hey, I\&#8217;ve been trying to modify your code to allow multiple polygons to be added simultaneously. I\&#8217;m having a problem when drawRect is called however.</p>
<p>I keep an array of all of the custom views for each array so every time regionChanged I will loop through every custom view and let it know it must drawRect. The problem is, the fill disappears on the polygons. Only the most recently drawn polygon retains its fill, all of the previous ones disappear. Any insight or tips? Could there be a problem with multiple internal views layering on each other? (or does clearColor take care of that)</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
