This is a migrated thread and some comments may be shown as answers.

RadMap with RadSplitter

4 Answers 81 Views
Map
This is a migrated thread and some comments may be shown as answers.
Glen
Top achievements
Rank 1
Glen asked on 12 Dec 2014, 02:44 PM
I have been trying to use RadMap within a RadPane of the RadSplitter control (it should be said I have no issues when not using the RadSplitter and the Map renders correctly).

The RadSplitter is setup to go to 100% width and height, which works fine, yet on initial load the base layer map is very small and only seems to load 1 or 2 tiles, the map control itself does seem to expand to the correct screen size as the copyright information is still displayed in the bottom right hand corner. (See Initial_Load.png)

If I further use a map with JSON points and a shape layer the base layer map is again not loaded properly, the shape layer is only partially loaded, but oddly the push pins are correctly loaded in relation to the map control as a whole. (See Initial_load_with_JSON.....png)

After clicking within the map control once the base layer map loads correctly, however it is not centered as per the load parameters (it is centering on the very small initial load tile).  Additionally even after getting all the base layer map, only a partial shape layer is loaded. Originally I thought this was an issue with RadSplitter, but I have used other splitter controls and it still has the same issue. (See After_Map_Click....png)

Could you maybe provide a very simple example whereby the map control is within a 2 pane radsplitter set for 100% width and height and explain where I am going wrong.

Thanks

4 Answers, 1 is accepted

Sort by
0
Glen
Top achievements
Rank 1
answered on 12 Dec 2014, 03:47 PM
Ok.  This seems to be directly related to the Document mode, my page was using Edge, yet if I use Document Mode 9 or below in internet explorer then it works.  Any thoughts on this please Telerik, seems we have to use an older mode to get the two controls to play happy together.

Thanks
0
Ianko
Telerik team
answered on 15 Dec 2014, 02:18 PM
Hi Glen,

Thank you for contacting Telerik support.

The described issue is commonly encountered due to the late loading of the Pane elements. Basically, the Map control is loaded before the Splitter and thus its tile images are loaded on a viewport that is too small (e.g., only 4 tile are loaded).

To resolve this you can use the MS AJAX client-side pageLoad event  and call the resize method of the RadMap, so that it could be properly loaded once the whole page is rendered properly.

Example

<telerik:RadMap runat="server" ID="RadMap1"></telerik:RadMap>
  
<script type="text/javascript">
    function pageLoad() {
        var map = $find("<%= RadMap1.ClientID %>");
        map.kendoWidget.resize();
    }
</script>


If you still have issues on the matter, please get back with a simple, locally runnable project, so that I could investigate the situation on my end.


Regards,
Ianko
Telerik
0
Glen
Top achievements
Rank 1
answered on 18 Dec 2014, 12:05 PM
Thanks. That in itself has worked, and the map is now rendering correctly to the size of the RadSplitter pane, however the centre point is still not correct so we have to recentre the map aswell based on some parameters.  These seems like an oversight when used with the RadSplitter ?
0
Ianko
Telerik team
answered on 22 Dec 2014, 01:03 PM
Hi Glen,

The encountered behavior is not related to the RadSplitter actually. The same can be experienced even with simple DOM elements.

What is relevant in the case, is that the Map is initially hidden, and thus its logic intially calculates a minimum amount of image tiles to be requested, and its center as per to the available view port. Subsequently, showing the map the above calculations are visible, and the if e.g., the Map is now 1000px wide, the map should be instructed to resize itself, and request the needed tiles.

This is a rather AJAX behavior that is more related to how the Map is used and the effect from being initially hidden. What control or widget is used is not relevant for the case.

Regards,
Ianko
Telerik
Tags
Map
Asked by
Glen
Top achievements
Rank 1
Answers by
Glen
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or