title: Polylines performance issues on GoogleMaps API v2
body: <p>I'm programming an app for android, in which i have to represent certain block facades. For this purpose, i draw a polyline for each relevant block facade (very simple polylines, 2 point lines actually...).</p>
  
  <p>Worst case scenario, there could be up to 100k polylines.</p>
  
  <p>My problem is that i'm running tests with about 3000 lines and it's already really slow. I have no problem with getting the data to show, and no problem drawing the lines, but the map becomes laggy when more than 1k lines are drawn.</p>
  
  <p>I create a PolylineOptions for each polyline, and then draw it and store it in a variable like this:</p>
  
  <pre><code>PolylineOptions options = new PolylineOptions();
  options.add(latlon1, latlon2);
  options.width(5);
  options.color(Color.RED);
  Polyline myPolyline = map.addPolyline(options);
  myPolyline.setVisible(true);
  myPolylines.add(myPolyline);
  </code></pre>
  
  <p>I tried not storing them (though this is necessary for later processing) in case it was a memory issue, but didn't make a difference... Also, when storing them, the rest of the app works fluently (some extra buttons/text fields), it's just the map that becomes slow (when moving/zooming).</p>
  
  <p>Oh, and I'm using mapfragment class of google maps api v2.</p>
  
  <p>So, the question being: Is there any way to improve the map performance?</p>
  
  <p>Thanks in advance.</p>
  
  <p>EDIT: The polylines are all visible at once. To avoid drawing unnecessary lines I added a "previous step" in which i draw circles that represent the amount of facades with the fill color (green to red) and only show the lines when a circle is selected and the user asks for the detailed view.</p>
  
  <p>EDIT2: Here's what i'm trying to accomplish (it's from a mapguide map, but i'm trying to replicate on android) <img src="https://i788.photobucket.com/albums/yy163/chesbor/screenCarasMZ.jpg" alt="facades"></p>