桌面应用程序 和google map api 的问题 网络继存的google map api 教程调用多数是基于web应用程序的,开发的桌面应用程序如果想要使用google map进行交互怎么做那?桌面应用程序不需要服务器还需要申请key? 刚做这方面,希望有人给与指点,这里现行谢过了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1. winform里内嵌一个webbrowser就可以常规方式使用google map;2. 自己画地图,后台可以调用google map的地址解析服务把地址转换成坐标;两种方式都需要申请key 网上找了个差不多的例子http://hi.baidu.com/fncm/blog/item/07e834f78a6d3726730eec6b.html方法应该是兄台说的第一个把,但是这个例子用得好象是google的key,还有既然是桌面应用程序这个key是必需的? 地图数据是google服务器上的,又不在你本地,你说要不要key? 看来是必须要key了,1. winform里内嵌一个webbrowser就可以常规方式使用google map;webbrowserd调用google map的方法能告诉的具体点吗(应该是调用js函数吧)? 你可以查官方文档啊,简单应用是很方便的http://code.google.com/intl/zh-CN/apis/maps/documentation/ 那都是web应用程序,我要做的桌面应用程序(mfc/C#),我不知道winform里内嵌一个webbrowser怎么和那googlemap交互 可以做一个web的应用发布出来,然后在webbrowser带参数调用你的web应用,一般交互应该都可以实现 简单的作个webbrowser和js交互的例子GetIDsOfNames方法却总是出错,帮我看看好? HINSTANCE hInst = ::LoadLibrary( _T("OLEACC.DLL") ); char* queryAddress; IDispatch *spScript; DISPID dispid = NULL; HRESULT hr; queryAddress = "c:\\g.html"; m_gmap.Navigate(queryAddress,NULL,NULL,NULL,NULL); CString str_fun_name = L"mod_list"; CComBSTR bstrMember(str_fun_name); IHTMLDocument2 *spDoc =(IHTMLDocument2*)m_gmap.GetDocument(); hr =spDoc->get_Script(&spScript); //这里出错了 if ( FAILED(hr) ) { MessageBox("spScript error"); } spScript->lpVtbl hr = spScript->GetIDsOfNames(IID_NULL, &bstrMember,1,LOCALE_SYSTEM_DEFAULT, ispid);//这里出错了:ispid =-1if(FAILED(hr)) { CString str_error; str_error.Format("GetIDsOfNames 的dispid=%d",dispid); MessageBox(str_error); return; }..... 以下是html的代码[code=HTML]<html> <head> <script> function mod_list(class_name,str_text_orgi,str_text_current) { alert(class_name);alert(str_text_orgi);alert(str_text_current); if(class_name=="app"){ document.write("app"+str_text_orgi+"replease"+str_text_current+" <br/>"); } else if(class_name=="ip") { document.write("ip"+str_text_orgi+"replease"+str_text_current+" <br/>"); } } </script> </head> <body> aaaa</body> </html> [/HTML] 有个地方写错了,再来一次 HINSTANCE hInst = ::LoadLibrary( _T("OLEACC.DLL") ); char* queryAddress; IDispatch *spScript; DISPID dispid = NULL; HRESULT hr; queryAddress = "c:\\g.html"; m_gmap.Navigate(queryAddress,NULL,NULL,NULL,NULL); CString str_fun_name = L"mod_list"; CComBSTR bstrMember(str_fun_name); IHTMLDocument2 *spDoc =(IHTMLDocument2*)m_gmap.GetDocument(); hr =spDoc->get_Script(&spScript); //这里正确 if ( FAILED(hr) ) { MessageBox("spScript error"); } spScript->lpVtbl hr = spScript->GetIDsOfNames(IID_NULL, &bstrMember,1,LOCALE_SYSTEM_DEFAULT, ispid);//这里出错了:ispid =-1if(FAILED(hr)) { CString str_error; str_error.Format("GetIDsOfNames 的dispid=%d",dispid); MessageBox(str_error); return; }..... 以下是html的代码 <html> <head> <script> function mod_list(class_name,str_text_orgi,str_text_current) { alert(class_name); alert(str_text_orgi); alert(str_text_current); if(class_name=="app") { document.write("app"+str_text_orgi+"replease"+str_text_current+" <br/>"); } else if(class_name=="ip") { document.write("ip"+str_text_orgi+"replease"+str_text_current+" <br/>"); } } </script> </head> <body> aaaa </body> </html> [/HTML] webBrowserMap.DocumentText = "<iframe width='1086' height='670' scrolling='no' frameborder='0' src='http://kel.o.cn/map.jsp?w=1086&h=670&x=546552&y=540880&z=5&m=1&b=1&popstr='></iframe>"; 请问C#中表达一个数的N次方用什么运算符? Winform 线程中使用SqlConnection的时候,由于关闭服务器上sqlserver服务造成的问题? 我的vs2005中的主菜单怎么没有"数据"一项? 创建数据库的问题`` VS2005中的MENU控件如何去掉菜单的右边小箭头??急!!!! 数据集的问题,各位帮忙~~~ 为什么在程序集中找不到类? ListBox滚动条隐藏并受控 (VC#) c# 窗体为什么最小化还原后越来越小 刚学,简单问题请教,如何书写过程,谢谢 关于c# web程序调用Excel预览和打印的问题 在链接服务器时出现以下错,请高手指点,我是用64位的SQl2008
2. 自己画地图,后台可以调用google map的地址解析服务把地址转换成坐标;
两种方式都需要申请key
http://hi.baidu.com/fncm/blog/item/07e834f78a6d3726730eec6b.html
方法应该是兄台说的第一个把,但是这个例子用得好象是google的key,还有既然是桌面应用程序这个key
是必需的?
1. winform里内嵌一个webbrowser就可以常规方式使用google map;
webbrowserd调用google map的方法能告诉的具体点吗(应该是调用js函数吧)?
http://code.google.com/intl/zh-CN/apis/maps/documentation/
char* queryAddress;
IDispatch *spScript;
DISPID dispid = NULL;
HRESULT hr; queryAddress = "c:\\g.html";
m_gmap.Navigate(queryAddress,NULL,NULL,NULL,NULL);
CString str_fun_name = L"mod_list"; CComBSTR bstrMember(str_fun_name);
IHTMLDocument2 *spDoc =(IHTMLDocument2*)m_gmap.GetDocument();
hr =spDoc->get_Script(&spScript);
//这里出错了
if ( FAILED(hr) )
{
MessageBox("spScript error");
}
spScript->lpVtbl
hr = spScript->GetIDsOfNames(IID_NULL, &bstrMember,1,LOCALE_SYSTEM_DEFAULT, ispid);
//这里出错了:ispid =-1
if(FAILED(hr))
{
CString str_error;
str_error.Format("GetIDsOfNames 的dispid=%d",dispid);
MessageBox(str_error);
return;
}
.....
以下是html的代码
[code=HTML]
<html>
<head>
<script>
function mod_list(class_name,str_text_orgi,str_text_current)
{
alert(class_name);
alert(str_text_orgi);
alert(str_text_current);
if(class_name=="app")
{ document.write("app"+str_text_orgi+"replease"+str_text_current+" <br/>"); }
else if(class_name=="ip")
{ document.write("ip"+str_text_orgi+"replease"+str_text_current+" <br/>");
} }
</script>
</head>
<body>
aaaa
</body>
</html>
[/HTML]
HINSTANCE hInst = ::LoadLibrary( _T("OLEACC.DLL") );
char* queryAddress;
IDispatch *spScript;
DISPID dispid = NULL;
HRESULT hr; queryAddress = "c:\\g.html";
m_gmap.Navigate(queryAddress,NULL,NULL,NULL,NULL);
CString str_fun_name = L"mod_list"; CComBSTR bstrMember(str_fun_name);
IHTMLDocument2 *spDoc =(IHTMLDocument2*)m_gmap.GetDocument();
hr =spDoc->get_Script(&spScript);
//这里正确
if ( FAILED(hr) )
{
MessageBox("spScript error");
}
spScript->lpVtbl
hr = spScript->GetIDsOfNames(IID_NULL, &bstrMember,1,LOCALE_SYSTEM_DEFAULT, ispid);
//这里出错了:ispid =-1
if(FAILED(hr))
{
CString str_error;
str_error.Format("GetIDsOfNames 的dispid=%d",dispid);
MessageBox(str_error);
return;
}
.....
以下是html的代码
<html>
<head>
<script>
function mod_list(class_name,str_text_orgi,str_text_current)
{
alert(class_name);
alert(str_text_orgi);
alert(str_text_current);
if(class_name=="app")
{ document.write("app"+str_text_orgi+"replease"+str_text_current+" <br/>"); }
else if(class_name=="ip")
{ document.write("ip"+str_text_orgi+"replease"+str_text_current+" <br/>");
} }
</script>
</head>
<body>
aaaa
</body>
</html>
[/HTML]