码迷,mamicode.com
首页 > Windows程序 > 详细

Winform Echarts 显示百度地图的用法(3)

时间:2014-11-27 16:03:21      阅读:259      评论:0      收藏:0      [点我收藏+]

标签:winform   style   io   ar   color   sp   for   文件   on   

1,用Echarts 显示百度地图的用法(2)写一个 baidu.html

2,winform页面放一个WebBrowser控件,用来放地图的html页面

3,winform 加载时 将WebBrowser文件放在baidu.html同一个目录下

webBrw_Map.Url = new Uri(Path.Combine(Application.StartupPath, "baidumap.html"));

4,加载地图

(1),根据经纬度查询

var pointX = "31.035434";
var pointY = "121.248119";

setLocation:html里面根据经纬度查询的方法名

webBrw_Map.Document.InvokeScript("setLocation", new object[] {pointX,pointY});

(2),根据地址查询

var city= "上海";

var address= "中山公园";

setAddress::html里面根据地址查询的方法名

webBrw_Map.Document.InvokeScript("setAddress",new object[] { city, address});
 //获取坐标
txt_Longitude.Text = webBrw_Map.Document.GetElementById("lng").InnerText;
txt_Dimensions.Text = webBrw_Map.Document.GetElementById("lat").InnerText;

 

Winform Echarts 显示百度地图的用法(3)

标签:winform   style   io   ar   color   sp   for   文件   on   

原文地址:http://www.cnblogs.com/denglj/p/4126454.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!