[Commits] r1565 - in sandbox/cmoullet/ux/GoogleEarthPanel: examples ux/widgets
commits at geoext.org
commits at geoext.org
Mon Dec 7 13:57:11 CET 2009
Author: cmoullet
Date: 2009-12-07 13:57:11 +0100 (Mon, 07 Dec 2009)
New Revision: 1565
Added:
sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelEpflExample.html
sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelEpflExample.js
Modified:
sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelExample.js
sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js
Log:
Add example with KML data, support kml as network link
Added: sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelEpflExample.html
===================================================================
--- sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelEpflExample.html (rev 0)
+++ sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelEpflExample.html 2009-12-07 12:57:11 UTC (rev 1565)
@@ -0,0 +1,39 @@
+<html>
+<head>
+ <title>GeoExt Google Earth Panel UX EPFL Example</title>
+ <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script>
+ <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css" />
+ <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/examples/shared/examples.css" />
+ <!-- Google Maps API for "localhost" -->
+ <!--
+ <script src='http://maps.google.com/maps?file=api&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
+ <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAY-I0w1WyNCVHbxpuwQWMpRTv_-xvSZ6KJmWSkQfCJoxbiB7tyBQ1ey_kgwA_p7sbTQSTOBeMyXtXkA"></script>
+ -->
+ <!-- 192.168.1.44 -->
+ <!--
+ <script src='http://maps.google.com/maps?file=api&key=ABQIAAAAY-I0w1WyNCVHbxpuwQWMpRSIMweZSjbRtcUk2F5YNqLnri0MahTrQJRaRPWFP0OUB1b6unv37Jg7vQ'></script>
+ <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAY-I0w1WyNCVHbxpuwQWMpRSIMweZSjbRtcUk2F5YNqLnri0MahTrQJRaRPWFP0OUB1b6unv37Jg7vQ"></script>
+ -->
+ <!-- 10.27.10.44 -->
+ <!--
+ <script src='http://maps.google.com/maps?file=api&key=ABQIAAAAY-I0w1WyNCVHbxpuwQWMpRQg15vMUgV9rqK5U3tGsPdx8x_OsBTeBHQ0wK75MLc8dB7yu0cRx36VJQ'></script>
+ <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAY-I0w1WyNCVHbxpuwQWMpRQg15vMUgV9rqK5U3tGsPdx8x_OsBTeBHQ0wK75MLc8dB7yu0cRx36VJQ"></script>
+ -->
+
+ <!-- Google Maps API for "dev.geoext.org" -->
+ <!-- -->
+ <script src='http://maps.google.com/maps?file=api&key=ABQIAAAAY-I0w1WyNCVHbxpuwQWMpRTv_-xvSZ6KJmWSkQfCJoxbiB7tyBQ1ey_kgwA_p7sbTQSTOBeMyXtXkA'></script>
+ <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAY-I0w1WyNCVHbxpuwQWMpRTv_-xvSZ6KJmWSkQfCJoxbiB7tyBQ1ey_kgwA_p7sbTQSTOBeMyXtXkA"></script>
+
+
+ <script src="http://openlayers.org/api/2.8/OpenLayers.js"></script>
+ <script type="text/javascript" src="../../../trunk/geoext/lib/GeoExt.js"></script>
+
+ <script type="text/javascript" src="../ux/widgets/GoogleEarthPanel.js"></script>
+ <script type="text/javascript" src="../ux/control/GoogleEarthClick.js"></script>
+ <script type="text/javascript" src="GoogleEarthPanelEpflExample.js"></script>
+
+</head>
+<body>
+</body>
+</html
\ No newline at end of file
Added: sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelEpflExample.js
===================================================================
--- sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelEpflExample.js (rev 0)
+++ sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelEpflExample.js 2009-12-07 12:57:11 UTC (rev 1565)
@@ -0,0 +1,125 @@
+var mapPanel;
+
+var GoogleEarthPanel;
+
+var viewport;
+
+var layer;
+
+google.load("earth", "1");
+
+Ext.onReady(function() {
+
+ var options;
+ var center = new OpenLayers.LonLat(730909, 5863990);
+
+ options = {
+ projection: new OpenLayers.Projection("EPSG:900913"),
+ units: "m",
+ numZoomLevels: 18,
+ maxResolution: 156543.0339,
+ maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
+ 20037508, 20037508.34)
+ };
+
+ layer = new OpenLayers.Layer.Google(
+ "Google Street", {sphericalMercator: true});
+
+ var map = new OpenLayers.Map(options);
+
+ var mouse = new OpenLayers.Control.MousePosition();
+
+ map.addControl(mouse);
+ mouse.activate();
+
+ var toolbar = new Ext.Toolbar({
+ items: [
+ {
+ xtype: 'tbfill'
+ },
+ {
+ text: 'Google Earth',
+ id: "googleToggle",
+ enableToggle: true,
+ pressed: true,
+ handler: function() {
+ if (this.pressed) {
+ GoogleEarthPanel.add(googleEarthPanelItem);
+ GoogleEarthPanel.setSize('50%', 0);
+ GoogleEarthPanel.setVisible(true);
+ GoogleEarthPanel.doLayout();
+ viewport.doLayout();
+ } else {
+ GoogleEarthPanel.remove('googleEarthPanelItem');
+ GoogleEarthPanel.setWidth(0);
+ GoogleEarthPanel.setVisible(false);
+ GoogleEarthPanel.doLayout();
+ viewport.doLayout();
+ }
+ }
+ },
+ {
+ text: 'Permalink',
+ enableToggle: false,
+ handler: function() {
+ var googleEarthPanelItem = Ext.getCmp("googleEarthPanelItem");
+ if (googleEarthPanelItem) {
+ window.open(googleEarthPanelItem.getPermalink(true));
+ }
+ }
+ }
+ ]});
+
+ var googleEarthPanelItem = {
+ xtype: 'gxux_googleearthpanel',
+ id: 'googleEarthPanelItem',
+ map: map,
+ networkLinkUrl: 'http://epfl-carto-plan2.demo-camptocamp.com/epfl/trunk/kml/BATI3D_EPFL.kmz',
+ altitude: 50,
+ heading: 91,
+ tilt: 70,
+ range: 96
+ };
+
+ viewport = new Ext.Viewport({
+ layout: "border",
+ id: 'mainViewport',
+ items: [
+ {
+ region: "center",
+ id: "mappanel",
+ title: "Google Map",
+ xtype: "gx_mappanel",
+ map: map,
+ layers: [layer],
+ center: center,
+ zoom: 16,
+ split: true,
+ tbar: toolbar
+ },
+ {
+ region: "east",
+ layout: 'fit',
+ width: '50%',
+ id: "googleearthpanel",
+ title: 'Google Earth Panel',
+ closeAction: 'hide',
+ split: true
+ },
+ {
+ region: "south",
+ layout: 'fit',
+ id: "readme",
+ title: 'README',
+ margins: {left: 5,top: 5, bottom: 5, right: 5},
+ html: '<p style="font-size:12pt;color:#15428B;font-weight:bold;margin:5">Google Earth Panel in action. Enjoy !</p>'
+ }
+ ]
+ });
+
+ mapPanel = Ext.getCmp("mappanel");
+ GoogleEarthPanel = Ext.getCmp("googleearthpanel");
+ GoogleEarthPanel.add(googleEarthPanelItem);
+ GoogleEarthPanel.doLayout();
+ viewport.doLayout();
+});
\ No newline at end of file
Modified: sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelExample.js
===================================================================
--- sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelExample.js 2009-12-07 12:17:10 UTC (rev 1564)
+++ sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelExample.js 2009-12-07 12:57:11 UTC (rev 1565)
@@ -12,7 +12,6 @@
var options;
var center = new OpenLayers.LonLat(-13625995.09, 4550849.74);
- var lookAt = new OpenLayers.LonLat(-13625995.09, 4550849.74);
options = {
projection: new OpenLayers.Projection("EPSG:900913"),
Modified: sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js
===================================================================
--- sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js 2009-12-07 12:17:10 UTC (rev 1564)
+++ sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js 2009-12-07 12:57:11 UTC (rev 1565)
@@ -141,6 +141,14 @@
*/
kmlUrl: null,
+ /** api: config[networkLinkUrl]
+ * Url for network link (default: null)
+ */
+ /** private: property[networkLinkUrl]
+ * Url for network link
+ */
+ networkLinkUrl: null,
+
/** api: config[layers]
* WMS Layers that are visible in Google Earth
* Required: a cartographic server that provide KML content
@@ -265,6 +273,17 @@
});
}
+ // Use network link
+ if (this.networkLinkUrl) {
+ var link = this.ge.createLink('');
+ var href = this.networkLinkUrl
+ link.setHref(href);
+
+ var networkLink = this.ge.createNetworkLink('');
+ networkLink.set(link, true, false); // Sets the link, refreshVisibility, and flyToView
+ this.ge.getFeatures().appendChild(networkLink);
+ }
+
if (this.layers) {
for (i = 0; i < this.layers.length; i++) {
var layer = this.layers[i];
More information about the Commits
mailing list