Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

» View demos
» Downloads

Uudised

Viimane: Thu, 15 Mar 2012 14:51:08
Teema: Vabad töökohad pakkuda
Veel uudiseid »

DbStoredMap problem

5 replies [Last post]
Nole
User offline. Last seen 2 weeks 4 days ago. Offline
Joined: 03/07/2011

I want to use DbStoredMap and when I run below code I see red screen.

mapComponent = new BasicMapComponent("tutorial", new AppContext(this),
1, 1, new WgsPoint(26.728878, 58.377959), 13); // Tartu

tileDb = new AndroidMbTilesDatabase(this,
"/sdcard/tartu_osm_mbtiles.db");
tileDb.initialize();

mapComponent.setTileDatabaseSystem(tileDb);

mapComponent.setMap(new DbStoredMap(new StringCopyright(
"OpenStreetMap (MBTiles)")));


Here is a log:


01-01 12:23:29.412: I/ActivityThread(24989): queueIdle
01-01 12:23:29.412: V/ActivityThread(24989): Reporting idle of ActivityRecord{4a50d268 token=android.os.BinderProxy@4a50cde8 {com.nutiteq/com.nutiteq.Nutiteq}} finished=false
01-01 12:23:29.412: W/ActivityNative(24989): send ACTIVITY_IDLE_TRANSACTION
01-01 12:23:30.452: W/KeyCharacterMap(24989): No keyboard for id 65536
01-01 12:23:30.452: W/KeyCharacterMap(24989): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
01-01 12:23:54.582: D/MILAN(24989): init all tile dbs
01-01 12:23:54.612: D/MILAN(24989): init all tile dbs
01-01 12:23:54.642: D/MILAN(24989): Read from db db://13/4704/2451
01-01 12:23:54.652: D/TileDatabaseHelper(24989): containsKey execution time 3
01-01 12:23:54.652: E/MILAN(24989): Could not retrieve db://13/4704/2451
01-01 12:23:54.652: D/MILAN(24989): Read from db db://13/4704/2451
01-01 12:23:54.772: E/Database(24989): close() was never explicitly called on database '/sdcard/tartu_osm_mbtiles.db'
01-01 12:23:54.772: E/Database(24989): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here
01-01 12:23:54.772: E/Database(24989): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1919)
01-01 12:23:54.772: E/Database(24989): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:883)
01-01 12:23:54.772: E/Database(24989): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:960)
01-01 12:23:54.772: E/Database(24989): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:953)
01-01 12:23:54.772: E/Database(24989): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:548)
01-01 12:23:54.772: E/Database(24989): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203)
01-01 12:23:54.772: E/Database(24989): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)
01-01 12:23:54.772: E/Database(24989): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:158)
01-01 12:23:54.772: E/Database(24989): at com.nutiteq.db.AndroidTileDatabaseHelper.open(Unknown Source)
01-01 12:23:54.772: E/Database(24989): at com.nutiteq.db.AndroidMbTilesDatabase.initialize(Unknown Source)
01-01 12:23:54.772: E/Database(24989): at com.nutiteq.Nutiteq.onCreate(Nutiteq.java:37)
01-01 12:23:54.772: E/Database(24989): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-01 12:23:54.772: E/Database(24989): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2633)
01-01 12:23:54.772: E/Database(24989): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2685)
01-01 12:23:54.772: E/Database(24989): at android.app.ActivityThread.access$2300(ActivityThread.java:126)
01-01 12:23:54.772: E/Database(24989): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2038)
01-01 12:23:54.772: E/Database(24989): at android.os.Handler.dispatchMessage(Handler.java:99)
01-01 12:23:54.772: E/Database(24989): at android.os.Looper.loop(Looper.java:123)
01-01 12:23:54.772: E/Database(24989): at android.app.ActivityThread.main(ActivityThread.java:4633)
01-01 12:23:54.772: E/Database(24989): at java.lang.reflect.Method.invokeNative(Native Method)
01-01 12:23:54.772: E/Database(24989): at java.lang.reflect.Method.invoke(Method.java:521)
01-01 12:23:54.772: E/Database(24989): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
01-01 12:23:54.772: E/Database(24989): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
01-01 12:23:54.772: E/Database(24989): at dalvik.system.NativeStart.main(Native Method)
01-01 12:23:54.782: D/TileDatabaseHelper(24989): containsKey execution time 124
01-01 12:23:54.912: E/MILAN(24989): Could not retrieve db://13/4704/2451
01-01 12:23:54.962: I/ActivityThread(24989): queueIdle
01-01 12:23:54.962: V/ActivityThread(24989): Reporting idle of ActivityRecord{4a531f90 token=android.os.BinderProxy@4a531b10 {com.nutiteq/com.nutiteq.Nutiteq}} finished=false
01-01 12:23:54.962: W/ActivityNative(24989): send ACTIVITY_IDLE_TRANSACTION
01-01 12:23:54.972: D/MILAN(24989): Read from db db://13/4704/2451
01-01 12:23:54.972: D/TileDatabaseHelper(24989): containsKey execution time 3
01-01 12:23:54.972: E/MILAN(24989): Could not retrieve db://13/4704/2451
01-01 12:23:54.972: D/MILAN(24989): Read from db db://13/4704/2450
01-01 12:23:54.982: D/TileDatabaseHelper(24989): containsKey execution time 7
01-01 12:23:54.982: E/MILAN(24989): Could not retrieve db://13/4704/2450
01-01 12:23:54.982: D/MILAN(24989): Read from db db://13/4703/2451
01-01 12:23:54.992: D/TileDatabaseHelper(24989): containsKey execution time 2
01-01 12:23:54.992: E/MILAN(24989): Could not retrieve db://13/4703/2451
01-01 12:23:54.992: D/MILAN(24989): Read from db db://13/4703/2450
01-01 12:23:55.002: D/TileDatabaseHelper(24989): containsKey execution time 7
01-01 12:23:55.002: E/MILAN(24989): Could not retrieve db://13/4703/2450
01-01 12:23:55.002: D/MILAN(24989): Read from db db://13/4704/2451
01-01 12:23:55.012: D/TileDatabaseHelper(24989): containsKey execution time 3
01-01 12:23:55.012: E/MILAN(24989): Could not retrieve db://13/4704/2451
01-01 12:23:55.012: D/MILAN(24989): Read from db db://13/4704/2450
01-01 12:23:55.022: D/TileDatabaseHelper(24989): containsKey execution time 4
01-01 12:23:55.022: E/MILAN(24989): Could not retrieve db://13/4704/2450
01-01 12:23:55.022: D/MILAN(24989): Read from db db://13/4703/2451
01-01 12:23:55.022: D/TileDatabaseHelper(24989): containsKey execution time 2
01-01 12:23:55.022: E/MILAN(24989): Could not retrieve db://13/4703/2451
01-01 12:23:55.022: D/MILAN(24989): Read from db db://13/4703/2450
01-01 12:23:55.032: D/TileDatabaseHelper(24989): containsKey execution time 4
01-01 12:23:55.032: E/MILAN(24989): Could not retrieve db://13/4703/2450
01-01 12:23:55.032: D/MILAN(24989): Read from db db://13/4704/2451
01-01 12:23:55.042: D/TileDatabaseHelper(24989): containsKey execution time 2
01-01 12:23:55.042: E/MILAN(24989): Could not retrieve db://13/4704/2451
01-01 12:23:55.072: D/MILAN(24989): Read from db db://13/4704/2450
01-01 12:23:55.122: D/TileDatabaseHelper(24989): containsKey execution time 2
01-01 12:23:55.122: E/MILAN(24989): Could not retrieve db://13/4704/2450
01-01 12:23:55.122: D/MILAN(24989): Read from db db://13/4703/2451
01-01 12:23:55.132: D/TileDatabaseHelper(24989): containsKey execution time 5
01-01 12:23:55.132: E/MILAN(24989): Could not retrieve db://13/4703/2451
01-01 12:23:55.132: D/MILAN(24989): Read from db db://13/4703/2450
01-01 12:23:55.132: D/TileDatabaseHelper(24989): containsKey execution time 2
01-01 12:23:55.142: E/MILAN(24989): Could not retrieve db://13/4703/2450



