CIQ 3.0 - MapView - Ui.requestUpdate ?

Former Member
Former Member
Hi,

How will Ui.requestUpdate() work?
Currently - what I observed with fresh beta 5X firmware is that
- Map is not refreshed (better to not refresh of course…)
- Text are transparent (which is fine)
- Each new text overlap on the old one - meaning - I'd need to clear (?) background manually to place new text (loosing automatically transparency)?
Specifically at the last point have no idea how to handle now

My current onUpdate looks like:

function onUpdate(dc) {

MapView.onUpdate(dc);

new Ui.Text(….).draw(dc);
}


I know - this is beta - so nothing to worry about - maybe this is more a bug report? :)
  • StachUman

    Ui.requestUpdate() would trigger 2 things
    • It will trigger MapView.onUpdate() function which will receive a clean dc to draw the application content.
    • It will only refresh the map if there has been any change in the map content, like a new marker is added or changes in the polyline points or map area is changes. with no change in the map data, Ui.requestUpdate() will not trigger a map refresh cycle.
    I will investigate these issues. Can you able to share a sample code/app that are causing these issues?

    Anshul
  • Former Member
    Former Member
    Hi,

    This is fortunately easy to reproduce - lets take MapSample from your examples and modify it as follow :

    1. add global variable into MapSampleMapView
    var myText = "Hello World";

    2. add function to MapSampleMapView:
    function changeText(text) {
    myText = text;
    Ui.requestUpdate();
    }

    3. change in onUpdate from direct text to draw myText

    4. add to MapSampleMapDelegate handler:
    function onNextPage() {
    mView.changeText("Something");

    return true;
    }

    Now just press 'prev page' to observe one text overlying on the other
    Hopefully did not miss anything… and you can reproduce that.

    Of course in Simulator everything works fine - as there is no transparency.

    Thanks!
  • StachUman

    I can able to reproduce the bug on the device, the onUpdate() should not have been called that often and the dc object that got passed to the onUpdate() function should have been cleared. I will create a ticket to investigate on this issue.
  • Former Member
    Former Member
    Thank you :)
    Thanks for comments as well