java - OSM map, custom tile source is not used -
i have following code:
public class mainactivity extends activity { mapview map; xytilesource customtilesource; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); map = (mapview) findviewbyid(r.id.mapview); map.setmultitouchcontrols(true); map.setmaplistener(new mymaplistener()); itilesource tilesource = tilesourcefactory.mapnik; string tileurl[] = {"https://bla_bla_bla__don't wanna show here"}; customtilesource = new myxytilesource("point", null, 8, 18, 256, ".png", tileurl); map.settilesource(customtilesource); geopoint startpoint = new geopoint(47.021461, 28.86383); imapcontroller mapcontroller = map.getcontroller(); mapcontroller.setcenter(startpoint); mapcontroller.setzoom(10); mapeventsoverlay eventsoverlay = new mapeventsoverlay(this, new mymapeventslistener()); map.getoverlays().add(eventsoverlay); } private class mymaplistener implements maplistener { @override public boolean onscroll(scrollevent event) { return false; } @override public boolean onzoom(zoomevent event) { log.d("atf", "zoom level is: " + event.getzoomlevel()); return true; } } private class mymapeventslistener implements mapeventsreceiver { @override public boolean singletapconfirmedhelper(geopoint p) { log.d("atf", "taped on long="+p.getlongitude()+" lat="+p.getlatitude()); return true; } @override public boolean longpresshelper(geopoint p) { return false; } } private class myxytilesource extends xytilesource { public myxytilesource(string aname, resourceproxy.string aresourceid, int azoomminlevel, int azoommaxlevel, int atilesizepixels, string aimagefilenameending, string[] abaseurl) { super(aname, aresourceid, azoomminlevel, azoommaxlevel, atilesizepixels, aimagefilenameending, abaseurl); } @override public string gettileurlstring(maptile atile) { string tileurl = super.gettileurlstring(atile); log.d("atf", "tile url string: "+tileurl); return tileurl; } } }
the purpose of use custom tiles display map. working fine. except case when code runs on "samsung galaxy ace 3". maybe there other devices same issue.
for zoom levels lower 17, doesn't load custom tiles. starts loading them when zoom goes above 17.
can please explain me why?
sorry, forgot specify: when new tiles not loaded, old ones loaded (from default tile source). map not blank.
check logcat exception, maybe there lot of outofmemoryerror
. if so, need fine tuning app memory usage.
Comments
Post a Comment