I try DB from https://bitbucket.org/nutiteq/android-map-samples/downloads and also I download myself, but the result is the same red screen...

jaak
User offline. Last seen 4 days 19 hours ago. Offline
Joined: 06/19/2008

This log tells that there are just no tiles for requested place and zoom. You can check it by opening the file with some sqlite GUI client, and running following query: select tile_column,tile_row from tiles where tile_column=4703 and tile_row=2450 and zoom_level=13 . If this gives no results, then there is no content. I'll upload couple of better sample DB-s to same place, it is also possible that this initial one was broken as some early versions had a bit wrong format.

/JaakL

Nole
User offline. Last seen 2 weeks 4 days ago. Offline
Joined: 03/07/2011

I try OSM_world_0_7 from bitbucket, but it has strange behavior. It doesn't draw properly. Here are some screen capture:

http://imageshack.us/photo/my-images/217/93910507.png/
http://imageshack.us/photo/my-images/109/42014289.png/
http://imageshack.us/photo/my-images/62/79338644.png/
http://imageshack.us/photo/my-images/27/51282398.png/


When I download world map with Mobile Atlas Creator I only see red screen. How you download MBtiles?

jaak
User offline. Last seen 4 days 19 hours ago. Offline
Joined: 06/19/2008

It looks like there is different Y axis orientation. Please take latest SDK jar from http://www.nutiteq.com/beta/lib/ . It could be that the older (release) version has it wrong way.

/JaakL

Nole
User offline. Last seen 2 weeks 4 days ago. Offline
Joined: 03/07/2011

When I am using 1.1.2a I only see red screen. Than I only change in project to use 1.1.1 stable release and I see tiles but they are not properly drawn like I said. I use open-streets-dc_de5d6a.mbtiles.db from bitbucket. Probably you use some other release which is not on http://www.nutiteq.com/beta/lib/

jaak
User offline. Last seen 4 days 19 hours ago. Offline
Joined: 06/19/2008

Yes, possibly. Try the latest one from https://bitbucket.org/nutiteq/android-map-samples/src

/JaakL