MapInfo Pro Developers User Group

Expand all | Collapse all

Initialy invisible layers in MWS

  • 1.  Initialy invisible layers in MWS

    Posted 02-18-2019 10:02
    Hi,

    I have a problem with layer visibility when opening a MWS workspace via the Run Application command. Even if all layers are set as invisible via the tag <Visibility visible="false"/>, all layers are initially visible and then set to invisible. I can see this in the MapBasic window.

    Since my map is quite large, the result is that layers start to draw and WMS layers starts to fetch images via the network before the layers are set to invisible. This greatly increase the time it takes to open the MWS.

    Opening one of my MWS files take 4 minutes and 10 seconds but if I save it as WOR it only takes 25 seconds to open!

    Is the anything I can do to increase the performance when opening MWS files or is my only solution to write my own MWS to WOR converter?

    Another issue I have with MWS is that MapInfo don't convert MWS expressions to MapBasic expressions. For example, if i have a layer with a label expression containing Chr$(13) MapInfo correctly converts this to Char(13) when saving to MWS. But when i Open the MWS Char(13) is not converted back to Chr$(13) resulting in the MWS fail to open.

    There is also an issue with layers having style override. They need to be visible when opening the MWS. Otherwise the style override is lost.

    Kind Regards
    /Krister

    ------------------------------
    Krister Wicksell
    Sokigo AB
    ------------------------------


  • 2.  RE: Initialy invisible layers in MWS

    Pitney Bowes
    Posted 02-21-2019 13:19
    Hi Krister,

    Unfortunately the MWS workspace format has not been updated in a long time. I believe that originally it was created to allow creating content in Pro that could be opened in MapXtreme apps like Workspace Manager. Hence the ability to convert MapBasic expressions to MI SQL. We did add some support for reading MWS back into Pro, but it did not include the conversion from MI SQL into MapBasic. I'm not aware of any plans to do so either.

    The issue of losing style override info created for an invisible layer is a known issue, even in Pro. However, in Pro you can create new types of style overrides called Display Style Overrides, that retain the style override info even when the base layer and/or the display style override, is hidden. But again, that functionality was not added to MWS.

    As far as the performance, I'm not sure why it would be worse when opening MWS. Even WOR statements first create the map, then set individual layer visibility.  You could log an issue with tech support and we could look into in more detail.  Basically if you're using Pro you're probably better off using WORs instead of MWS for persistence.

    ------------------------------
    Michele Buselli
    PITNEY BOWES SOFTWARE, INC
    ------------------------------



  • 3.  RE: Initialy invisible layers in MWS

    Posted 02-22-2019 03:03
    Hi Michele,

    Thanks for your answer. We develop a tool for integrating Spectrum Spatial with MI Pro. Since Spectrum Spatial uses MWS that would be the easiest way forward but if MI Pro's MWS support is poor we may need to develop our own conversion between WOR and MWS. I will log an issue with tech support.

    Regards
    /Krister

    ------------------------------
    Krister Wicksell
    Sokigo AB
    ------------------------------



  • 4.  RE: Initialy invisible layers in MWS

    Pitney Bowes
    Posted 03-04-2019 15:22
    ​Krister,
    While I have some thoughts about the performance which may be due to when the zoom layer settings are processed, I want to start a discussion on your statement "Since Spectrum Spatial uses MWS..."

    As I think you know, the MWS workspace file is not part of Spectrum Spatial at all. The entities in our repository do share the schema that MWS workspace uses but since there are so many differences between MXT.NET and Spectrum Spatial, that is not a good way to think of it.

    Secondly, as Michele said, the MWS export in Pro is woefully out of date and was developed to ensure compatibility  with a long deceased project. The fact that so many features of MapInfo Pro "disappear" (not represented in the MWS) was why we chose to go a completely different route with the mapuploader that we now use. Customers reasonably objected to missing features and there was no warning for that.
    What we were able to do is to add MapBasic functions that represent pretty much everything in the map that we want to upload. I have never counted the difference between v15 and v16 but it is substantial: Thematics itself was a huge addition and some expression translation is supported for thematics and labels. I am pretty sure Chr$(), for example, converts.
    Actual query tables are a much more difficult process.

    It would be my recommendation for your tool that you look into those functions instead of the MWS.
    As for the server side, we use rest APIs that create the repository entries including doing checking that the Named Resource Service does not do. Currently those are marked as internal but I will work with you and Sokigo so that these can be used and documented as well.
    I am open to discussing this in the community or if you would prefer to have a detail call we can set that up.
    Regards,
    Eric Blasenheim

    ------------------------------
    Eric Blasenheim
    Spectrum Spatial Technical Product Manager
    Troy, NY
    ------------------------------