在Windows Phone 8.1中映射带孔的多边形 [英] Map polygons with holes in Windows Phone 8.1
本文介绍了在Windows Phone 8.1中映射带孔的多边形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我试图按照这篇文章如何绘制带有洞的地图多边形到Bing地图:http://guido1993.wordpress.com/2014/04/ 24 / complex-polygons-in-bing-maps /
I tried to follow this article how to draw map polygons with holes to Bing Map: http://guido1993.wordpress.com/2014/04/24/complex-polygons-in-bing-maps/
但是,我使用的是Windows Phone 8.1。自从API发生变化后,我发现了这些类:
However, I'm using Windows Phone 8.1. Since API changed, I found these classes:
Windows.UI.Xaml.Controls.Maps.MapPolygon
Windows.Devices.Geolocation.BasicGeoLocation
Windows.Devices.Geolocation.Geopath
我试过这样的代码:
MapPolygon shape = new MapPolygon();
List<BasicGeoposition> positions = new List<BasicGeoposition>();
positions.Add(new BasicGeoposition() { Latitude = 48, Longitude = 18 });
positions.Add(new BasicGeoposition() { Latitude = 49, Longitude = 19 });
positions.Add(new BasicGeoposition() { Latitude = 48, Longitude = 20 });
positions.Add(new BasicGeoposition() { Latitude = 48, Longitude = 18 });
positions.Add(new BasicGeoposition() { Latitude = 48.25, Longitude = 18.5 });
positions.Add(new BasicGeoposition() { Latitude = 48.75, Longitude = 19 });
positions.Add(new BasicGeoposition() { Latitude = 48.25, Longitude = 19.5 });
positions.Add(new BasicGeoposition() { Latitude = 48.25, Longitude = 18.5 });
positions.Add(new BasicGeoposition() { Latitude = 48, Longitude = 18 });
shape.Path = new Geopath(positions);
ctrlMap.MapElements.Add(shape);
我尊重样本的位置方向,但没有绘制多边形。
I respected orientation of positions by the sample, however no polygon was drawn.
当我尝试使用Polyline时,确实如此好了。
When I tried Polyline, it was drawn ok.
Window Phone 8.1是否支持多边形漏洞?
Does Window Phone 8.1 support holes in polygons?
谢谢。
推荐答案
这不是一个漏洞,所以我不明白为什么它不会被支持。您正在观察的实际行为是什么?
It's not really a hole, so I don't see why it wouldn't be supported. What's the actual behavior you're observing?
这篇关于在Windows Phone 8.1中映射带孔的多边形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文