By David Crowther
Question:
How can you move and rename a Label Layer in MapThat?
Answer:
In this previous FAQ we looked at how to add a Label Layer into your MapThat projects - https://www.cadlinecommunity.co.uk/hc/en-us/articles/4409221032465-MapThat-Creating-Label-Layers
As part of that FAQ, we were able to create a Label Layer for the Schools in Liverpool.
However – what if you have overlapping labels and need to move some or wish to edit the label name to change it for printing e.g. make the label shorter?
Well, here is a tip to do this!
1 – Liverpool School Points
Start by creating a Spatial or DataPoint layer of the schools themselves. Use the Geometry field or the Easting and Northing to position the actual school location.
2 – Liverpool School Labels
Then create a LABEL Type layer for the schools, but this time we will use a LABEL_EASTING and LABEL_NORTHING field for the Labels anchor position.
By adding two new fields in the source data and updating them with the original Easting and Northing but offset by 5m, you can anchor the Label 5m to the East/West and South/North as needed.
update edubase set easting_label = easting + 5
update edubase set northing_label = northing – 5
This means when the labels are shown, they will appear offset from the actual School point as they use different coordinate fields.
3 – Liverpool School Edit Labels
Now create an editable version of the Schools Layer. The editable version will be DataPoint layer and use the Easting_Label and Northing_Label fields to position the editable dot.
- Use a simple dot for this layer
- Make it editable by the Roles that you need
- Expose a bubble that allows a user to edit the attributes you wish to change e.g. the School Name
- Ensure this layer is added into a Project Tree – but choose NOT to show in Tree – this means the layer won’t be shown in the Layers list but it will load when you use the Drawing Tools.
When the user with the correct Role logs in, they can then use the Drawing Tools to edit this layer.
Once the layer is added to the Drawing Tools, the simple dot will appear using the Easting_Label and Northing_Label values in the source table.
You can now use the MOVE tool to pick the simple dot up and change the anchor point for the label.
When you press Save, the Easting_Label and Northing_Label values are then updated in the source table with the new location and because the Label Layer is using the Easting_Label and Northing_Label for the anchor point of the label – that label will now move, but the school itself will not!
In addition, you can use the Attribute Editor in the Drawing tools to click on the simple dot and edit any fields e.g. the School Name.
Once you press Save the changes are committed back to the source table. This means that the Label Layer will now show the updated value!
So... using an editable Datapoint layer we have now been able to move the School Labels and also change the label value.
One extra tip!... you could also use a separate field for the School Labels. For example, the main Schools Layer could use the establishment_name for the attributes:
So, when the user clicks on the main school’s layer to show the information bubble or views the information in the data table the full school’s name is shown.
Now for the Schools Label layer we could use a shortened school name field for the label values. To do this we will add a new field into the source table and update it with the original school name values,.. we can then edit them later in MapThat.
update edubase set estab_name_short = establishment_name
If we then edit the configuration of the MapThat Schools Label layer so that it is using the new estab_name_short field as the LABEL_COLUMN –
and we then ensure our information bubble exposes this new short field – but only for Editing!
Now, when the user opens the Drawing Tools and edits the attributes for the editable Labels Layer, they can choose to update the shortened school name value.
Having saved their changes, the Label Layer then updates to show the Label using the new shortened school name, but the main layer will still retain the full school’s name to show in the Data Table and the information bubble!
This is a great tip to allow your users to display Label Layers and where needed make changes to those labels, to move them and edit the label value so the labels don’t overlap when printing!
Comments (0 comments)