Offline Java SDK - map doesn' seem to load

805
1
07-14-2020 03:25 AM
JaapVriend
New Contributor

Hi!

(Initial question is updated.)

I'm looking to get a simple sample screen up-and-running to evaluate the Java SDK, but find that an "empty" window pops up only informing "Powered by Esri" in the lower right of the screen and nothing actually loads (indicator just keeps on rotating) and apparently, there's a load error (LoadStatusChangedListener informs on this).

Specific causes encountered:

java.net.UnknownHostException: server.arcgisonline.com

java.net.UnknownHostException: services.arcgisonline.com: Name or service not known

Since I'm running offline, this makes sense. Further investigation points to the fact that the basemap supplied when creating the ArcGISMap instance requires a connection to arcgisonline.com in case of e.g. Basemap.createLightGrayCanvas(). Is there a simple low-detail base map that can be loaded from file, maybe?

Moving forward for now with a local GeoServer instance and looking for the right format URL to supply when creating the ArcGISMap. (Initial attempts yield "Unable to instantiate ArcGISMap from this webMapUrl".)

Any tips / alternative approach / sample code as to how to proceed or get more extensive logging is appreciated.

Cheers!

0 Kudos
1 Reply
Rachael_Ellen
Esri Contributor

Hello,

Thank you for your question. The `Basemap`s that you refer to do indeed require an internet connection as you suspected, and so would not display on an offline device, unless they had been taken offline previously. We have a number of workflows available for this, and I have included some resources below which should help you with the problems you are having above. 

There is a detailed working with offline guide on our ArcGISRuntime for Java SDK web pages that will be of interest to you. We also have a range of samples available on our Java samples Github repo.

Specifically the following samples should be of interest to you:

As for Geoserver, you can configure it to provide a WMS or WFS service which can then be consumed within Runtime. Again we have sample code available for the workflow for this under our Open Geospatial Consortium section in the repo. 

I hope that helps you get your maps offline and with your evaluation of the SDK! 

Rachael

0 Kudos