[Users] OverviewMap

Bart van den Eijnden bartvde at osgis.nl
Tue Feb 23 20:37:10 CET 2010


There is a ticket already:

http://trac.geoext.org/ticket/202

The way I did it until now is:

            addOverview: = function() {
                var mapOptions = {
                    maxExtent: new OpenLayers.Bounds(180000, 397000,200000, 414000),
                    maxResolution: 500,
                    projection: "EPSG:28992",
                    units: "m"
                };
                var controlOptions = {
                    size: new OpenLayers.Size(150, 100),
                    div: Ext.get('overviewmap'),
                    mapOptions: mapOptions,
                    /* destroy issues in IE to be fixed, workaround for now */
                    destroy: function() {},
                    layers: [new OpenLayers.Layer.WMS("overview", GisArts.WMSOnlineResource, {map: GisArts.MapFileParameter, layers: 'gemeentegrens,topografie,straatnamen'}, {buffer: 0, ratio: 1, singleTile: true})]
                };
                var overview = new OpenLayers.Control.OverviewMap(controlOptions);
                map.addControl(overview);
            };

and then:
                region: 'east',
                xtype: 'panel',
                layout: 'border',
                listeners: {'afterlayout': {fn: addOverview, single: true}},
                items: [
{xtype: 'panel', height: 150, title: 'Overzichtskaart', html: '<div id="overviewmap" style="width:100%;height:100%;"></div>', region: 'south'}
]

etc.

Best regards,
Bart

On Feb 23, 2010, at 7:06 PM, Matt Priour wrote:

> if you want an overview map in an extjs panel separate from the main map panel, I'm fairly certain that you would need to instead instantiate a new map panel with the overlay layers and hook up the main map pan & zoom events to make appropriate changes to the overview map.
>  
> This may be a good idea for a new widget. If others are interested in such functionality, I can file a ticket.
>  
> Matt Priour
> 
> From: Nils Krueger
> Sent: Tuesday, February 23, 2010 11:39 AM
> To: users at geoext.org
> Subject: [Users] OverviewMap
> 
> Hello...
> 
> I would like to show the OverviewMap in an own suitable panel display.
> Unfortunately, it doesn’t work. If so, is there any example? Or can anybody show me how to do this.
> 
> Thank you for your help!
> 
> Nils
> 
> <html>
> <head>
>     <title>OverMap</title>
>     <!--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="./lib/ext/resources/css/ext-all.css" />
>     
>     <!--script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script-->  
>     <script type="text/javascript" src="./lib/ext/adapter/ext/ext-base.js"></script>
>     <script type="text/javascript" src="./lib/ext/ext-all.js"></script>
>     
>      <script src="http://openlayers.org/api/2.8/OpenLayers.js"></script>
> 
>     
>     <script src="./lib/GeoExt/script/GeoExt.js" type="text/javascript"></script>
> 
> 
>     <script type="text/javascript">
>     var panel, map;
>     Ext.onReady(function(){
>         
>         var options_31467 = {
>                 projection:  new OpenLayers.Projection("EPSG:31467"),
>                 controls: [], 
>                 maxExtent: new OpenLayers.Bounds(3336848, 5208708, 3661609, 5575555),
>                 maxResolution: "auto",
>                 numZoomLevels: 20,
>                 units: 'm',
>         };
> 
> 
>         // create a new map
>         map = new OpenLayers.Map('map', options_31467);
>         
>         // create base layer 
>         var KreiseBW = new OpenLayers.Layer.WMS(
>                     "KreiseBW",
>                     "/geoserver/wms",
>                     {
>                         layers: 'topp:KreiseBW',
>                         isBaseLayer:true,
>                     }
>                     
>                 );
>                 
>         // create overview map
>         var ovMapLayer = new OpenLayers.Layer.WMS(
>             "Kreise", 
>             "/geoserver/wms", 
>             {
>                 layers: 'topp:BW',
>             }
>         );
>         
>         var ovMap = {
>             mapOptions: {
>                 projection: map.getProjection(),
>                 maxExtent: map.getMaxExtent()
>             },
>             layers: [ovMapLayer]
>         };
>         
>         //add Layers
>         map.addLayer(KreiseBW);
>         
>         //add Controls
>         map.addControl(new OpenLayers.Control.LayerSwitcher());
>         map.addControl(new OpenLayers.Control.Navigation());
>         map.addControl(new OpenLayers.Control.PanZoomBar({zoomWorldIcon: 'true'}));
>         
>         //map.addControl(new OpenLayers.Control.OverviewMap(ovMap));
>         
>         map.zoomToMaxExtent();
> 
>         //create layout
>         var overmap = new Ext.Panel({
>             title: 'Overmap',
>             // ???
>             control: new OpenLayers.Control.OverviewMap(ovMap),
>             //items: ovmap, 
>             height:150
>         });
> 
>         var toc = new Ext.Panel({
>             title:'TOC',
>             html: '&lt;empty panel&gt;',
>             cls:'empty'
>         });
>             
>         var west = new Ext.Panel({
>                 region:'west',
>                 margins:'5 0 5 5',
>                 split:true,
>                 width: 210,
>                 layout:'accordion',
>                 items: [overmap, toc]
>         });
> 
>         var map_panel = new GeoExt.MapPanel({
>             region:'center',
>             map: map,
>         });
>             
>         var view = new Ext.Viewport({
>                 layout:'border',
>                 items:[west, map_panel]
>             });
>         });
>     </script>
> </head>
> <body>
> </body>
> </html>
> 
> 
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20100223/66eca361/attachment.htm 


More information about the Users mailing list