[Users] Rendering Overviewmap in Ext.Panel using viewport

Andrew Stewart Andrew.Stewart at reddeer.ca
Tue Sep 28 16:10:51 CEST 2010


   Hi, thanks for your suggestion. I am not sure if I have this correctly since I have never used a BoxComponent before. Unfortunately I tried the below code and my overview map doesn't seem to show up anywhere, any idea what could be wrong? Appreciate the assistance.

 //Define options for overview Map
        var options = {layers: [layer_Overview], units: 'km', maxExtent: new 
        OpenLayers.Bounds(-114.167163950302,52.0782516055391,-113.454306937636,52.4066932849551).transform(new 
        OpenLayers.Projection("EPSG:4326"), new 
        OpenLayers.Projection("EPSG:900913")),
        numZoomLevels: 1,
        projection: new OpenLayers.Projection("EPSG:900913"),
        displayProjection: new 
        OpenLayers.Bounds(-114.167163950302,52.0782516055391,-113.454306937636,52.4066932849551).transform(new 
        OpenLayers.Projection("EPSG:4326"), new 
        OpenLayers.Projection("EPSG:900913"))}
        
        
        var overviewBox = Ext.extend(Ext.BoxComponent, {
        map: map,
        afterRender: function() {
        var redgisOverview = new OpenLayers.Control.OverviewMap({
            div: this.getEl(overview).dom,
            mapOptions: options
            //div: container_overview
        });
        this.map.addControl(redgisOverview);
        redgisOverview.superclass.afterRender.apply(this, arguments);
        }
        }); 


<body onload="init();">
        <div id="themes">test 
        </div>
         <div id="legend">   
        </div>
        <div id="tools">  
        </div>
        <div id="overview"></div>  
    </body>



-----Original Message-----
From: Eric Lemoine [mailto:eric.lemoine at camptocamp.com] 
Sent: September 28, 2010 1:33 AM
To: Andrew Stewart
Cc: users at geoext.org
Subject: Re: [Users] Rendering Overviewmap in Ext.Panel using viewport

On Mon, Sep 27, 2010 at 11:21 PM, Andrew Stewart
<Andrew.Stewart at reddeer.ca> wrote:
> I have searched through the forums on how to do this by using a container
> DIV when declaring my overviewmap control and then using the contentEl to
> put the overview div into my custom panel but it is still not working. With
> my below code for some reason the overviewmap I have does go into the proper
> div but it is still directly above my Panel instead of inside it, can anyone
> assist on what I am doing wrong? Really appreciate it!

Here's what we've used for wrapping a MousePosition in a BoxComponent:

MousePositionBox = Ext.extend(Ext.BoxComponent, {
    map: null,
    afterRender: function() {
        var control = new OpenLayers.Control.MousePosition({
            div: this.getEl().dom,
            numDigits: 0,
            prefix: "Coordinates (m):"
        });
        this.map.addControl(control);
        MousePositionBox.superclass.afterRender.apply(this, arguments);
    }
});

Applying this to the OverviewMap might just work.

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com


[This message has been scanned for security content threats and viruses.]

[The City of Red Deer I.T. Services asks that you please consider the environment before printing this e-mail.]






More information about the Users mailing list