I am getting the following runtime exception when trying to embed images
java.lang.ClassCastException: sun.net.www.protocol.file.FileURLConnection cannot be cast to java.net.HttpURLConnection
at agi.foundation.compatibility.HttpWebRequest.getResponse(HttpWebRequest.java:55) [cs2j.jar:1.0.0.686]
at cesiumlanguagewriter.advanced.CesiumFormattingHelper.downloadUriIntoDataUri(CesiumFormattingHelper.java:135) [cesium-language-writer.jar:]
at cesiumlanguagewriter.advanced.CachingCesiumUriResolver.resolveUri(CachingCesiumUriResolver.java:77) [cesium-language-writer.jar:]
at cesiumlanguagewriter.advanced.CesiumFormattingHelper.getResourceUri(CesiumFormattingHelper.java:525) [cesium-language-writer.jar:]
at cesiumlanguagewriter.UriCesiumWriter.writeUri(UriCesiumWriter.java:118) [cesium-language-writer.jar:]
at cesiumlanguagewriter.BillboardCesiumWriter.writeImageProperty(BillboardCesiumWriter.java:709) [cesium-language-writer.jar:]
The URI passed to writeImageProperty is expected to be an HTTP URL to an online resource. Since you have a local file, you can load the image and pass that to the writeImageProperty which takes a RenderedImage directly:
writeImageProperty(ImageIO.read(new File(yourImageFilename)));
http://docs.oracle.com/javase/7/docs/api/javax/imageio/ImageIO.html#read(java.io.File)
Thank you that got me past that issue.
Now on the client I am getting a syntax error:
[
{
"id":"document",
"version":"1.0"
},
{
"id":"ARCHIVED",
"name":"Archived"
},
{
"id":"result_1_ARCHIVED_2cc6fdc1",
"name":"06/08/15 19:20 38.86 -104.83",
"parent":"ARCHIVED",
"position":{
"cartographicDegrees":[
-104.83135682284703,38.859816201116786,0
]
},
"billboard":{
"image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAlCAYAAAAjt+tHAAABrklEQVR42t2YsarCMBSGO4iDiIOIiINIKR1EikgHcXbuQ5TOXTrU0Vdx8RH6Lj5NPEf+XGJvbZp7m/ZeAx+CTfJ/PYna6AghHOZ0Og2IITEmJsS0ZSaYmzMGMlcNH6HjklgTHuG3hIc5l8gYSQk1fEa4xJYIiUPLhJjbRdZTwkFJprhwiKJI2AQyLjKHDtaFS7PlDmmaivP5LC6XS6vwnDw3JLbIHDvYHLw+IV+0Ea5KQCBE5sRBKTxZflvhEmUZOHMqBfweBPz/JRDH8VvyPO+mAlXtdrs9JXqrADdrAnVlLwuotCpg2nhMlmUvr50LMNfrtXJ5fiVQtwyyJUkiiqJ4GdNpBe73+zfpTgWqluSzK/Dn9oDVT0Ev3wM/4TN/jm0L9PpI1vtDae+P5Y0OJjy4aZgManow0R3NjkxTCeUuj6D+aNbgcLohAmKvk1DC9xiz0R5ONcdzNl0QK0y0eyehhO/Qd4WxM+3xvA6IjTEZ30lQllDCA/RZYMxAN79W4I3EVyVKd24U3ligQsKXe0JZc9803EigJDHHppL/gKzxnlG4sUDFJ2YOXna2CQ95XfQPOIhy8AAAAABJRU5ErkJggg==",
"verticalOrigin":"BOTTOM"
},
"label":{
"text":"06/08/15 19:20 38.86 -104.83",
"show":false
},
"polygon":{
"fill":true,
"outline":true,
"outlineColor":{
"rgba":[
102,178,255,255
]
},
"material":{
"solidColor":{
"color":{
"rgba":[
102,178,255,127
]
}
}
},
"positions":{
"cartographicDegrees":[
-104.87847885606344,38.89679561146222,0,-104.7842347896306,38.89679561146222,0,-104.7842347896306,38.82283679077136,0,-104.87847885606344,38.82283679077136,0
]
}
}
}
]
I am not seeing what the issue is here....