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

Custom Map Provider with images from Bing Map Imagery Service

3 Answers 109 Views
Map
This is a migrated thread and some comments may be shown as answers.
Clement
Top achievements
Rank 1
Clement asked on 22 Aug 2011, 08:26 AM
Hi.

I would like to create a custom map provider for the Rad Map controls that calls a simple wcf service on my web server that proxies image requests to bing map imagery service (http://msdn.microsoft.com/en-us/library/cc981090.aspx). 
How can I do this ?
Can I use the UriImageProvider for this ?

Thanks

3 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 25 Aug 2011, 09:15 AM
Hello Clement,

No, you can't use the UriImageProvider for these purposes. If you suppose to use Bing tiles (like BingMapProvider do), then you should inherit your own classes from the TiledProvider and TiledMapSource (http://www.telerik.com/help/silverlight/radmap-howto-custom-provider.html). If you suppose to show map as Single image of the specified geographical region, then you should inherit your own classes from the ImageProvider and ImageMapSource.

As for the server side (WCF service) it is on your own responsibility to create classes which will call Bing imagery service in order to get tiles or image. You can take a look into the implementation of the BingTileMapSource to get an idea how it should work, but final implementation is on your own and it is outside of the scope of the RadMap support.

Kind regards,
Andrey Murzov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Clement
Top achievements
Rank 1
answered on 08 Sep 2011, 06:52 AM
Thanks, I could succesfully create a custom tiled map source that proxies bing map image requests to our server. I was hoping it would allow us to access the raw bytes of the image because the image would come from the same domain but I still get the same security exception (http://forums.silverlight.net/p/140438/591086.aspx/1?p=True&t=634510433450404817).
Would using the Uri image source help to get around that issue ? I can't find any samples for it.

You said: "If you suppose to show map as Single image of the specified geographical region".
Where is the geographical region specified ?


Thanks



0
Evgenia
Telerik team
answered on 13 Sep 2011, 03:53 PM
Hello Clement,

Unfortunately we don't have a sample code for this custom provider. You can build it using the following example for tiled provider: http://www.telerik.com/help/wpf/radmap-howto-custom-provider.html
You should inherit ImageProvider and ImageMapSource classes instead of TiledProvider and TiledMapSource. Also you should override the ImageMapSource.GetImageSource method instead of GetTile.

Best wishes,
Evgenia
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
Map
Asked by
Clement
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Clement
Top achievements
Rank 1
Evgenia
Telerik team
Share this question
or