1. Zoom Layering
2. Add another layer
You can use the Add Map statement to add additional layers to your map.
If you are looking to add another table on top of the existing layers, this should do the trick:
In many cases, you can get help from MapInfo Pro itself. Open the MapBasic window and then perform the action in MapInfo Pro, such as adding a new layer and styling. The MapBasic window will now hold the statements used. Have a look at this MapBasic Monday: Introduction to MapBasic article.
I use this quite often.
Original Message:
Sent: 04-29-2024 07:58
From: Mayca González Pérez
Subject: thematic map v15 a 2021
Hi.
Two points.
1-How do I indicate that the layer is viewed with a zoom? or to show the entire layer? it looks small
2-How do I put other layers on top? for example I have to introduce this layer
Set Map Layer RED_ALUMBRADO Display Graphic
Set Map Layer RED_ALUMBRADO Display Global Global Line (1,2,16711680)
Set Map Layer RED_ALUMBRADO Editable On
Label Font ("Arial",257,8,16711680,16777215) Offset 3 Position Above
With TIPO+"_"+MATERIAL+"_"+SECCION+" mm2"
Visibility Zoom(0,2) Units "km" Auto On Overlap Off PartialSegments On Duplicates On
Thanks
------------------------------
Mayca González Pérez
COMUNIDAD. AUT. REG MURCIA
Original Message:
Sent: 04-25-2024 07:50
From: Peter Møller
Subject: thematic map v15 a 2021
Hi Mayca
It works a bit differently with the new layout designer window.
Here's an example where I have a map with a single layer with a thematic. I'm creating a layout with a copy of this map, and I then add legends for the layers; the thematic and the base layer.
Include "MapBasic.def"Dim nLayoutWID, nMapID, nLegendWID, nMapFrameID, nLayer As IntegerDim fFrameX, fFrameY, fFrameWidth, fFrameHeight, fFramePositionY As FloatnMapID = FrontWindow()Layout DesignernLayoutWID = FrontWindow()Set CoordSys Layout Units "cm"Set Paper Units "cm"Create Frame Into Window nLayoutWID (1, 1) (16, 16) From Window nMapID Pen (3, 2, 0) Brush (2, 16777215, 16777215)nMapFrameID = 1nMapID = LayoutItemInfo( nLayoutWID, nMapFrameID, LAYOUT_ITEM_INFO_WIN)fFrameX = LayoutItemInfo( nLayoutWID, nMapFrameID, LAYOUT_ITEM_INFO_POS_X)fFrameY = LayoutItemInfo( nLayoutWID, nMapFrameID, LAYOUT_ITEM_INFO_POS_Y)fFrameWidth = LayoutItemInfo( nLayoutWID, nMapFrameID, LAYOUT_ITEM_INFO_WIDTH)fFrameHeight = LayoutItemInfo( nLayoutWID, nMapFrameID, LAYOUT_ITEM_INFO_HEIGHT)fFramePositionY = fFramePositionY + LayoutItemInfo(nLayoutWID, LayoutInfo(nLayoutWID, LAYOUT_INFO_NUM_ITEMS), LAYOUT_ITEM_INFO_HEIGHT)nLayer = 1Create Designer Legend Custom Frame From Layer nLayer Position (fFrameX, fFramePositionY) Units "cm" 'Using Label LayerInfo(nMapID, nLayer, LAYER_INFO_ALIAS)fFramePositionY = fFramePositionY + LayoutItemInfo(nLayoutWID, LayoutInfo(nLayoutWID, LAYOUT_INFO_NUM_ITEMS), LAYOUT_ITEM_INFO_HEIGHT)nLegendWID = LayoutItemInfo(nLayoutWID, LayoutInfo(nLayoutWID, LAYOUT_INFO_NUM_ITEMS), LAYOUT_ITEM_INFO_LEGEND_DESIGNER_WINDOW)nLayer = 2Add Designer Frame Window nLegendWID Custom Frame From Layer nLayer Position (fFrameX, fFramePositionY) Units "cm" Using Label LayerInfo(nMapID, nLayer, LAYER_INFO_ALIAS)
I have attached the table and the source code in a zip file.
Open the table in a new map. It will automatically add a theme.
Now run the example tool by first compiling it.
The legends are added under the map that gets added to the layout. I need to tweak that position a bit though
I hope this helps
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
Original Message:
Sent: 04-23-2024 14:14
From: Mayca González Pérez
Subject: thematic map v15 a 2021
I have thematic map with version15 and now in 2021 it gives me an error when reading the layers, it does not recognize them.
attached files
'##### OBTENIENDO TITULOS DE VENTANAS DE LEYENDA Y PRINCIPAL ###############
'str_tit_leyenda = "Theme Legend of " + WindowInfo(num_win_principal, WIN_INFO_NAME)
str_tit_leyenda = ptituloleyenda + WindowInfo(num_win_principal, WIN_INFO_NAME)
............................
'##### CREACION DE PRESENTACION (LAYOUT) ###############
Layout Position (0,0) Units "cm" Width pWidth Units "cm" Height pHeight Units "cm"
Set CoordSys Layout Units "cm"
i_layout_id = IDWINDOWLYT()
i_cartlgnd_id = IDWINDOWCRTLGD()
Create Frame into Window i_layout_id (ppalx1,ppaly1) (ppalx2,ppaly2) From Window i_cartlgnd_id Pen (2,2,0) Brush (2,16777215,16777215) Title str_tit_principal FillFrame On
Create Frame into Window i_layout_id (pleyx1,pleyy1) (pleyx2,pleyy2) From Window i_cartlgnd_id Pen (2,2,0) Brush (2,16777215,16777215) Title str_tit_leyenda FillFrame Off
Create Frame into Window i_layout_id (plogx1,plogy1) (plogx2,plogy2) From Window i_cartlgnd_id Pen (2,2,0) Brush (2,16777215,16777215) Title str_tit_logo FillFrame On
Create Frame into Window i_layout_id (plocx1,plocy1) (plocx2,plocy2) From Window i_cartlgnd_id Pen (2,2,0) Brush (2,16777215,16777215) Title str_tit_localizacion FillFrame On
'Create Frame into Window i_layout_id (pntex1,pntey1) (pntex2,pntey2) From Window i_cartlgnd_id Pen (1,1,0) Brush (1,16764992) Title str_tit_norte FillFrame On
Create Frame into Window i_layout_id (pntex1,pntey1) (pntex2,pntey2) From Window i_cartlgnd_id Pen (2,2,0) Brush (2,16777215,16777215) Title str_tit_norte FillFrame On
.............
------------------------------
Mayca González Pérez
COMUNIDAD. AUT. REG MURCIA
------------------------------