Off-screen Image Map generator.

6 posts, 2 answers
  1. Gonzalo
    Gonzalo avatar
    3 posts
    Member since:
    Oct 2012

    Posted 23 Oct 2012 Link to this post

    Hi 

    I am trying to create an Off-line Image Map creator using Radmap, Empty provider (Bing maps would be great but not posible) and kml sources intended for Telerik Reports. 

    Using RenderTargetBitmap I tried to generate an image of the control, even if it's just showed for an instant, the problem is that tiles or shapes don't load and get a gray empty image (Only showing scale bar and map controls).
    Is there any way to get the tiles or shapes loaded before that?

    Any idea is appreciated.
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 26 Oct 2012 Link to this post

    Hi Gonzalo,

    It is very complicated and it is hard to reproduce the problem without your solution, but using just the description you sent. Could you, please, provide us with your solution or with a small sample runnable project which reproduces it?

    Regards,
    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Gonzalo
    Gonzalo avatar
    3 posts
    Member since:
    Oct 2012

    Posted 29 Oct 2012 Link to this post

    Hi & thanks for the reply.

    Sadly I gave up. I realized the map should be in the screen in order to 'print' an image of it into the report. 
    It's quite hard to give a sample project since I'm using too much stuff in it as a whole.
    I opted to give the user a control with  a RadMap (note I'm into Winforms and interacting with WPF to make use of the RadMap control), it already display the map using OpenStreet as the main provider and the shapes I loaded into it (thanks for the "BestView" method by the way) allowing the normal funtions to set an personal location or zoom.Once the User accepts it prints it and add it to the report. 

    It's a workaround but my client like it a lot actually.

    Just one more thing, BingMaps provider sends a exception, I got no idea why, but I'd love to use BingMaps. It works just fine with Empty Provider and Open Streetmap Provider. The Exception and call Stack are this:

    Exception:
    System.InvalidOperationException:  "The calling thread cannot access this object because a different thread owns it."

    Call Stack:
    •  Telerik.Windows.Controls.DataVisualization.dll!Telerik.Windows.Controls.Map.MultiScaleImage.UseSprings.get() Line 211 + 0xe bytes
    •  Telerik.Windows.Controls.DataVisualization.dll!Telerik.Windows.Controls.Map.TilePresenter.MapSourceInitializeCompleted(object sender, System.EventArgs e) Line 208 + 0xa bytes
    • Telerik.Windows.Controls.DataVisualization.dll!Telerik.Windows.Controls.Map.TiledMapSource.RaiseIntializeCompleted() Line 364
    • Telerik.Windows.Controls.DataVisualization.dll!Telerik.Windows.Controls.Map.BingTileMapSource.ImageryService_GetImageryMetadataCompleted(object sender, Telerik.Windows.Controls.Map.VEWPFImageryService.GetImageryMetadataCompletedEventArgs e) Line 274

    PD: I hope this could be useful to someone else. As a Wild guess the exception is born sice the report use threading to improve performace, and such cause problems with the BingTileMapSource.

  5. Answer
    Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 01 Nov 2012 Link to this post

    Hi Gonzalo,

    You shouldn't use multithreading with RadMap control even it is possible in WinForms. The RadMap performs some operations asynchronously. For example it asynchronously uses the Bing Services when you use the BingMaps provider. When the request is complete then it uses other thread, not the same as the RadMap. So, the exception occurs.

    Greetings,
    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Gonzalo
    Gonzalo avatar
    3 posts
    Member since:
    Oct 2012

    Posted 01 Nov 2012 Link to this post

    Hi again.

    Since it's the report itself, I can't control whether it uses or not multi-threading. As you say I'd rather not to mess with it so I'll stick for now with OpenStreet Map provider since it works. Even so it would be lovely to use Maps in Reports.

    I'm really thankful for your work and help. 
  7. Answer
    Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 06 Nov 2012 Link to this post

    Hi Gonzalo,

    Unfortunately, the change you requested is not in our plans for Q1 2013 and it does not seem to be a trivial one. I will make sure it is reconsidered when discussing our future plans, but I am afraid no certain time frame can be given at the moment.

    Kind regards,
    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready