我想通过Open Street Map显示地图。
我在VS2013中有一个C#代码,用于显示GMAP和OSM的地图。
地图只能显示地图的一小部分。我想我可以看到指定纬度/经度的区域地图。
为什么?
由于
using System.Windows.Forms;
using GMap.NET.WindowsForms;
using GMap.NET;
using GMap.NET.MapProviders;
using GMap.NET.WindowsForms.Markers;
namespace drawMapByGmap
{
public partial class Form1 : Form
{
GMapOverlay overlayOne;
String contry;
public Form1()
{
InitializeComponent();
this.Load += new EventHandler(this.Form1_Load);
}
private void Form1_Load(object sender, EventArgs e)
{
mapexplr_Load(sender, e);
}
private void mapexplr_Load(object sender, EventArgs e)
{
//initialisation de notre map
gMapControl1.SetPositionByKeywords("Tunisia");
gMapControl1.MapProvider = GMapProviders.OpenStreetMap;
gMapControl1.MinZoom = 3;
gMapControl1.MaxZoom = 17;
gMapControl1.Zoom = 5;
gMapControl1.Manager.Mode = AccessMode.ServerAndCache;
//ajout des overlay
overlayOne = new GMapOverlay("OverlayOne");
//ajout de Markers
overlayOne.Markers.Add(new GMap.NET.WindowsForms.Markers.GMarkerGoogle(new PointLatLng(36.657403, 10.327148), GMarkerGoogleType.blue));
////ajout de overlay à la map
gMapControl1.Overlays.Add(overlayOne);
}
}
}