Maps with Windows Forms application

半城伤御伤魂 提交于 2019-12-04 03:21:19
Habib
  1. For Windows application, try looking for OpenStreetMap for windows form integration using a browser control

  2. For offline solution you will require map data. One of the most used map data format is Shapefiles which is an ESRI standard, you can download OpenStreetMap data and convert it to Shapefiles and then you can import them in your application. There are open source project which are using Shapefiles for map rendering and other GIS functionalities. namely SharpMap and DotSpatial (Both are .Net implementation)

  3. You can search for Google Earth Pro, also try World Wind from NASA (which is free)

This is excellent, you can check different providers and select one that meets both legal and tech requirenments: Great Maps for Windows Forms & Presentation

Just download code and check out the demo!

Try This Code Using Web browser control this code to get direction between two location

   System.Text.StringBuilder queryaddress = new System.Text.StringBuilder();
string sStreet = string.Empty;
string sCity = string.Empty;
string sState = string.Empty;
string sPincode = string.Empty;
string sProvider_no = string.Empty;
queryaddress.Append("https://www.google.com/maps/dir/");

if (!string.IsNullOrEmpty(txtprovider_no.Text)) {
    sProvider_no = txtprovider_no.Text.Replace(" ", "+");
    queryaddress.Append(sProvider_no + "," + "+");
}
if (!string.IsNullOrEmpty(txtState.Text)) {
    sState = txtState.Text.Replace("  ", "+");
    queryaddress.Append(sState + "," + "+");
}
if (!string.IsNullOrEmpty(txtCity.Text)) {
    sCity = txtCity.Text.Replace("  ", "+");
    queryaddress.Append(sCity + "," + "+");
}
if (!string.IsNullOrEmpty(txtPincode.Text)) {
    sPincode = txtPincode.Text.Replace("  ", "+");
    queryaddress.Append(sPincode);
}

queryaddress.Append("/");
sStreet = string.Empty;
sCity = string.Empty;
sState = string.Empty;
sPincode = string.Empty;
if (!string.IsNullOrEmpty(txtlindmark.Text)) {
    sStreet = txtlindmark.Text.Replace("  ", "+");
    queryaddress.Append(sStreet + "," + "+");
}
if (!string.IsNullOrEmpty(txtclient_city.Text)) {
    sCity = txtclient_city.Text.Replace("  ", "+");
    queryaddress.Append(sCity + "," + "+");
}
if (!string.IsNullOrEmpty(ttxtclient_city.Text)) {
    sPincode = ttxtclient_city.Text.Replace("  ", "+");
    queryaddress.Append(sPincode);
}
if (!string.IsNullOrEmpty(txtclient_state.Text)) {
    sState = txtclient_state.Text.Replace("  ", "+");
    queryaddress.Append(sState + "," + "+");
}


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