MapInfo Pro

Expand all | Collapse all

Scale Bar layout

  • 1.  Scale Bar layout

    Posted 19 days ago
    Is there a way in which you can show the Cartographic Scale on a layout without the actual scalebar being displayed? I wondered if there was a smarttextalias that I could add to the xml to be able to bring this out in isolation of the scalebar.

    ------------------------------
    Alan Leach
    Suffolk County Council

    ------------------------------


  • 2.  RE: Scale Bar layout

    Moderator
    Posted 19 days ago
    Edited by Susan Bardet 19 days ago
    Hello Alan,

    Yes, it is possible to do this with SmartText. Insert a text box in your layout and add the following code:

    Scale: 1 $mb{SessionInfo(4)} = $mb{MapperInfo(LayoutItemInfo(CurContext(1), "Map-1", 5), 2)} $mb{MapperInfo(LayoutItemInfo(CurContext(1), "Map-1", 5), 12)}

    Please note that the layout frame in the above code is called "Map-1". You can name your frame anything, to give your frame a name right click the frame and select frame properties.

    Next activate the layout frame by double clicking on it and then right click and select 'Change View', then select the desired Cartographic scale. The scale gets automatically updated within the SmartText box with the scale selected in the Change View dialog box. Also, please ensure that you have set your paper and distance units as desired by going into Options / System Settings.

    Peter Horsbøll Møller has done an excellent webinar on SmartText in Layouts, here is the Link.

    I hope this helps.


    ------------------------------
    Susan Bardet
    Software & Data support EMEA
    susan.bardet@pb.com

    Pitney Bowes
    Davidson House, Forbury Square
    Reading RG1 3EU
    Berkshire, United Kingdom
    pitneybowes.com
    ------------------------------



  • 3.  RE: Scale Bar layout

    Posted 19 days ago
      |   view attached
    Thanks very much for this Susan all very useful, enjoyed the webinar, I have had a play this and still cannot get the cartographic Scale from the view to be displayed, may be obvious but I cannot see it! Ideally we want to just output 'Scale1:5,000' as displayed with the scale bar rather than a value per unit.
    Thanks

    ------------------------------
    Alan Leach
    Suffolk County Council
    LOWESTOFT
    ------------------------------

    Attachment(s)

    docx
    layout_scale.docx   102K 1 version


  • 4.  RE: Scale Bar layout

    Pitney Bowes
    Posted 19 days ago
    Hi Alan,

    Try this:
    $mb{MapperInfo(LayoutItemInfo(CurContext(1), "Map-1", 5), 33)}

    The "33" corresponds to the following MapperInfo attibute:
      Define MAPPER_INFO_CARTO_SCALE_EXPR 33

    For a bit more explanation, here's a quick breakdown of the above statement:

    CurrContext() is a special statement to be used with Smart Text statements.
    The "1" will get you the current layout window ID.
      Define CONTEXT_WINDOWID 1

    LayoutItemInfo() will get you the map frame window ID for the frame that is named "Map-1".
      Define LAYOUT_ITEM_INFO_WIN 5

    Once you have a map window ID, you can use it in MapperInfo().

    And the $mb() is the syntax for Smart Text.

    This looks complicated, but it is really just a bunch of nested calls.

    Hope this helps.

    ------------------------------
    Alicia Levesque
    Pitney Bowes Software
    ------------------------------



  • 5.  RE: Scale Bar layout

    Posted 19 days ago
    Thanks very much Susan and Alicia, now working fine, great explanation and now an option for our layouts

    Alan

    ------------------------------
    Alan Leach
    Suffolk County Council
    ------------------------------