Quartz 作曲家 JavaScript
我真的很困惑所以任何帮助将不胜感激。蒂亚!
我有一个 Quartz Composition,我想在其中显示街景(来自 Google 地图)并能够控制导航(如能够前进等)。这意味着我需要一个 JavaScript,但我不知道如何将 QC 中的 JavaScript 补丁与 Google Maps API 链接起来。
那么如何添加两个代表纬度和经度的字符串并显示街景呢?
以下是 Google 执行此操作的 HTML 示例:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
function initialize() {
var bryantPark = new google.maps.LatLng(37.869260, -122.254811);
var panoramaOptions = {
position:bryantPark,
pov: {
heading: 90,
pitch:0,
zoom:0
}
};
var myPano = new google.maps.StreetViewPanorama(document.getElementById("pano"), panoramaOptions);
myPano.setVisible(true);
}
</script>
</head>
<body onload="initialize()">
<div id="pano" style="width: 1280px; height: 1024px"></div>
</body>
</html>
How can I do this in Quartz Composer JavaScript Patch or any other patch?
多谢!
PS:它已经通过使用用于 QC 的 CoGe Webkit 插件加载页面来部分工作。但我不知道如何通过 QC 控制 HTML 中的 JavaScript。还有其他方法可以将变量从 QC 发送到 HTML 页面或类似的内容吗?
I'm really stuck so any help would be appreciated. TIA!
I have a Quartz Composition in which I want to display a Streetview (from Google Maps) and be able to control the navigation (as in be able to advance forward, etc.). This would mean I need a JavaScript for it and I've got no idea on how to link the JavaScript Patch in QC with the Google Maps API.
So how could I add two strings, representing Lat and Long and display the Streetview?
Here is a sample HTML from Google doing that:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
function initialize() {
var bryantPark = new google.maps.LatLng(37.869260, -122.254811);
var panoramaOptions = {
position:bryantPark,
pov: {
heading: 90,
pitch:0,
zoom:0
}
};
var myPano = new google.maps.StreetViewPanorama(document.getElementById("pano"), panoramaOptions);
myPano.setVisible(true);
}
</script>
</head>
<body onload="initialize()">
<div id="pano" style="width: 1280px; height: 1024px"></div>
</body>
</html>
How could I do this in Quartz Composer JavaScript Patch or any other patch?
Thanks a lot!
P.S.: It already works partially by loading the page with CoGe Webkit Plugin for QC. But I have no idea on how to control the JavaScript inside the HTML via QC. Any other way to send variables from QC to a HTML page or anything similar?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
其实很简单,希望对其他人也有帮助。
HTML:
QC:
感谢 CoGe WebKit 插件的创建者 Tamas Nagy 的回答!
Really easy actually, hope it will help others as well.
HTML:
QC:
Thanks to the creator of the CoGe WebKit plugin, Tamas Nagy for the answer!