Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

70 lines (62 sloc) 3.422 kb
<title>GeoExt MapPanel in an Ext Window</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<link rel="stylesheet" type="text/css" href="" />
<link rel="stylesheet" type="text/css" href="" />
<script src=""></script>
OpenLayers.Layer.Google.v3.repositionMapElements = function() {
// This is the first time any Google layer in this mapObject has been
// made visible. The mapObject needs to know the container size.
google.maps.event.trigger(this.mapObject, "resize");
var div = this.mapObject.getDiv().firstChild;
if (!div || div.childNodes.length < 3) {
this.repositionTimer = window.setTimeout(
OpenLayers.Function.bind(this.repositionMapElements, this),
return false;
var cache = OpenLayers.Layer.Google.cache[];
var container =;
// move the ToS and branding stuff up to the container div
// depends on value of zIndex, which is not robust
for (var i=div.children.length-1; i>=0; --i) {
if (div.children[i].style.zIndex == 1000001) {
var termsOfUse = div.children[i];
container.appendChild(termsOfUse); = "1100"; = "";
termsOfUse.className = "olLayerGoogleCopyright olLayerGoogleV3"; = "";
cache.termsOfUse = termsOfUse;
if (div.children[i].style.zIndex == 1000000) {
var poweredBy = div.children[i];
container.appendChild(poweredBy); = "1100"; = "";
poweredBy.className = "olLayerGooglePoweredBy olLayerGoogleV3 gmnoprint"; = "";
cache.poweredBy = poweredBy;
if (div.children[i].style.zIndex == 10000002) {
<script type="text/javascript" src="../lib/GeoExt.js"></script>
<script type="text/javascript" src="mappanel-window.js"></script>
<h1>GeoExt.MapPanel in an Ext.Window</h1>
<p>This example shows the how to place a MapPanel in another Ext container
without creating a map first. See <a href="mappanel-div.html">mappanel-div.html</a>
for an example that creates the map before creating the map panel.<p>
<p>The js is not minified so it is readable. See <a href="mappanel-window.js">mappanel-window.js</a>.</p>
Jump to Line
Something went wrong with that request. Please try again.