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

PrintMapPanel is broken #139

Open
elemoine opened this issue May 11, 2012 · 4 comments
Open

PrintMapPanel is broken #139

elemoine opened this issue May 11, 2012 · 4 comments

Comments

@elemoine
Copy link
Contributor

The PrintMapPanel tests fail, and the PrintMapPanel code is a bit of a mess.

@elemoine
Copy link
Contributor Author

The following patch improves things but the tests still don't pass:

diff --git a/src/GeoExt/panel/PrintMap.js b/src/GeoExt/panel/PrintMap.js
index 627eff2..cfbca8c 100644
--- a/src/GeoExt/panel/PrintMap.js
+++ b/src/GeoExt/panel/PrintMap.js
@@ -168,7 +168,7 @@ Ext.define('GeoExt.panel.PrintMap', {
      * @private
      */
     initComponent: function() {
-        if(this.sourceMap instanceof GeoExt.MapPanel) {
+        if(this.sourceMap instanceof GeoExt.panel.Map) {
             this.sourceMap = this.sourceMap.map;
         }

@@ -194,7 +194,7 @@ Ext.define('GeoExt.panel.PrintMap', {
         this.previewScales = Ext.create('Ext.data.Store', {
             fields: [
                  {name: 'name', type: 'string'},
-                 {name: 'value', type: 'int'},
+                 {name: 'value', type: 'int'}
             ],
             data: this.printProvider.scales.getRange()
         });
@@ -251,11 +251,7 @@ Ext.define('GeoExt.panel.PrintMap', {
         this.printPage.on("change", this.fitZoom, this);
         this.printProvider.on("layoutchange", this.syncSize, this);
         this.map.events.register("moveend", this, this.updatePage);
-        this.on("resize", function() {
-            this.doComponentLayout();
-            this.map.updateSize();
-        }, this);
-        
+
         this.printPage.fit(this.sourceMap);

         if (this.initialConfig.limitScales === true) {
@@ -265,25 +261,12 @@ Ext.define('GeoExt.panel.PrintMap', {
     },

     /**
-     * Private method called after the panel has been rendered.
      *
-     * @private
      */
-    afterRender: function() {
-        
-        this.callParent(arguments);
+    onResize: function() {
         this.doComponentLayout();
-        if (!this.ownerCt) {
-            this.bind();
-        } else {
-            this.ownerCt.on({
-                "afterlayout": {
-                    fn: this.bind,
-                    scope: this,
-                    single: true
-                }
-            });
-        }
+        this.callParent([arguments]);
+        this.bind();
     },

     /**

@ahocevar
Copy link
Member

But this does not mean that it is unusable. The one thing that is required though is a newer version of OpenLayers (will be 2.12-rc4), because there is a bug in 2.12-rc3 that causes an incorrect extent of the print preview.

@elemoine
Copy link
Contributor Author

I think there are real issues, unrelated to openlayers/openlayers#460.

@chrismayer
Copy link
Contributor

What is the current state of this issue?
Can this be closed or are there real issues after upgrading to OL 2.13.1?
TIA for any statement.

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