zoukankan      html  css  js  c++  java
  • Winform Echarts 显示百度地图的用法(3)

    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;

  • 相关阅读:
    Python 缓冲区
    Python接收执行参数
    Python编码
    Maven 多环境 打包
    JS 时间 获取 当天,昨日,本周,上周,本月,上月
    Window Mysql 5.7.18安装
    Eclipse 更改Maven项目名
    Redis 命令
    Redis 安装 和 启动
    Mongodb 安装 和 启动
  • 原文地址:https://www.cnblogs.com/denglj/p/4126454.html
Copyright © 2011-2022 走看看