Select to view content in your preferred language

Can we load mbtiles using arcgis runtime sdk?

2275
9
09-09-2020 12:22 AM
GirishchandraY
Emerging Contributor

Hello Team,

Can we load .mbtiles as basemaps?

Thanks,

Girish

0 Kudos
9 Replies
MartonFeigl
Esri Contributor

Hello Girish,

Thank you for getting in touch! Unfortunately, we do not support the .mbtiles format out of the box.

However, the ImageTiledLayer class can be extended to support this format; and this can be done both in C++ and QML:

ImageTiledLayer Class | ArcGIS for Developers 

ImageTiledLayer QML Type | ArcGIS for Developers 

Alas, we do not seem to have a sample that showcases this behaviour but it is feasible within ArcGIS, as I found an Android sample, written in Java, which does make use of an .mbtiles format: Local MBTiles | ArcGIS for Developers 

Please note that the handling of the SQLite datafile reading has to be implemented on your side.

Hope this helps,
Marton

0 Kudos
GirishchandraY
Emerging Contributor

Thank you for your reply ...I was referring to that only but map is not properly being loaded .

Problems are as below,

1) The android app using TiledServiceLayer

whereas in arcgis runtie for qt I am using  ImageTiledLayer

2)Android app says The class exposes a protected abstract method, getTile(), to fetch tiles. This sample extends this class and implements the getTile() method to create a layer by fetching MBTiles from a SQLite database.

whereas Whereas ImageTiledLayer in qt arcgis runtime has no such method.

Thanks,

Girish

0 Kudos
MartonFeigl
Esri Contributor

Hello Girish,

Thanks for your reply. I had a look into it and sure enough the Java sample is an old 10.2.x version; currently in our 100.x we do thing differently.

The ImageTiledLayer class can still be subclassed, within which you would connect to the tileRequest signal. This signal is emitted when tiles are requested and inside its callback the following three functions can be called: setNoDataTile, setTileData, and setTileError. This setTileData function is the one which updates the tiles to the ones which are extracted from the mbtiles file.

Hope this help,

Marton

0 Kudos
GirishchandraY
Emerging Contributor

Hello Marton,

Thank you for your reply I am really happy to see it is possible.

I am currently using same methods...

I am trying to load world_countries.mbtiles which are provided as sample

Can you please check attached code  and output images of same where tiles are not properly displayed.

Thank you,

Girish

0 Kudos
MartonFeigl
Esri Contributor

Hello Girish,

Looks like you're on the right track, as the tiles are displaying well enough; now you will just need to determine why the tiles are not displaying in the correct location.

Glad to see you're getting close,

Marton

0 Kudos
GirishchandraY
Emerging Contributor

Hello Marton,

Could you identify what can be reason?

 

I am unable to identify exact reason.

Would you like to suggest something.

Thank you,

Girish

0 Kudos
MartonFeigl
Esri Contributor

Hello Girish,

I took a quick look and didn't notice anything blatantly wrong in your code. It might be worth reaching out to support services (Esri Support | ArcGIS Technical Support ) so to get some assistance troubleshooting and to see if you are encountering a bug in the software.

Kind regards,

Marton

0 Kudos
GirishchandraY
Emerging Contributor

Is it a kind of bug in QT SDK? Should raise issue in github?

0 Kudos
MartonFeigl
Esri Contributor

Hello Girish,

It is unclear whether it is a bug in the app code or in the Runtime SDK. My recommendation is that you contact Esri Support Services (Esri Support | ArcGIS Technical Support ) to help you make that determination, as I unfortunately don't have the bandwidth to further troubleshoot the issue myself.

0 Kudos