Google地球插件忽略的KML中的JavaScript(JavaScript In KML Ignored By Google Earth Plugin)
我创建了一个简单的KML文件,可以在独立的Google地球客户端中运行,但在Google地球插件中无论如何都不起作用(无论浏览器如何):
<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom"> <Folder> <name>South Florida</name> <open>1</open> <Document> <name>Miami</name> <Style id="miami_style"> <IconStyle> <Icon> <href>http://i.imgur.com/CNrRU.gif</href> </Icon> </IconStyle> <BalloonStyle> <text><![CDATA[<font face="Arial">$[description]</font>]]></text> </BalloonStyle> </Style> <Folder> <name>Miami</name> <open>1</open> <Placemark id="Miami"> <name>Miami</name> <description><![CDATA[ <script type="text/javascript"> function hideImage() { var image = document.getElementById("image"); image.style.opacity = 0; image.style.MozOpacity = 0; image.style.KhtmlOpacity = 0; image.filter = "alpha(opacity=0)"; } </script> <button id='clicker' onclick='hideImage();'>Click Me</button> <img id="image" src="http://i.imgur.com/4rhT7.png"> ]]></description> <styleUrl>#miami_style</styleUrl> <Point> <coordinates>-80.22643611111111,25.788952777777777,0</coordinates> </Point> </Placemark> </Folder> </Document> </Folder> </kml>
基本上,我有一个默认显示的图像,当我点击按钮时,我想让它消失。 最终,我希望能够通过点击切换图像,但我认为这需要首先工作才能达到这一步。
这在独立的Google地球中完美运行,但在Google地球插件中不起作用。
奇怪的是,如果我在显示气球后在JavaScript控制台中运行它,这也适用于Google地球插件。 它只是不承认文件中已存在的代码。
有任何想法吗?
I've created a simple KML file that works in the standalone Google Earth client, but won't work at all in the Google Earth Plugin (regardless of browser):
<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom"> <Folder> <name>South Florida</name> <open>1</open> <Document> <name>Miami</name> <Style id="miami_style"> <IconStyle> <Icon> <href>http://i.imgur.com/CNrRU.gif</href> </Icon> </IconStyle> <BalloonStyle> <text><![CDATA[<font face="Arial">$[description]</font>]]></text> </BalloonStyle> </Style> <Folder> <name>Miami</name> <open>1</open> <Placemark id="Miami"> <name>Miami</name> <description><![CDATA[ <script type="text/javascript"> function hideImage() { var image = document.getElementById("image"); image.style.opacity = 0; image.style.MozOpacity = 0; image.style.KhtmlOpacity = 0; image.filter = "alpha(opacity=0)"; } </script> <button id='clicker' onclick='hideImage();'>Click Me</button> <img id="image" src="http://i.imgur.com/4rhT7.png"> ]]></description> <styleUrl>#miami_style</styleUrl> <Point> <coordinates>-80.22643611111111,25.788952777777777,0</coordinates> </Point> </Placemark> </Folder> </Document> </Folder> </kml>
Basically, I have an image that displays by default, and I want to make it go away when I click the button. Eventually, I want to be able to toggle images by clicking, but I figure this needs to work first in order to get to that step.
This works perfectly fine in standalone Google Earth, but doesn't work in the Google Earth Plugin.
Oddly, this also works in the Google Earth Plugin if I run it in a JavaScript console after the balloon is already displayed. It just doesn't acknowledge the code already in the file.
Any ideas?
原文:https://stackoverflow.com/questions/8153120
最满意答案
SELECT DISTINCT e.ssn, e.lname, e.fname FROM employee e, (SELECT mgrssn AS mgrssn FROM department UNION SELECT superssn AS mgrssn FROM employee) m WHERE e.ssn = m.mgrssn;
应该管用。
我不确定外部联接或GROUP BY如何在这里为您服务; 一个表从一个表中返回第二个表中没有相应行的行,而另一个表用于通过聚合函数将多个行压缩为一个。
我也不确定是什么
2)因为我使用两个empoyees,一个导师告诉我,我可以使用employee1和employee2来区分它们,是吗? 反正有没有使用两名员工身份证明?
手段。 您可以使用
employee1
和employee2
作为employee2
别名 ,这将允许您对同一个表进行多个独立引用,但是无论您使用多少别名,数据库中仍然只有一个employee
表。SELECT DISTINCT e.ssn, e.lname, e.fname FROM employee e, (SELECT mgrssn AS mgrssn FROM department UNION SELECT superssn AS mgrssn FROM employee) m WHERE e.ssn = m.mgrssn;
should work.
I'm not sure how either an outer join or a GROUP BY would serve you here; one returns rows from one table which have no corresponding row in a second table, while the other is used for condensing multiple rows into one via aggregate functions.
I'm also not sure what
2) Also since I use two empoyees, one tutor told me I can use employee1 and employee2 to differentiate them, is that right? Are there anyways not using two employees identification?
means. You could use
employee1
andemployee2
as aliases foremployee
, which would allow you to make multiple independent references to the same table, but however many aliases you use, there's still only oneemployee
table in the database.
相关问答
更多-
使用外连接的SQL查询?(SQL Query using outer join?)[2023-03-30]
LEFT JOIN是一个好主意。 但是,您希望委托日期在ON子句中。 然后找到不匹配的员工。 所以,这是查询的一个版本(清理使用表别名): SELECT e.EmpId, e.EmpName FROM Employee e LEFT OUTER JOIN Commission c ON e.EmpId = c.EmpId AND c.Commdate BETWEEN '2014-06-01' AND '2014-06-31' WHERE e.JoinDate < '201 ... -
左外连接和分组依据(Left outer join and group by)[2022-03-23]
有一种方法可以在LINQ中保持连接,但这是真的 - 语法不是那么清楚。 您的查询将如下所示: var query = from year in years join data in myData on year equals (data.Expiration.Year - DateTime.Now.Year) + 1 into year_data from y_d in year_data.Def ... -
Sybase外连接行为(Sybase outer join behaviour)[2022-01-07]
尝试移动AND P.qty is not null从WHERE子句到连接表达式的AND P.qty is not null 。 Try moving AND P.qty is not null from the WHERE clause to the join expression. -
外部加入集团(Outer Join with Group)[2023-12-17]
尝试下面的查询, SELECT C.CustomerID, C.CustomerName, L.CalYear, L.CalMonth, Sum(P.Amt) FROM Customers C CROSS JOIN @Cal L LEFT OUTER JOIN Purchases P ON C.CustomerID = P.CustomerID AND L.CalYear = Year(P.Purchas ... -
我不太确定你想要达到什么目的? 如果您正在查询每个员工返回一行,并且两个可选列包含经理的信息,那么您的原始查询是正确的(没有分组依据)。 这种关系是多对一的,你从每个“很多”的行开始,每行有一个(可选的)“一”,所以不需要分组。 然而,这假设您的数据是正确的,并且prs_number实际上对每个员工都是唯一的。 如果您有两个或更多经理共享prs_number,您最终将拥有拥有多个经理的人员。 通过使这成为一个外部联接你也返回没有经理的人(即食物链的顶端:)),这是你的意图吗? 编辑 如果您只想要返回经理,那 ...
-
使用组加入: groupedOccurrences = (from e in db.Employees join o in db.Occurrences.Where(x => x.OccurrenceDate >= beginDate && x.OccurrenceDate <= endDate) ...
-
我猜你把GROUP BY放在了WHERE之后,这是非法的。 请参阅MySQL中SELECT语法的参考资料 。 尝试这个: SELECT s.id AS id, s.story_date AS datetime, s.story_content AS content, t.story_type_label AS type_label, t.story_type_slug AS type_slug, COUNT(c.id) AS comment_count FRO ...
-
SELECT DISTINCT e.ssn, e.lname, e.fname FROM employee e, (SELECT mgrssn AS mgrssn FROM department UNION SELECT superssn AS mgrssn FROM employee) m WHERE e.ssn = m.mgrssn; 应该管用。 我不确定外部联接或GROUP BY如何在这里为您服务; 一个表从一个表中返回第二个表中没有相应行的行,而另一个表用于通过聚合 ...
-
我想你可能需要走很远的路: SELECT TableA.Type, SUM(b.HreReelles) AS HreReellesTotales, b.NoProjet_Short FROM TableA LEFT JOIN (SELECT * FROM TableB WHERE TableB.ColumnName = 'SomeValue') b ON TableA.IDType = b.IDType WHERE TableA.Categorie = 'Electrique' ...
-
解决MySQL和Oracle问题的一种方法是使用子查询通过按名称汇总详细信息表中的总和来帮助解决重复问题,这样您就可以使用普通连接进行汇总。 SELECT ts.name, SUM(ts.amt) amt1, MAX(td1.amt) amt2, MAX(td2.amt) amt3 FROM TEST_SUMMARY ts LEFT JOIN ( SELECT ts.name, SUM(td.d_amt) amt FROM TEST_DETAIL td JOIN TEST_SUMMARY ts O ...