当前位置:编程学习 > C#/ASP.NET >>

使用Google web API的困惑

小弟最近需要用到google web api,就是在C#编写的窗口应用程序中调用这个api,能够获取google的查询结果并对这些结果进行处理。但是这个api貌似现在已经停止服务了。请问具体是怎么回事?另外Google Ajax search api能实现相同的功能吗?请问诸位还知道什么API能实现这种功能吗?
--------------------编程问答-------------------- UP
没接触过 --------------------编程问答-------------------- oo --------------------编程问答-------------------- 帮你顶 --------------------编程问答-------------------- http://www.cnblogs.com/fhmsha/archive/2008/12/28/how_google_map_api_and_google_earth_work_with_kml.html
http://www.cnblogs.com/moozi/archive/2008/11/08/1329113.html

--------------------编程问答-------------------- 关注。。。 --------------------编程问答-------------------- google 的ajax search api 结果跟官网搜索结果又差异 --------------------编程问答-------------------- 有前些天用客户端的电脑演示一个东西,客户都坐好了,发现演示程序要从 go.micrisoft.com 下载一个正式发行的(至少)几十万商用软件都用过的组件,此时这个网站通过客户这里访问好像被屏蔽了(因为我试了其它地点访问)。

那个无奈啊! --------------------编程问答-------------------- 可能是这种情况:
谷歌的api默认是应用到web开发的,而且一个key只对应一个根目录/域名。如果你不是通过域名访问调用api的web页面,一段时间以后,该key就会被谷歌监视。进而不能正常使用。
以上纯属个人在开发中的经验,毫无官方依据, 仅供参考。 --------------------编程问答-------------------- --------------------编程问答-------------------- <script language="javascript">

if (<%=Session["FlagTrackQueue"].ToString()%> != "0")
{
ctimer1();
}
function ctimer1()
{
setInterval("Refresh()",2000);
}

if(<%=Session["CarWatch"].ToString()%> != "0")
{
ctimer2();
}
function ctimer2()
{
setInterval("Refresh()",5000);
}
function Refresh()
{
location.href = location.href;
}
//定时器函数
function ctimer()
{
setInterval("Check()",10000);
}

function Check()
{
var htp =new ActiveXObject("microsoft.xmlhttp");
htp.open("POST","WebForm1.aspx?c=8",false);
htp.send();
if(htp.responsetext=="1"){location.href = location.href;}
}

function ResizeMap()
{
var wid = document.body.clientWidth;
var hei = document.body.clientHeight;
var htp =new ActiveXObject("microsoft.xmlhttp");
htp.open("POST","WebForm1.aspx?wid="+wid+"&hei="+hei,false);
htp.send();
if(htp.responsetext=="1"){location.href = location.href;}
}

function FirstResizeMap()
{
var first="<%=first%>";
if(first=="yes") 
{
var wid = document.body.clientWidth;
var hei = document.body.clientHeight;
var htp =new ActiveXObject("microsoft.xmlhttp");
htp.open("POST","WebForm1.aspx?wid="+wid+"&hei="+hei,false);
htp.send();
if(htp.responsetext=="1"){location.href = location.href;}
}
}

var ToolbarState="";
function MouseOverState(src,tools)
{
if (src==ToolbarState)
{
src.className=ToolbarState.className;
}
else
{
src.className=tools+"Over2";
}
}

function MouseOverState1(src,tools)
{
if (src==ToolbarState)
{
src.className=ToolbarState.className;
}
else
{
src.className=tools+"Over3";
}
}
function MouseOutState(src,tools)
{
if (src==ToolbarState)
{
src.className=ToolbarState.className;
}
else
{
src.className=tools+"Normal2";
}
}

ctimer();
</script>
我也是在做api,车辆gps定位,看看能不能帮助你? --------------------编程问答-------------------- up --------------------编程问答--------------------

