MapInfo Pro

 View Only
  • 1.  Map Scale Smart Text

    Posted 05-20-2022 13:45
    When using Smart Text to display map scale in a layout, are there any formatting options available?  I have a set of maps that I'm printing at 1"=60' and sometimes the text displayed will change to will change to something like 1"=60.0000012'.  Can you format it to only display whole numbers?

    ------------------------------
    Jim
    ------------------------------


  • 2.  RE: Map Scale Smart Text

    Employee
    Posted 05-23-2022 08:34
    Jim

    What Smart Text are you using? Can you share the expression?

    I tried configuring a couple of SmartText to display the scale.

    The top one is showing the cartographic scale and the bottom one is showing the map scale

    The expressions for the two examples are like this:
    ${MapCartographicScale}: referring to a SmartText alias for this expression: $mb{"Scale: " + MapperInfo(LayoutItemWinID(CurContext(1), 1, LAYOUT_ITEM_TYPE_MAPPER), MAPPER_INFO_CARTO_SCALE_EXPR)}

    and this custom SmartText expression:
    $mb{"1 cm = " + MapperInfo(LayoutItemWinID(CurContext(1), 1, LAYOUT_ITEM_TYPE_MAPPER), MAPPER_INFO_SCALE) + " " +MapperInfo(LayoutItemWinID(CurContext(1), 1, LAYOUT_ITEM_TYPE_MAPPER), MAPPER_INFO_DISTUNITS)}

    The second expression, I can improve to round the value to the nearest integer and format using my regional settings:
    $mb{"1 cm = " + FormatNumber$(Round(MapperInfo(LayoutItemWinID(CurContext(1), 1, LAYOUT_ITEM_TYPE_MAPPER), MAPPER_INFO_SCALE), 1)) + " " +MapperInfo(LayoutItemWinID(CurContext(1), 1, LAYOUT_ITEM_TYPE_MAPPER), MAPPER_INFO_DISTUNITS)}

    Please note that my expression expects you to use cm as your paper units. If you are using different units, change it to the appropriate units in the string, such as inch:
    $mb{"1 in = " + FormatNumber$(Round(MapperInfo(LayoutItemWinID(CurContext(1), 1, LAYOUT_ITEM_TYPE_MAPPER), MAPPER_INFO_SCALE), 1)) + " " +MapperInfo(LayoutItemWinID(CurContext(1), 1, LAYOUT_ITEM_TYPE_MAPPER), MAPPER_INFO_DISTUNITS)}

    Would this work for you too?

    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 3.  RE: Map Scale Smart Text

    Posted 05-23-2022 08:44

    I used the samples in the MapInfo Pro User Guide:

     

    Scale 1 in = $mb{MapperInfo(LayoutItemInfo(CurContext(1), "Main Map",
    5), 2)} $mb{MapperInfo(LayoutItemInfo(CurContext(1), "Main Map", 5),
    12)}

     

    And this one.

     

    Scale 1 in = $mb{MapperInfo(LayoutItemWinID(CurContext(1), "Main Map",
    1), 2)} $mb{MapperInfo(LayoutItemWinID(CurContext(1), "Main Map", 1),
    12)}

     

    I had originally used the one for cartographic scale, but I need to use map scale, as everyone is used to seeing 1" = xxx ft on all of our maps.

     

    Thanks,

    Jim

     






  • 4.  RE: Map Scale Smart Text

    Posted 05-23-2022 09:22

    The rounding works great, until I run Site Mapper.  It seems to still want to force it to miles, instead of ft like the map is set to, so it rounds to 0 when printing.  I don't want you to keep spending time on it though, we can just use static text to display our scale and stick with printing one scale at a time.  I really appreciate your assistance though, and for letting me know about Site Mapper. 

     

    Jim

     






  • 5.  RE: Map Scale Smart Text

    Employee
    Posted 05-24-2022 02:28
    Hi Jim

    Two things:
    1. Can you verify that the distance unit is still feet on the map in the frame? Just wanted to make sure that the SiteMapper tool doesn't change that by mistake
    2. What version of MapInfo Pro are you using? I recall we had some issues with SmartText referencing windows where it sometimes changed from one window to another. That should have been fixed in the latest version of MapInfo Pro, v2021.1.

    Thanks

    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 6.  RE: Map Scale Smart Text

    Posted 05-24-2022 10:10

    I'm using v2021.1.  I can't check, because it only changes to miles during the printing process.  Once it's done, I check the map options and it is in feet, but also the smart text goes back to showing ft too.  Seems like Site Mapper is forcing a temporary change to miles, while it prints.

     

    Thanks,

    Jim