Multiple layers / grouping

6 posts, 0 answers
  1. Keith
    Keith avatar
    88 posts
    Member since:
    May 2007

    Posted 22 Jun 2010 Link to this post

    Hi

    We've got a requirement which I'm hoping you'll give me some advice towards the best way to implement...

    We need to have a region "layer", a country group layer (e.g. DACH, UK/Ireland, etc.) and then a country layer (Germany, UK). When a user clicks on say the Europe region, it would zoom into the country group layer displaying the country groups within Europe. Clicking a country group would zoom you into the actual country clicked. All of the "areas" in the layers will contain values read from the database (and coloured accordingly) to generate some sort of drillable heatmap. Ideally we'd like to allow the user to drill down to a specific location within a country but we're considering that as a nice to have!

    My current thinking is a KML file for each layer and then switching to the next layer in code when an area is clicked. Is this the best way to achieve our required result or is there a better method e.g. grouping countries into their country group, country groups into their regions, etc?

    Thanks
    Keith
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 23 Jun 2010 Link to this post

    Hello Keith Pilkington,

    I would like to recommend you using the Dynamic layer, because when you will have a lot of polygons on the map at the same time then the rendering of them will be slowed at least for zooming.
    For more information please see the Using dynamic layer documentation topic:
    http://www.telerik.com/help/silverlight/map-using-dynamic-layer.html

     Also, there is an Items Virtualization example in our demos:
    http://demos.telerik.com/silverlight/#Map/DynamicLayer

     The example uses WCF service. You can find the sample code of this service using the local path, i.e. to the following:
    C:\Program Files\Telerik\RadControls for Silverlight Q1 2010\Demos\ExamplesWeb\RadMapDataService.svc.cs

    Best wishes,
    Andrey Murzov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Keith
    Keith avatar
    88 posts
    Member since:
    May 2007

    Posted 24 Jun 2010 Link to this post

    Thanks for the reply.

    From my understanding, the dynamic layer is used to display rectangular / point data which would be ideal for the location side of things - is this correct? However to do the zooming would I be best to implement using multiple KML files? e.g. Initially the world is displayed (without a provider) , then if America is clicked I could swap the KML to display States within America, and then if a State is clicked, swap again to display areas within the selected State. Is it possible to do this using a single file by means of grouping?

    Thanks
    Keith
  5. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 24 Jun 2010 Link to this post

    Hello Keith Pilkington,

    The Dynamic layer allows items virtualization. It means that framework elements, pin points and map shapes (also MapPolygon you will use) are loaded when the region of the map they belong to is visible. In contrast to the InformationLayer which process all items in collection this layer request items to process.
    It makes favor when thousands of items are available. Your application can select what MapPolygons are suitable for given location and zoom factor and return these ones only.

    You can use KML files, but I think you have a need to use separate KML file for each region.
    Unfortunately, the KML reader of the map control does not allow determining what an area is read when the MapPolygons are returned by the KmlReader.Read method. It does not pass the attributes such as the Name to the returned shape instance.
    So, you should also have a hierarchy class or XML. This structure should contain KML file name and next zoom level for each item for using it for click to zoom in current area.
    The XML file could contain a structure like to the following:
    <World>
     <America FileName="America.kml" ZoomLevel="4">
      <NewYork FileName="NewYork.kml" ZoomLevel="10">
       <Region1 FileName="Region1.kml" />
       <Region2 FileName="Region2.kml" />
       <Region3 FileName="Region3.kml" />
       ...
      </NewYork>
     </America>
     <Europe FileName="Europe.kml" ZoomLevel="5">
      <UnitedKingdom FileName="UnitedKingdom.kml" ZoomLevel="11">
       ...
      </UnitedKingdom>
     </Europe>
     ...
    </World>

    Kind regards,
    Andrey Murzov
    the Telerik team


    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Biruh MEKONNEN
    Biruh MEKONNEN avatar
    23 posts
    Member since:
    Apr 2010

    Posted 02 Feb 2011 Link to this post

    Hi,

    I want to do exatcly the same however I don't know that much about KML.

    How did you do to generate "region" shapes and  "group country" shapes from "coutry" shapes?

    I used dundas map control in a previous application, it was possible to group several country shapes into a group country shape without dealing with polygons and coordinates.
    I wanted to do if it was possible to do something like that with telerik map control.
    If not, what is the easiest way to "merge" several shapes into a super single shape?

    Regards,

    Biruh.
  7. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 04 Feb 2011 Link to this post

    Hello Biruh MEKONNEN,

    At present, the map control does not contain built-in functionality for merging several shapes into a single one. Also this feature is not in our plans.
    Our examples use already available shape files and KML files of countries and regions which we downloaded from internet.

    Best wishes,
    Andrey Murzov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top
DevCraft banner