title: Drawing World Map - Performance & Interaction - iOS
body: <p>I’d like to use a Shapefile to generate an interactive world map.  I was able to import the data and use CG Paths to draw the map into one large view.</p>
  
  <p>The map needs to support panning, zooming and touch interaction.  For that, I've created a UIScrollView and placed the MapView (large view with all of the countries drawn) into it.</p>
  
  <p>I need to improve two aspects of it:</p>
  
  <h2>Performance / rendering</h2>
  
  <p>I have drawn the map much larger than the screen size, in order to make it look reasonable when I zoom in.  There are a few problems with this.  First, when I'm zoomed out, I need the border stroke/line to be wider so they are visible.  When I zoom in, I'd like the stroke to be a thinner.  Also, when I zoom in, I can still see that the map is a blurry.  I don't want to increase the view size too much.</p>
  
  <p>How can I make the map look crisp when I'm zoomed in?  I attempted to redraw the map on zoom in, but it takes far too long.  Can I somehow only re render onscreen stuff?</p>
  
  <h2>Touch Interaction</h2>
  
  <p>I need to be able to have a touch event for every different country.</p>
  
  <h2>Possible approach?</h2>
  
  <p>I was thinking of trying to separate every country onto it’s own view.  That should make touches easy to handle.  Then I’m thinking I can possibly redraw the appropriate views that are on screen/zoomed to.</p>
  
  <p>I've played with an app that does something similar ("World Maps"), and I can see that when you pan or zoom, the map is blurry for a second but then becomes clear.  What is going on there?</p>