Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding OverviewMap Make The Map hidden #261

Closed
zkrami opened this issue Mar 11, 2017 · 5 comments
Closed

Adding OverviewMap Make The Map hidden #261

zkrami opened this issue Mar 11, 2017 · 5 comments

Comments

@zkrami
Copy link

zkrami commented Mar 11, 2017

Hi I'm a bit new to geoext3
I saw the example of making OverviewMap and I tried to make one like it
but whenever I add the overviewmap the main map disappear
here's my code
(the sample is working fine on my device)

Ext.require([
    'GeoExt.component.Map',
    'Ext.panel.Panel',
    'Ext.Viewport' , 
    'GeoExt.component.OverviewMap'
]);

var olMap;
var mapComponent;
var mapPanel;

Ext.application({
    name: 'MapComponent',
    launch: function() {
        var description;
       
        var projection = new ol.proj.Projection({
            code: 'urn:x-ogc:def:crs:EPSG:2000',
            units: 'm',
            axisOrientation: 'neu',
            global: false
        });

        olMap = new ol.Map({
            layers: [
                new ol.layer.Image({
                    source: new ol.source.ImageWMS({
                        ratio: 1,
                        url: 'http://localhost:8080/geoserver/wms',
                        params: {
                            'FORMAT': 'image/png',
                            'VERSION': '1.1.1',
                            STYLES: '',
                            LAYERS: 'Syria'
                        }  
                    })
                })
            ],
            view: new ol.View({
                projection: projection
            })
        });
        
        mapComponent = Ext.create('GeoExt.component.Map', {
            map: olMap
        });

        mapPanel = Ext.create('Ext.panel.Panel', {
            title: 'GeoExt.component.Map Example',
            region: 'center',
            layout: 'fit',
            border:false ,            
            items: [mapComponent]
        });

        description = Ext.create('Ext.panel.Panel', {
            contentEl: 'description',
            title: 'Description',
            region: 'east',
            width: 300,
            border: true,
            bodyPadding: 5
        });
        
      var overviewMap = Ext.create('GeoExt.component.OverviewMap', {
            parentMap: olMap
        });
        
        var ovMapPanel1 = Ext.create('Ext.panel.Panel', {
            title: 'OverviewMap (default)',
            flex: 1,
            layout: 'fit',
            items: overviewMap
        });
        
        Ext.create('Ext.Viewport', {
            layout: 'border',
            items: [
                mapPanel ,
                {
                    xtype: 'panel',
                    region: 'east',
                    width: 400,
                    border: false,
                    layout: {
                        type: 'vbox',
                        align: 'stretch'
                    },
                    items: [
                        description 
                  //      ,ovMapPanel1 
                        
                        
                    ]
                }
            ]
        });
        
        var bounds = [-50, -50,
                50, 50];
       olMap.getView().fit(bounds, olMap.getSize());
    }
});
@marcjansen
Copy link
Member

Does the mapPanel alone render?

@zkrami
Copy link
Author

zkrami commented Mar 14, 2017

Actually I don't know , how can I check that ?

@marcjansen
Copy link
Member

Try this:

        Ext.create('Ext.Viewport', {
            layout: 'border',
            items: [
                mapPanel 
            ]
        });

@chrismayer
Copy link
Contributor

Any news on this?

@marcjansen
Copy link
Member

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants