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

Changing Map Provider at the Runtime

3 Answers 130 Views
Map
This is a migrated thread and some comments may be shown as answers.
Sanjay
Top achievements
Rank 1
Sanjay asked on 27 Feb 2015, 06:13 AM
Hi There

I have a scenario where I need to show maps under RadPane , i.e. Bing Tab shows Bing Map, Open Street Tab shows Open Streets and Empty provider Tab shows Shapefile map.Under each RadPane i have individual RadMap for each kind of provider.So my question is,

Should I use 1 radMap for all providers and when user clicks tabs , i change the map provider at the runtime, OR should i have individual radMaps for each provider under each tab. What are the performance issues associated with each approach.

Cheers

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 03 Mar 2015, 12:14 PM
Hi Sanjay,

Performance should not be much different if we compare changing tabs with RadMaps inside or changing the kind of the Map's provider runtime. However, I think the bigger question is usability - what will clients expect in such application. For example clients may need to pan and zoom in the Bing RadMap , then go to the OpenStreetMap and then return to the BingMap and they may want to have the previous pan and zoom settings preserved. With TabControl / PaneGroup this is simple - just set IsContentPreserved = True.
With "changing-providers-runtime" approach this would requirement much more code.

Regards,
Petar Mladenov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Don
Top achievements
Rank 1
answered on 13 Sep 2018, 05:58 PM

I am finding:

1) Create a PAGE, and VIEW MODEL
2) ON the Page:
Add a Tab Control with TWO Tab Items, on each Tab Item add a RadMap and a ComboBox
3) In the VM Create an Observable Collection of Providers and assign to both Combo Boxes on each Tab Item.
4) In the VM create a property(INotifyPropertyChanged) for each SELECTED Provider from each ComboBox, and BIND the Provider to each Map's Provider Dependency Property. (One List / Two Selected Items /Two Maps)
5) Run the App, switch between the Tabs and switch between the ComboBox's Selected Provider and you get botched providers displaying mixed data.

I have determined that when tabbing from one TabItem to an other, the RadMap gets Unloaded and then Reloaded each time, and several resources gets messed up because you do not call the DISPOSE. But, in fact you cant or else you would not be able to tab back... so there are several additional week references that are not detached and memory will continue to leak leading to poorly managed provider tiles etc...  Either that, or there are static references that both Maps reference... That I am not sure yet, still investigating and leaning on the Provider itself.

 

0
Petar Mladenov
Telerik team
answered on 18 Sep 2018, 07:28 AM
Hi Don,

We answered your questions in the following forum post:

Change Tabs creates Unstable Map Providers. (Memory Leak)

Regards,
Petar Mladenov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Map
Asked by
Sanjay
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Don
Top achievements
Rank 1
Share this question
or