09-07-2017 10:53 PM
Our client has WebMap 2016Ep02 installed. They also use portal and external print service. We customize the printing template to fit their need. I just wonder whether we can adjust the size of the mapcontrol component to the extent that we want or there is a ratio that we need to follow, also whether any side affect of doing that such as causing issue for map printing scale or resolution.
Appreciate all ideas and suggestions.
09-11-2017 05:26 AM
The map control component is being sized dynamically by its parent container. By default, the controls are positioned using Grid container which allows to define relative sizes of its children. For instance, this would be the main Grid in the document:
<Grid Margin="0.5cm"> <Grid.RowDefinitions> <RowDefinition Height="25*" /> <RowDefinition Height="75*" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="2*"/> <ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/> </Grid.ColumnDefinitions>
Which means that the overal Grid size is defined by page size (+- margins, paddings etc.). And it defines a table of child controls like:
The printing engine will calculate the map window size based on the template definition and Portal will draw the printing preview box accordingly. The map scale will be dependend on the paper size, DPI and map scale defined in the printing dialog.
This is when I leave the map control size unchanged (dynamically calculated based on grid space):
This when I force the map control size to 400 x 400 <el:MapControl x:Name="MapControl1" Width="400" Height="400" />
(notice there are no pixels in WPF):
Please also check this tutorial for few more details: