Changing Map Provider at the Runtime

4 posts, 0 answers
  1. Sanjay
    Sanjay avatar
    21 posts
    Member since:
    Jun 2014

    Posted 27 Feb 2015 Link to this post

    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
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    3148 posts

    Posted 03 Mar 2015 Link to this post

    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.

     
  3. Don
    Don avatar
    3 posts
    Member since:
    Jul 2012

    Posted 13 Sep 2018 in reply to Petar Mladenov Link to this post

    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.

     

  4. Petar Mladenov
    Admin
    Petar Mladenov avatar
    3148 posts

    Posted 18 Sep 2018 Link to this post

    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.
Back to Top