You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I need consume my GeoJSON which is represent route from my service. GeoJSON looks like this: http://pastebin.com/GJWYNkAq
Here is my function for display GeoJSON in OsmDroid MapView (map variable):
public void viewRoute(String geoJson) {
KmlDocument kmlDocument = new KmlDocument();
kmlDocument.parseGeoJSON(geoJson); //application is crashed here
FolderOverlay myOverLay = (FolderOverlay) kmlDocument.mKmlRoot.buildOverlay(map, null, null, kmlDocument);
map.getOverlays().add(myOverLay);
map.invalidate();
}
For consume my Rest api I am using OkHTTP client, after recieved GeoJSON in string, I pass it into function viewRoute, and I got following issues:
java.lang.ClassCastException: com.google.gson.JsonNull cannot be cast to com.google.gson.JsonObject at com.google.gson.JsonObject.getAsJsonObject(JsonObject.java:191) at org.osmdroid.bonuspack.kml.KmlPlacemark.(KmlPlacemark.java:89) at org.osmdroid.bonuspack.kml.KmlFeature.parseGeoJSON(KmlFeature.java:237) at org.osmdroid.bonuspack.kml.KmlFolder.(KmlFolder.java:62) at org.osmdroid.bonuspack.kml.KmlFeature.parseGeoJSON(KmlFeature.java:235) at org.osmdroid.bonuspack.kml.KmlDocument.parseGeoJSON(KmlDocument.java:1097) at org.osmdroid.bonuspack.kml.KmlDocument.parseGeoJSON(KmlDocument.java:1112) at bachelor.vsb.martin.osmdroidclient.MainActivity.viewRoute(MainActivity.java:137) at bachelor.vsb.martin.osmdroidclient.MainActivity$1.onResponse(MainActivity.java:127) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:761)
The text was updated successfully, but these errors were encountered:
Hi, I need consume my GeoJSON which is represent route from my service. GeoJSON looks like this:
http://pastebin.com/GJWYNkAq
Here is my function for display GeoJSON in OsmDroid MapView (map variable):
For consume my Rest api I am using OkHTTP client, after recieved GeoJSON in string, I pass it into function viewRoute, and I got following issues:
The text was updated successfully, but these errors were encountered: