MapInfo Pro Developers User Group

Expand all | Collapse all

Layout Timing Problems

  • 1.  Layout Timing Problems

    Posted 03-04-2019 07:00
    Working with MiPro 17.02

    Hi there,

    i'm really astonished by the behaviour of layouts and the "Save window As" mapbasic command.

    I'm still working on a simple mapbasic script that tries to output some layouts in different papersizes automaticaly via "Save window as".
    The displayed maps on all layouts contain clearly visible labels, but when saved with "Save window as" in the mapbasic program these labels wont be drawn.
    When i stop the program inbetween right after the issued "Save window As" command in one of these layouts and just copy & paste the same "save window as" command line from the mapbasic program to the mapbasic window, - the resulting image contains the labels, but the image produced by the script, does not.
    It looks, as if something wasn't finished, maybe drawing when the "Save window as" command was fired by the program, and so the labels were present when issuing the same command just some seconds later through the mapbasic window again.

    i tried to change Map-Redraw behaviour and/or Event processing but that made things worse: sometimes the labels appeared, sometimes not, and most funny; sometimes the labels were present only in every second image.

    I finally changed the mapbasic program to contain some sleep-cycles while preparing and saving each layout

    Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As integer)

    call sleep(500)

    without any other changes in code,
    and now i managed that all labels are present in the automatically saved images.

    The same lines of code worked in 32-Bit MiPro without any hicups, without any sleep-cycles and in a third of the time needed now.

    How do i find out, how long the program should wait, - and for what?


  • 2.  RE: Layout Timing Problems

    Posted 03-05-2019 09:10
    Hi Stefan,

    I saw your post yesterday and tried unsuccessfully to reproduce it. Has anyone from tech support reached out to you yet?  I thought they were going to but I will forward your post to them; I'd like to get more details and possibly some data to understand the issue you're having.


    Michele Buselli

  • 3.  RE: Layout Timing Problems

    Posted 03-05-2019 12:35
    Hi Michele,

    i usually try to create a testcase for tech support at once but i'm honestly getting tired in doing so.

    In this specific case the map has a background seamless table with many TIFF-Tiles loaded, displayed in greyscale. On my reasonable fast machine, only panning or zooming of the layout takes 5 - 10 seconds, - it feels extremly slow.
    I guess you would have to reproduce such an environment, were the time to finish the map display takes really long. In this case, i have 8 layers displayed on top of this background layer and 3 of them contain auto lables.

    In between the customer could verify, that with this modifications the lables are getting drawn in the output image as well.
    But he is far from happiness, cause now the printouts take 50% more time.

    Thanks for looking into this


  • 4.  RE: Layout Timing Problems

    Posted 03-06-2019 03:57

    I recall we had some similar issues with a tool called SiteMapper created by Kalu. It also had issues rendering the labels before printing.
    There is a thread on it here: Any plan to reinstate MapShop-like functionality.

    Reading thru it, Steven says that he had better luck using the tool with a map embedded in a layout that with a stand-alone map window.. Kalu rasied this with tech support and there is an open case: JIRA MCS-6192. Apparently we struggle to reproduce this on our side.

    Peter Horsbøll Møller
    Pitney Bowes

  • 5.  RE: Layout Timing Problems

    Posted 03-12-2019 10:29
    Thanks for pointing this out Peter. I've actually been able to reproduce JIRA MCS-6192 using the simple data set attached by Tech Support, so I'll update it accordingly.  Perhaps we can use this data set to help Stefan.

    Michele Buselli