title: OSMDroid PathOverlay not appearing
body: <p>I'm trying to add a path overlay to an OSMDroid map and it is not appearing. What am I missing?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I figured out it has something to do with the tile size. I set the size to 512 even though the tiles are 256 otherwise the maps are too small to read on high pixel density screens. If I change the size to 256, the path displays. If I change it back to 512, it doesn't display.</p>
  
  <pre><code>public class MainActivity extends Activity {
  
      // set this to 256 for actual tile size, 512 to show larger and cause PathOverlay to not be displayed
      int tileSize = 512; 
  
      private MapView mapView;
  
      // area of offline tiles
      double north = 40.739063;
      double south =  40.708361;
      double west  =  -73.967171;
      double east  =  -73.936272;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
  
          super.onCreate(savedInstanceState);
  
          // center of offline tiles
          double centerlat = (double) ((north+south)/2);
          double centerlon = (double) ((west+east)/2);
  
          // copy tiles to sd location for offline map
          putMapOnSD();
  
          // create mapView and show layout
          mapView = new MapView(this,tileSize);
          final LinearLayout layout = new LinearLayout(this);
          final LinearLayout.LayoutParams mapViewLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT);
          layout.addView(mapView, mapViewLayoutParams);
          setContentView(layout);
  
          // set map to use offline tiles and display
          mapView.setTileSource  (new XYTileSource ("tiles", ResourceProxy.string.offline_mode, 13, 17, tileSize, ".png", "http://127.0.0.1")); 
          mapView.setUseDataConnection(false);
          mapView.setClickable(false);
          mapView.setMultiTouchControls(true);
          mapView.setBuiltInZoomControls(false);
          mapView.getController().setZoom(15);
          mapView.getController().setCenter(new GeoPoint(centerlat,centerlon));
  
          // show pathOverlay
          PathOverlay pathOverlay = new PathOverlay(Color.RED, this);
          pathOverlay.addPoint(new GeoPoint(centerlat,centerlon));
          centerlat += 0.005;
          pathOverlay.addPoint(new GeoPoint(centerlat,centerlon));
          centerlon += 0.005;
          pathOverlay.addPoint(new GeoPoint(centerlat,centerlon));
          pathOverlay.getPaint().setStrokeWidth(10.0f);
          mapView.getOverlays().add(pathOverlay);
  
          // refresh map, is this needed?
          mapView.invalidate();
      }
  
  
      // this copies the offline tiles to the proper location for OSMDroid to use them offline
      private void putMapOnSD() {
          // see GitHub for this
      }
  }
  </code></pre>
  
  <p>Get the full project on GitHub. <a href="https://github.com/tomkincaid/PathExample" rel="nofollow">https://github.com/tomkincaid/PathExample</a></p>
  
  <p>I solved this problem by using @2x tiles from Cloudmade, so I didn't have to use the 512 pixel size for high density screens. The basic issue still exists though in case anyone wants to investigate.</p>