Tile cache in osmdroid

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Tile cache in osmdroid

Postby ophidian » Sat Apr 23, 2011 2:08 pm

Hi,

I currently have a weather application that displays overlays in different views (rain, sun, etc) over an osmdroid map.

However, using this code:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. _mapView = (MapView)findViewById(R.id.mapview);
  2. _mapView.setBuiltInZoomControls(true);
  3. _mapView.setMultiTouchControls(true);
  4. _mapView.getController().setZoom(9);
  5. _mapView.getController().setCenter(new GeoPoint(30820000, 2050000));
  6.  
  7. ITileSource src = new QuadTreeTileSource ("TS", null, 3, 18, 256, "", "http://mytilesource.com?layers=interactive&mode=tile&tilemode=ve&tile=");
  8. this._mapTileProviderBasic = new MapTileProviderBasic(getApplicationContext(), src);
  9. this._tilesOverlay = new TilesOverlay(_mapTileProviderBasic, this.getBaseContext());
  10. this._tilesOverlay.setUseDataConnection(true);
  11. _mapView.getOverlays().add(this._tilesOverlay);
  12.  
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


It works very nicely. However, the ITileSource is also cached for a very long period, and it should refresh every hour or maybe not cache at all.

It would seem very performant if this could be kept in a memorycache instead of saving it to disk.

Does anyone know how I can configure this maptileprovider to not cache its data? or to set it to a smaller value?

Thanks in advance. This is a blocking issue for me at the moment and I've been staring at the osmdroid code but I must be blind, because i really cant find the link.
ophidian
Freshman
Freshman
 
Posts: 2
Joined: Thu Apr 21, 2011 7:54 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 2 guests