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

Off-screen Image Map generator.

5 Answers 112 Views
Map
This is a migrated thread and some comments may be shown as answers.
Gonzalo
Top achievements
Rank 1
Gonzalo asked on 23 Oct 2012, 09:16 PM
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.

5 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 26 Oct 2012, 01:43 PM
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.

0
Gonzalo
Top achievements
Rank 1
answered on 29 Oct 2012, 07:13 PM
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.

0
Accepted
Andrey
Telerik team
answered on 01 Nov 2012, 09:01 AM
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.

0
Gonzalo
Top achievements
Rank 1
answered on 01 Nov 2012, 07:46 PM
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. 
0
Accepted
Andrey
Telerik team
answered on 06 Nov 2012, 09:49 AM
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.

Tags
Map
Asked by
Gonzalo
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Gonzalo
Top achievements
Rank 1
Share this question
or