gpt4 book ai didi

javascript - 将 Javascript 放入 Google 协作平台

转载 作者:行者123 更新时间:2023-11-28 09:32:18 25 4
gpt4 key购买 nike

我在将 google fusion 的查询嵌入到 google 网站时遇到问题。我已经创建了查询,它作为保存在记事本中的 html 文件运行,但是当我将其放入我的 Google 协作平台网站时,它不起作用。

查询代码为:

    <html>
<head>
<style>
#map-canvas { width:850px; height:650px; }
</style>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
var map;
var layerl0;
function initialize() {
map = new google.maps.Map(document.getElementById('map-canvas'), {
center: new google.maps.LatLng(43.89591323557617, -79.77653503417969),
zoom: 11,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
layerl0 = new google.maps.FusionTablesLayer({
query: {
select: "'col2'",
from: '1eMaZWdi5QhF1252KH2e7xOiNyJoBFOzpStMP-Ks'
},
map: map,
styleId: -1,
templateId: -1
});
}
function changeMapl0() {
var searchString = document.getElementById('search-string-l0').value.replace(/'/g, "\\'");
layerl0.setOptions({
query: {
select: "'col2'",
from: '1eMaZWdi5QhF1252KH2e7xOiNyJoBFOzpStMP-Ks',
where: "'description' CONTAINS IGNORING CASE '" + searchString + "'"
}
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>

<div id="map-canvas"></div>
<div style="margin-top: 10px;">
<label>Land use:</label><input type="text" id="search-string-l0">
<input type="button" onclick="changeMapl0()" value="Search">
</div>
</body>

最佳答案

您是否尝试过使用 Google 小工具让您的代码在协作平台中运行?也就是说,将代码放入 Google 小工具中,然后通过编辑器中的插入菜单将小工具添加到您的网站页面。

如果您还没有这样做,请从这里开始: https://developers.google.com/gadgets/

另一种选择是使用 HTML 框,或制作 Apps 脚本。

关于javascript - 将 Javascript 放入 Google 协作平台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13590310/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com