I am not sure how much of this is relevant but I am explaining for context in case some of it is important.
I have a server side Blazor app. I have a page with a DataGrid in which a row button may be clicked which opens a dialog which displays a wealth of info (so much it is displayed in a tab control) pertaining to the current data row, including a map created using the map control. The map is outside of the tab control
The dialog has a button to generate a pdf displaying the data from all the tabs which works well building the pdf line by line. Is it possible to get the currently displayed map into my pdf ?
Many thanks
M
Hi Martin,
Please find the details for your queries in the below table.
Queries |
Details |
|
I have a server side Blazor app. I have a page with a DataGrid in which a row button may be clicked which opens a dialog which displays a wealth of info (so much it is displayed in a tab control) pertaining to the current data row, including a map created using the map control. The map is outside of the tab control |
We suspect we are dealing with the reported scenario because the Maps component began to render before the Tab component. However, we can resolve this issue at the application level by rendering the Maps component after the Tab component. To properly render the Maps component, a boolean variable (i.e. IsInitialRender) must be created and used to determine the Maps component's rendering. For more information, please see the UG documentation link below.
The sample and video are available at the link below. Sample - https://www.syncfusion.com/downloads/support/directtrac/general/ze/BlazorApp61943599789 Video - https://www.syncfusion.com/downloads/support/directtrac/general/ze/maps1412338879
|
|
The dialog has a button to generate a pdf displaying the data from all the tabs which works well building the pdf line by line. Is it possible to get the currently displayed map into my pdf ? |
We can export Maps to PDF using the Maps component's "Export" method. Please see the sample code snippet below.
Code Snippet:
NOTE 1: The sample is available in the table above.
NOTE 2: In the preceding example, we can export the Maps component rendered within the active tab by using the respective Maps component instance. Similarly, we can export the other maps rendered in the other tab items by using the respective Maps component instances. |
Please let us know if the above sample meets your requirement and if you require any further assistance.
That all worked fine. However a further question. I would like to make the map referred to above able to be panned. However the map defined below is pannable if and only if the line <MapsZoomSettings ZoomFactor="5"></MapsZoomSettings> is removed.
Can you enable this map to be panned even when zoomed in?
<SfMaps>
<MapsZoomSettings Enable="true" EnablePanning="true" EnableSelectionZooming="true">
</MapsZoomSettings>
<MapsLayers>
<MapsLayer UrlTemplate="https://tile.openstreetmap.org/level/tileX/tileY.png" TValue="string">
<MapsZoomSettings ZoomFactor="5"></MapsZoomSettings>
<MapsCenterPosition Latitude="55.0" Longitude="-2.0"></MapsCenterPosition>
</MapsLayer>
</MapsLayers>
</SfMaps>
Hi Martin,
When we examined the provided code snippet, we noticed the following errors:
On correcting #1 and #2, the panning works as expected. Please see the code snippet below.
Code Snippet:
<SfMaps> <MapsZoomSettings ZoomFactor="5" Enable="true" EnablePanning="true" EnableSelectionZooming="true"></MapsZoomSettings> <MapsCenterPosition Latitude="55.0" Longitude="-2.0"></MapsCenterPosition> <MapsLayers> <MapsLayer UrlTemplate=https://tile.openstreetmap.org/level/tileX/tileY.png TValue="string"> </MapsLayer> </MapsLayers> </SfMaps> |
You can find the modified sample and video in the below link.
Sample - https://www.syncfusion.com/downloads/support/directtrac/general/ze/BlazAppMaps483933489
Video - https://www.syncfusion.com/downloads/support/directtrac/general/ze/panning-1682785511
Please let us know if the above solution meets
your requirement.