MapInfo Pro

 View Only
Expand all | Collapse all

Copy/drag legend to layout

  • 1.  Copy/drag legend to layout

    Posted 10-05-2017 09:37

    I miss a feature to copy or drag a legend to the plot layout window (64 bit version).

    Usually I create a legend and the customize the legend by hand to fit my needs. If I already have a layout with a map frame, and legend, this is not update. I can delete the map and insert it again, and the new legend will also be added to the layout. The feature I am missing, is to be able to simple copy paste or drag the legend to the layout to insert it. To avoid having to delete the entire map frame and re insert this to update the legend. I can copy paste maps and basically everything else into the layout window, except the legend. If I select the map in the layout and use the legend button, I can only insert a new auto generated legend for the map, not my customized legend. The add legend frame window could also list the custom legends to insert.

    I hope it makes sense. Also I am using the danish version of MapInfo, and I am not sure if I translated all the terms correctly.



  • 2.  RE: Copy/drag legend to layout

    Employee
    Posted 10-05-2017 07:31

    Hi Hans,

    Thanks for taking the time to pass in this feedback.

    When we moved from the classic layout window to the new Layout Designer window we took a descision to treat legends as individual frames instead of a single "window" in the Layout Designer.

    The Layout Designer is basically an enhanced Legend Designer window so the things you can do in the Legend Designer can also be done in the Layout Designer.

    At that time, we were convinced that user would changed the way they work with legends and layouts - are we were at least giving them the capability to make this change.

    For a stand-alone map you would create the legend in the Legend window. If you bring this map into the Layout Designer the content of the Legend window would also be brought into the Layout Designer.

    For a map embedded in a Layout Designer window you should create the legend directly in the Layout Designer window and also modify it here.

    One issue is that a legend is connected to a map so you can't copy the legend from one map and assign it to another map.

    Remember that once you have inserted a map into Layout Designer, it is no longer linked to the original map - it's now a clone of the original and changes from one doesn't get applied to the other.

    One thing that could be consider is in some way to replace the existing map with another and at the same time also replace/insert the legend for this map into the Layout Designer. This would do what you currently are doing:

    • Remove the map from the frame,
    • Delete the Legend frames referring to this map,
    • insert the other map in the frame (maybe maintain the scale and center of the original map?)
    • and insert the content of the Legend Designer

     

    This could even be done using MapBasic (the Legend part might be a bit tricky)

    I have added the "MapInfo Pro Ideas" topic to your post so it will also be picked up as an idea for improvement.



  • 3.  RE: Copy/drag legend to layout

    Posted 10-05-2017 07:47

    Thanks for the reply. Many of our clients create layouts for specific prints and run into this problem all the time.

    If I understand correctly, the correct way to do things now are:

    1. Create map
    2. Create legend
    3. Add map (and legend) to layout
    4. Modify legend in layout window and not modify the separate legend created with the map.

     

    Only problem is. If I need to create a few different layouts from the same map, I would need to edit the same legend every time in every new layout. I don't see any function to copy a whole layout either.

     



  • 4.  RE: Copy/drag legend to layout

    Employee
    Posted 10-05-2017 08:12
      |   view attached

    You can rightclick on the Layout tab and clone the entire Layout window.

    Clone Layout

    You can also use Copy & Paste to copy the content of one Layout and insert it in another Layout.

    What happens if you insert an embedded map in a new layout? Does it also bring over the legend frames for this map?



  • 5.  RE: Copy/drag legend to layout

    Posted 10-05-2017 08:27

    If you copy the map in the layout the legend follows.



  • 6.  RE: Copy/drag legend to layout

    Employee
    Posted 10-06-2017 00:14

    Hi Hans,

    If you do not want the legend frames to come up with the map, you can click outside of the frames in the Layout window. Then, from the context menu you can choose the frames you want to delete.

    I guess this is what you are looking for.

    Regards,

    Shweta



  • 7.  RE: Copy/drag legend to layout

    Posted 10-06-2017 02:57

    Hi Shweta

    I do not want to delete the legend. I want to reuse a legend I created outside the layout manager in different layouts. This is not possible without deleting the map in the layout, add it again and reposition it. A simple option to copy/past any legend from a legend og layout window to another layout window would be great.



  • 8.  RE: Copy/drag legend to layout

    Posted 10-06-2017 07:42

    Once you make the map in the Layout active (double-click) then you can add the thematic legend back in again - Add to Map > Legend. Although it will be a new legend without any edits to the title? etc.



  • 9.  RE: Copy/drag legend to layout

    Posted 10-06-2017 07:46

    Hi John

    Exactly my point. You cannot customize a legend and the reuse (copy) it anywhere. You can copy all sorts of objects to the layout window, but not legends. That is my request for future versions of MapInfo. To be able to copy any (customized) legend to any layout window.



  • 10.  RE: Copy/drag legend to layout

    Posted 10-06-2017 09:04

    But Hans

    What if you have amended your Thematic Map in the Layout Designer? Changed colours or number of ranges or different field even. You can't have a new (and better) workflow and expect it to be the same as the old workflow...



  • 11.  RE: Copy/drag legend to layout

    Employee
    Posted 10-06-2017 09:10

    The best solution right now, is to remove the map from the frame in the Layout Designer and then add the other map to the now empty frame.

    This will also bring in the manipulated Legend



  • 12.  RE: Copy/drag legend to layout

    Posted 10-06-2017 12:34

    Peter, perhaps a "Refresh" function would meet these needs? Whereby you right-click in the map frame and choose which map window you want to refresh or even replace in that frame. And that could/would bring the Legend with it, just as you would in the first instance.

    One for the Suggestion List...



  • 13.  RE: Copy/drag legend to layout

    Posted 10-10-2017 09:58

    After customizing a legend for your first map window, you can save this as an image under the Home tab. You are then able to add this image to any Layout Designer where you want to use the same custom legend.

    Save_legend_as_image

    Note that the entire legend is saved as one image, so you will not be able to move around the frames for the individual layers. This is the image saved from the workspace above. In this case I did not include a title, but I will add this as a text object in Layout Designer instead.

    Custom_legend



  • 14.  RE: Copy/drag legend to layout

    Employee
    Posted 10-11-2017 03:39

    Yes, John, a "Refresh" or "Replace" option could be one way of improving the current workflow where you would have to do it in a number of steps.

    I think this could even be done using MapBasic



  • 15.  RE: Copy/drag legend to layout

    Employee
    Posted 10-11-2017 03:39

    Nice, idea Håkan!

    Even though the result is a static image and no longer linked to the data in the map but it kind of solves the problem :-)



  • 16.  RE: Copy/drag legend to layout

    Posted 10-31-2017 00:34

    +1. Ability to reuse the Legend was a great help in the earlier versions.



  • 17.  RE: Copy/drag legend to layout

    Posted 10-31-2017 00:46

    +1. I came across this issue just this week. I was creating a map series and wanted to use the same legend on multiple layouts. (The ability to make changes to the legend once and it be reflected across multiple layouts would also be helpful)



  • 18.  RE: Copy/drag legend to layout

    Posted 11-13-2017 00:58

    This is definitely needed. An example of when it is useful - we create flood depth maps with the same scale using a thematic, and all the base map data is the same. For different floods, we have different spatial extents but all the legend information is unchanged. Creating a new legend in for each layout is not a good use of time. A workaround has been to a duplicate of the map with the correct legend and hide that map off the layout window, which maintains the custom legend, whilst displaying the map with the real data. Not optimal, but it works.



  • 19.  RE: Copy/drag legend to layout

    Posted 03-16-2023 18:22

    I have just come across this old issue after having created a layout with 25 pages. Just as I thought I was done, one of my layers had disappeared from every page. First, I'm not sure how that was even possible, second I'm glad that I could reinstate the layers using the Multi Mapper Helper. It did leave the problem that the legend needs to be recreated for each page as I can't copy and paste it. As each page has 25 different map extents, I'm not about to copy and paste the map then reset to the extent and scale required (In hindsight I should have saved named views). I feel that the least path of resistance is to recreate my legend 25 times. Unless I'm missing something it is quite surprising that after 6 years there doesn't seem to be an easier work around for this.

    I did try to use Site Mapper for this project but I found it is too restrictive in what I wanted to do and 2, it just didn't work.

    Even though I've only been using MapInfo a short time it is quite apparent that there is a dire need for a decent tool for creating a map series that  doesn't require duplication of map layouts that then requires any changes to be done individually if you don't get it right first time. This is a frequent requirement of my job and it's a bit frustrating that it doesn't appear to have a high degree of urgency to improve functionality.



    ------------------------------
    Mark McGovern
    Knowledge Community Shared Account
    ------------------------------



  • 20.  RE: Copy/drag legend to layout

    Employee
    Posted 03-17-2023 09:29

    Hi Mark

    You may be able to use the MapBasic window to get this done.

    Open the Mapbasic window

    Now insert the legend for the layer on a single of your pages.

    Notice how the MapBasic window captures the statement for you

    Now comes the tricky part where you have to modify the statement slightly to make it work.

    This is the statement you see in the MapBasic window. Window 3141 will be different for you as that refers to a specific window. We need to change this to work for the window on the current page in your layout. To do so, you need to change the number into this statement which will get the ID of the map window in the frame on the layout. Hopefully, you only have one frame with a map on each page.

     Create Designer Legend 
       From Window 3141 
       Portrait Default Frame Style "#" Font ("Arial",0,8,0) Frame From Layer 1 Using column object label default
    

    Your statement may also differ in other ways depending on the legend you create.

    This is the statement you need to insert instead of the number: 

    LayoutItemInfo(FrontWindow(), LayoutItemID(FrontWindow(), "", LAYOUT_ITEM_TYPE_MAPPER), LAYOUT_ITEM_INFO_WIN)

    Your statement will look similar to this:

    Create Designer Legend 
       From Window LayoutItemInfo(FrontWindow(), LayoutItemID(FrontWindow(), "", LAYOUT_ITEM_TYPE_MAPPER), LAYOUT_ITEM_INFO_WIN) 
       Portrait Default Frame Style "#" Font ("Arial",0,8,0) Frame From Layer 1 Using column object label default 

    You can also change the position of the frame through the MapBasic if you prefer.

    Right-click the legend frame that you have manually moved to its right location, select Frame Properties,  and make a note of its Top-Left X and Y .

    You can now use this statement to change the position of the frame. It's important that you run this statement after inserting the new legend frame as the statement will move the last item on the page.

    Alter Designer Frame 
       Window FrontWindow() 
       Id LayoutInfo(FrontWindow(),  LAYOUT_INFO_NUM_ITEMS) 
       Position (0.936, 22.207)

    Let us know if this works for you



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



  • 21.  RE: Copy/drag legend to layout

    Posted 03-19-2023 17:24

    Thanks for the advice Peter.

    I've never used MapBasic previously but I can see it or Python is something I may have to learn.

    To be honest (and again I make no apologies for saying so) I'm finding it frustrating that a lot of basic functionality I had available in ESRI previously requires a lot of additional effort in MapInfo Pro.

    A lot of rethinking in terms of how I approach things ahead.

    I really appreciate the support available.

     

    Kind regards

    Mark

     

     

       Mark McGovern, Technical Officer - GIS
     P: 03 6393 5321  E: Mark.McGovern@mvc.tas.gov.au
     26 Lyall Street Westbury, TAS 7303 | PO Box 102, Westbury Tasmania 7303
     www.meander.tas.gov.au

    Notice of confidential information
    This e-mail is intended only for the use of the addressee. If you are not the addressee, you are requested not to distribute or photocopy this message. If you have received this message in error, please immediately notify the sender and destroy the original message. Views and opinions expressed in this transmission are solely those of the author and do not necessarily represent those of Meander Valley Council.