Maps with Windows Forms application

2019-03-27 07:28发布

I am building a C#/Winforms application that requires a map (a la Google maps, Bing maps etc.). But I am terribly confused by the ToU (licensing) - non-commercial use etc.

My questions:

  1. What mapping provider would you suggest (preferably free) to embed with a winforms application, for commercial purposes.

  2. What mapping provider would you recommend if the app is "offline" i.e. cannot get tiles from a mapping server.

  3. Google Earth seemed quite promising until I read in the ToU of non-commercial use only clause, would you know if that is waivable through purchase of a license? Any commercial alternatives?

3条回答
成全新的幸福
2楼-- · 2019-03-27 07:29

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!

查看更多
叼着烟拽天下
3楼-- · 2019-03-27 07:29

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());
查看更多
不美不萌又怎样
4楼-- · 2019-03-27 07:34
  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)

查看更多
登录 后发表回答