<body oncontextmenu="return false" onResize="ResizeMap()" leftMargin="0" topMargin="0"
scroll="no" onLoad="FirstResizeMap()" rightMargin="0"
bgcolor="#95bdff">
<form id="Form1" method="post" runat="server">
<TABLE id="Table1" style="Z-INDEX: 102; POSITION: absolute" cellSpacing="0" cellPadding="0"
width="780" border="0">
<TR>
<TD align="right">
<TABLE id="Table2" cellSpacing="0" cellPadding="0" width="780" bgcolor="#73a2d6" border="0">
<TR align="center">
<td width="2" bgColor="#95bdff"></td>
<!--地图工具栏开始-->
<td width="224" height="35">
<table cellSpacing="0" cellPadding="0" width="224" bgColor="#95bdff">
<tr>
<td colSpan="7" height="3"></td>
</tr>
<tr bgColor="#eaf2ff">
<td onMouseOver="MouseOverState(this,'tool')" onMouseOut="MouseOutState(this,'tool')"
width="32" height="32"><IMG onMouseOver="this.style.cursor='hand'" onClick="MapInfoWebSetCurrentTool('MapControl1', 'MapInfoWebPointSelection')"
height="32" alt="选择" src="images/5.gif" width="32"></td>
<td onMouseOver="MouseOverState(this,'tool')" onMouseOut="MouseOutState(this,'tool')"
width="32" height="32"><IMG onMouseOver="this.style.cursor='hand'" onClick="MapInfoWebSetCurrentTool('MapControl1', 'MapInfoWebZoomIn')"
height="32" alt="放大" src="images/1.gif" width="32"></td>
<td onMouseOver="MouseOverState(this,'tool')" onMouseOut="MouseOutState(this,'tool')"
width="32" height="32"><IMG onMouseOver="this.style.cursor='hand'" onClick="MapInfoWebSetCurrentTool('MapControl1', 'MapInfoWebZoomOut')"
height="32" alt="缩小" src="images/2.gif" width="32"></td>
<td onMouseOver="MouseOverState(this,'tool')" onMouseOut="MouseOutState(this,'tool')"
width="32" height="32"><IMG onMouseOver="this.style.cursor='hand'" onClick="MapInfoWebSetCurrentTool('MapControl1', 'MapInfoWebPan')"
height="32" alt="移动" src="images/3.gif" width="32"></td>
<td onMouseOver="MouseOverState(this,'tool')" onMouseOut="MouseOutState(this,'tool')"
vAlign="middle" align="center" width="32" height="32"><asp:imagebutton id="ibtnOverview" runat="server" AlternateText="鹰眼" ImageUrl="images/4.gif"></asp:imagebutton></td>
<td onMouseOver="MouseOverState(this,'tool')" style="WIDTH: 32px" onMouseOut="MouseOutState(this,'tool')"
width="32" height="32"><mapinfowebuiwebcontrols1:distancetoolcontrol id="DistanceToolControl1" runat="server" TooltipText="测距" DistanceUnit="Kilometer"
ActiveImageUrl="/WebCenter/images/6.gif" InactiveImageUrl="/WebCenter/images/6.gif" Height="32px" Width="32px" DistanceType="0" MapID="MapControl1"></mapinfowebuiwebcontrols1:distancetoolcontrol></td>
<td onMouseOver="MouseOverState(this,'tool')" onMouseOut="MouseOutState(this,'tool')"
width="40" height="32"><FONT face="宋体"><asp:imagebutton id="ibtnFullMap" runat="server" ImageUrl="images/19.gif" ToolTip="查看全图"></asp:imagebutton></FONT></td>
</tr>
</table>
</td>
<!--地图工具栏结束-->
<td width="2" bgColor="#ff95da"></td>
<!--围栏工具栏开始-->
<td width="164" height="35">
<table cellSpacing="0" cellPadding="0" width="164" bgColor="#ff95da">
<tr>
<td colSpan="3" height="3"></td>
</tr>
<tr bgColor="#ffeaf8">
<td onMouseOver="MouseOverState1(this,'tool')" onMouseOut="MouseOutState(this,'tool')"
width="32" height="32"><asp:imagebutton id="ibtnFence" runat="server" ImageUrl="images/20.gif" ToolTip="显示围栏" EnableViewState="False"></asp:imagebutton></td>
<td onMouseOver="MouseOverState1(this,'tool')" onMouseOut="MouseOutState(this,'tool')"
width="32" height="32"><IMG onMouseOver="this.style.cursor='hand'" onClick="MapInfoWebSetCurrentTool('MapControl1', 'RectangleTool')"
height="32" alt="围栏" src="images/18.gif" width="32"></td>
<td height="32"><asp:radiobutton id="rbtnForbidOut" runat="server" GroupName="FenceType" Checked="True" Text="禁出"></asp:radiobutton><asp:radiobutton id="rbtnForbidIn" runat="server" GroupName="FenceType" Text="禁入"></asp:radiobutton></td>
</tr>
</table>
</td>
<!--围栏工具栏结束-->
<td width="2" bgColor="#95bdff"></td>
<!--地图选择工具栏开始-->
<td width="140" height="35">
<table cellSpacing="0" cellPadding="0" width="164" bgColor="#95bdff">
<tr>
<td colSpan="2" height="3"></td>
</tr>
<tr bgColor="#eaf2ff">
<td align="right" width="40" height="32"><FONT face="宋体"><asp:label id="Label2" runat="server">地图:</asp:label></FONT></td>
<td width="100" height="32"><FONT face="宋体"><asp:dropdownlist id="DropDownList1" runat="server" Width="100px" BackColor="#E4EEF4" AutoPostBack="True" onselectedindexchanged="DropDownList1_SelectedIndexChanged"></asp:dropdownlist></FONT></td>
</tr>
</table>
</td>
<!--地图选择工具栏结束-->
<td width="2" bgColor="#ff95da"></td>
<!--轨迹回放工具栏开始-->
<td vAlign="middle" width="246" height="35">
<table cellSpacing="0" cellPadding="0" width="100%" bgColor="#ff95da">
<tr>
<td height="3"></td>
</tr>
<tr bgColor="#ffeaf8" height="32">
<td><asp:checkbox id="cboxTime" runat="server" Checked="True" Text="时间" AutoPostBack="True" Enabled="False" oncheckedchanged="cboxTime_CheckedChanged"></asp:checkbox><asp:checkbox id="cboxLine" runat="server" Width="64px" Checked="True" Text="连线" AutoPostBack="True"
Enabled="False" oncheckedchanged="cboxLine_CheckedChanged"></asp:checkbox></td>
</tr>
</table>
</td>
<!--轨迹回放工具栏结束-->
</TR>
</TABLE>
</TD>
</TR>
<tr>
<td colspan="5" height="1" bgcolor="#0099cc"></td>
</tr>
</TABLE>
<mapinfowebuiwebcontrols1:mapcontrol id="MapControl1" style="Z-INDEX: 101; LEFT: 0px; POSITION: absolute; TOP: 22px"
runat="server" Width="781px" Height="200px" UseDesigntimeWorkspace="True" Format="Gif" BorderWidth="0px" MapAlias="Map3"
BorderStyle="Solid" WorkspaceFileName="WebForm1MapControl1.mws" BorderColor="#95BDFF" onprerender="MapControl1_PreRender"></mapinfowebuiwebcontrols1:mapcontrol><mapinfowebuiwebcontrols1:mapcontrol id="MapControl2" onmouseover="this.style.cursor='crosshair'" style="DISPLAY: block; Z-INDEX: 103; LEFT: 620px; POSITION: absolute; TOP: 110px"
runat="server" Height="100px" Width="150px" WorkspaceFileName="WebForm1MapControl2.mws" BorderStyle="Solid" MapAlias="Map4" BorderWidth="0px" Format="Gif" UseDesigntimeWorkspace="True" Visible="False"></mapinfowebuiwebcontrols1:mapcontrol>
</form>
</body> --------------------编程问答-------------------- mapabc --------------------编程问答-------------------- 早些时候的api是已经终止了,现在只能使用ajax search api,我也在研究,但还存在许多问题,希望共同探讨学习,qq:327280271
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,