Did anybody get makeImageRequest() to execute properly and without errors? Would anybody mind posting an example here, and advise where to call it?
class SwissRadarView extends Ui.View {
var bitmap = null;
// .... deleted stuff here
//! Restore the state of the app and prepare the view to be shown
function onShow() {
var url = "meteo.search.ch/.../meteomap_outline.png";
Comm.makeImageRequest(url, {}, method(:onReceive));
}
//! Update the view
function onUpdate(dc) {
// Call the parent onUpdate function to redraw the layout
View.onUpdate(dc);
if (bitmap != null) {
bitmap.draw(dc);
}
}
function onReceive(responseCode, data) {
Sys.println(responseCode);
if (data != null) {
bitmap = data;
Ui.requestUpdate();
}
}