Winform echarts Display the usage of Baidu map (3)

Source: Internet
Author: User

1, use echarts display Baidu map usage (2) write a baidu.html

2,winform Page put a WebBrowser control to place the HTML page of the map

3,winform WebBrowser files in the same directory baidu.html when loading

Webbrw_map.url = new Uri (Path.Combine (Application.startuppath, "baidumap.html"));

4, Load Map

(1), according to the latitude and longitude of the query

var pointx = "31.035434";
var pointy = "121.248119";

Setlocation:html inside the method name according to the latitude and longitude of the query

WebBrw_Map.Document.InvokeScript ("setlocation", new object[] {pointx,pointy});

(2), according to address query

var city= "Shanghai ";

var address= "Zhongshan Park ";

Setaddress::html the method name based on the address query

WebBrw_Map.Document.InvokeScript ("Setaddress", new object[] {city, address});
Get coordinates
Txt_longitude.text = WebBrw_Map.Document.GetElementById ("LNG"). InnerText;
Txt_dimensions.text = WebBrw_Map.Document.GetElementById ("lat"). InnerText;

Winform echarts Display the usage of Baidu map (3)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.