android - 谷歌地图 Android 和 iOS Xamarin : Create Close Polygon on random tapped coordinates

标签 android ios google-maps

我在 Xamarin Android 和 iOS 上使用 Google map

我试图从随机点击坐标创建一个封闭的多边形。

Android 喜欢:

var options = new PolygonOptions();
                        options.InvokeFillColor(int.Parse("80000000", System.Globalization.NumberStyles.HexNumber));
                        options.InvokeStrokeColor(int.Parse("000000", System.Globalization.NumberStyles.HexNumber));
                        options.InvokeStrokeWidth(2);
options.AddAll(listOfPosition); //list of tapped coordinates
googleMap.AddPolygon(options);

iOS 喜欢:

var polygon = new Polygon();
                    polygon.Path = path; // this is my list of tapped coordinates
                    polygon.StrokeWidth = 2;
                    polygon.StrokeColor = UIColor.Black;
                    polygon.FillColor = UIColor.FromRGBA(0, 0, 0, 0.3f);
polygon.Map = mapView;

假设我像这样随机点击了坐标:

Debug|LOCATION:: 37.9115841998119 : -122.566957734525
Debug|LOCATION:: 37.9117754470967 : -122.561504803598
Debug|LOCATION:: 37.9085008969633 : -122.566276118159
Debug|LOCATION:: 37.9086561762004 : -122.562640719116
Debug|LOCATION:: 37.9102216477146 : -122.561550065875
Debug|LOCATION:: 37.9098513127501 : -122.567805983126
Debug|LOCATION:: 37.9123967989511 : -122.564518935978

我怎样才能使它关闭多边形而不在内部相交线甚至可能点击坐标达到 100 个位置数据。?任何想法或计算?提前致谢..

enter image description here

最佳答案

关于android - 谷歌地图 Android 和 iOS Xamarin : Create Close Polygon on random tapped coordinates,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45227207/

相关文章:

ios - RTCPeerConnectionFactory.peerConnectionWithConfiguration 导致 IOS 模拟器崩溃

javascript - 离线使用谷歌地图(Js Api)

android - 在 AWS-China 和 AWS-Global 之间更改应用程序中的区域

java - 如何在应用程序中三天显示一次对话框

ios - 如何实现与另一个类同名的协议(protocol)

ios - 在 TableView 标题上添加阴影

Android studio - 无法移动 Android SDK

Android - 设置按下回车的 Action

javascript - 类型错误 : e. getPosition 不是函数

jquery - Google map 拖动标记地理编码