使用GMap.net在地图上绘制折线 [英] Draw a polyline on the map using GMap.net

查看:79
本文介绍了使用GMap.net在地图上绘制折线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是的,我不是第一个问这个问题的人,但是我没有找到答案(也许是因为我的英语不好).如何在地图上绘制折线?不是一条路线(方向),而是一条折线,就像在带有功能Polyline的JS Google Maps API中一样.我不明白.

Yep, I am not the first who is asking, but I didn't found an answer (maybe, because my english is bad). How to draw a polyline on a map? Not a route (direction), but just a polyline, like in JS Google Maps API with function Polyline. I can not understand.

还是谢谢.

推荐答案

请仔细阅读本教程:

http://www.independent-software.com/gmap-net-tutorial-maps-markers-and-polygons/

这应该使您入门:

GMapOverlay polyOverlay = new GMapOverlay("polygons");
IList<PointLatLng> points = new List<PointLatLng>();
points.Add(new PointLatLng(-25.969562,32.585789));
points.Add(new PointLatLng(-25.966205,32.588171));
GMapPolygon polygon = new GMapPolygon(points, "mypolygon");
polygon.Fill = new SolidBrush(Color.FromArgb(50, Color.Red));
polygon.Stroke = new Pen(Color.Red, 1);
polyOverlay.Polygons.Add(polygon);
gmap.Overlays.Add(polyOverlay);

这篇关于使用GMap.net在地图上绘制折线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