A quick background first. I am currently using v15.0 32bit. I have a mapbasic application (MRT) that automates mapping. You set up a template workspace with map windows, legends, logos etc applied to the Layouts. When the Theme changes on the map, it automatically updates the Legend in each Layout the legend is present in.
Now, in v17.0 the behaviour of the map window and legend in the layout has change considerably. Here's an example:
I added a theme to a map and then added that map to the layout as my template.
When I go to create the next map, I go back to the map window (did not activate it in layout) and changed my theme
After this, If I go back to the Layout, the Legend has been removed and the map does not update.
I can see that when you add a Map to a layout, it creates a whole new map window, which is why the map in the layout is not updating.
With MRT in v15.0 I identify the map window that is being used and I can then continue to make changes to 1 map window for each map.
My question is, with v17.0 will I need to activate the map window in the layout and update it that way rather than the initial map window I created? OR is there another way I can handle this so I can work solely in 1 map window outside the layout?
Welcome to the World of MapInfo Pro 17.0!
There has been some radical changes to how a layout works. This started when we in 12.5 introduced the new Layout Designer window which now completely has replaced the classic Layout window.
Over the years we had recieved a lot of feedback on how the layout window wasn't really working for users so we took a step back and completely redesigned it. This is a big task and has been going on for the last many versions and we still have a few things to do.
One of the first things you will notice when you insert a Map into the new Layout, is that MapInfo Pro clones the Map you insert. Basically, this means that you don't have to keep the original Map window if your main output is thru the Layout. The Map in the Layout is a Map on its own.
So to make changes to this Map, you should get the WindowID of the window in the Layout Frame and modify the Map directly, by adding a new thematic layer to the map etc.
Do you have the same map shown in multiple layout windows?
Thanks for replying Peter.
Yes, I have the same map in 5 different layouts. Getting the windowid is how I thought I would need to do this .. which will be quite a bit of code change....keeps me busy.
So I understand that part.
Another related question: Currently I set the Legend Frame in a certain position with a certain Height and Width in my template (first map might have 3 theme values, next map 10 - so by setting this I can account for the changes in values from map to map). I don't need to change this at all then, it just updates as the layer changes.
In 17.0, when I edit the map window in the layout for the subsequent maps, the Legend Frame is removed from the layout and a new one is created and reset in a specific default position, by the looks of it.
So, regarding the Legend Frame, will I need to continue to edit the attributes each time I create a theme? OR is there a way to make sure the Legend Frame does not get removed at all?
Yeah, maybe we need into improving this slightly or providing another process for replacing the Map in the Layout.
Let me explain how it works now. Maybe that gives you an understanding of why things are happing.
When you manually insert a Map into a Layout, Pro will by default insert any Legend frames related to this Map.
When you remove a Map from a Layout, any related Legend frames will also be removed.
This is what you are seeing happening in v17.0.
So right now, you need to reinsert the legend frames when you insert a new map window. Are you saying that the Legend gets inserted automatically when you insert a Map?
Yes Legend gets inserted automatically when you insert a map .. which is fine.
My issue is, even if you keep the same map window and then remove a Theme from that window, it removes the Legend Frame as well.
I was initially thinking I could get the windowid for each map in the layout and update the appropriate oneso that the Legend updates as well, but looks like I will need to re-create the Legend Frame as well for each map, even if keeping the same map window
If this is all normal behaviour for this version, then it looks like I will need to completely re-write my MRT application. And this is only relating to the Legend Frame and Map Window in the Layout. I'll now need to investigate everything else that the application does.
Anyway, I will create seperate discussions around the specific topics when/if I need to.
Thanks for your assistance on this Peter, it has certainly helped confirm my thoughts/issues on this topic.
Ah, right. Earlier the Legend was inserted into one Frame in a Layout.
Now each individual Layer Legend is inserted into its own Legend Frame.
That's give you a bigger flexibility but I can see that in this case it also comes with a cost
Yeah sure does in my case!! I can't see why this couldn't be an improvement request though, something users could set in the Preferences.
I'd fully agree, Simon.
It is a pretty good improvement request. Feel free to add it to the Ideas Portal via the link in the menubar above.
I'll try to spend some time working with the Layout thru MapBasic and see if there is some "easy" workaround. The next week is too busy so it might be another week before I get the time
No problem Peter. Don't spend too much time on it .. I've got a good idea of what I could do in my head .. as you said, just a matter of having some time to test it.
I'll add the improvement request and hopefully get some votes on it!
Simon, your inquiry answers my inquiry re: Legend Designer (though not the 'redistribute alignment' issue)