您的位置:首页 > Web前端 > HTML

Windows Smartphone 嵌入map html 页面

2014-06-23 15:59 405 查看
前言:开发架构 BS & CS ;实现地图导航功能。

BS:Spring+hibernate、Java、JDK1.7 (设想环境)



CS:webservice、C#、.Net framwork 3.5&Windows mobile 6.0 SDK

1、创建“智能设备项目”。





2、使用“webBrowser”空间创建框架内置浏览器。

引入COM下面 windows web程序支持包,在窗体源码中编写如下代码:

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MapSmart
{
    [System.Runtime.InteropServices.ComVisibleAttribute(true)]    
    public partial class FrmMap : Form
    {
        public FrmMap()
        {
            InitializeComponent();
        }

        private void FrmMap_Load(object sender, EventArgs e)
        {
            // JSP中 调用window方法
            // onclick="window.external.functionname()";

            //为HTML文件传递JS参数
            //object oSum = wb.Document.InvokeScript("sayHello", new object[] { 1, 2 });

            string url = "http://map.baidu.com/";
            Uri uri = new Uri(url);
            this.wb.Navigate(uri, "");

        }
    }
}
引入webbrowser所需要的库:



3、启动调试查看结果(引入html地址后)效果图。







4、参数传递

1、REST风格URL传递参数。

2、脚本方法调用参数传递:如2中代码注释处。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: