Bing map - highlight country with a polygon on hover

时光怂恿深爱的人放手 提交于 2019-12-24 02:25:21

问题


I'm using silverlight Bing map control and I want to highlight country / continent after hovering it with mouse cursor.

Is there a better way of doing this than just providing coordinates for a polygon ? It's a looot of work if I would like to highlight all countries in the world.

I think there should be some sort of ready solution, but I wasn't able to find one.


回答1:


No, there is no way to highlight a country other than providing your own data - either in the form of coordinates to create a Microsoft.Maps.Polygon, or else overlay your own raster tileset on top of the map with the relevant country highlighted.

In fact, there is not even such such a thing as a globally-agreed list of how many countries there are in the world, let alone where there borders are. See http://en.wikipedia.org/wiki/List_of_territorial_disputes for examples

I think if the Bing Maps API (or Google Maps etc.) were to provide a set of coordinates representing the boundaries of each country, they would inevitably be exposing themselves to unnecessary political bias.




回答2:


I was searching for some solutions yesterday and I think this is the best solution so far:

http://www.bing.com/community/site_blogs/b/maps/archive/2010/07/13/data-connector-sql-server-2008-spatial-amp-bing-maps.aspx

Using SQL Server spatial data : http://www.microsoft.com/sqlserver/2008/en/us/spatial-data.aspx



来源:https://stackoverflow.com/questions/5883555/bing-map-highlight-country-with-a-polygon-on-hover

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!