Using Google maps API within Silveright
I am developing a silverlight aplication which uses a bing maps interface. The client has now changed their requirements and would like to use existing google maps licences rather than pay for both google and bing (it's a private application and hence does not come under the free licences). Does anyone k开发者_运维知识库now if it's possible to do?
Cheers Cap
Is it possible to do? Technically, very easy. But doing so in a legal way, pretty hard.
When you say you were "developing a Silverlight application using a Bing Maps interface", do you mean that you were using the Bing Maps Silverlight control provided by Microsoft? (http://www.microsoft.com/maps/isdk/silverlight/) If so, unfortunately, you can't simply switch out the Bing tiles and use Google Map tiles instead - to do so would be a breach of the Bing Terms of Service (Section 2i. "You may not... integrate the Bing Maps Platform or any of its content with any other mapping platform; " - http://www.microsoft.com/maps/product/terms.html).
If you've coded your own Silverlight map control, then the terms above don't apply and it shouldn't be too hard to point at a Google Maps tile source rather than the Bing Maps tiles - they use exactly the same Spherical Mercator projection and tiling system, with only a few differences in the way that tiles are referenced that can easily be converted between the two systems. The problem I see here is that the Google terms of use state that you "may not... access or use the Products or any Content through any technology or means other than those provided in the Products" (http://www.google.com/help/terms_maps.html), and Google Maps don't provide a supported means of direct tile access.
So, to comply with Google's ToS, you're going to have to access the Google Javascript Map control from your Silverlight application (either via the SL webbrowser control, or by overlaying an iframe on top of the SL application). Note that, by doing so, you've basically lost any advantage of having coded your application in Silverlight - you may as well have written the whole thing in HTML/Javascript....
精彩评论