Custom Map Provider with images from Bing Map Imagery Service

4 posts, 0 answers
  1. Clement
    Clement avatar
    1 posts
    Member since:
    Aug 2011

    Posted 22 Aug 2011 Link to this post

    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

  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 25 Aug 2011 Link to this post

    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 >>

  3. DevCraft banner
  4. Clement
    Clement avatar
    1 posts
    Member since:
    Jun 2011

    Posted 08 Sep 2011 Link to this post

    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



  5. Evgenia
    Admin
    Evgenia avatar
    1406 posts

    Posted 13 Sep 2011 Link to this post

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