Skip to content

fix size initialization and resolution/zoom usage #558

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

Merged
merged 2 commits into from
Jun 29, 2012
Merged

fix size initialization and resolution/zoom usage #558

merged 2 commits into from
Jun 29, 2012

Conversation

dregade
Copy link
Contributor

@dregade dregade commented Jun 28, 2012

clone member function tries to clone a non initialized member variable: size. Add size initialization.

must use serverResolutions if provided instead of zoom/resolution directly provided to functions.

@ahocevar
Copy link
Member

For this to be immediately useful, it would be nice if the serverResolutions could be calculated automatically. I'm envisioning something like this, but I'm not sure if this does the right thing in all cases:

@@ -135,12 +135,17 @@ OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Lay
         this.numberOfTiers = this.tierSizeInTiles.length;

         this.tileCountUpToTier = [0];
+        var resolutions = [1];
         for (var i = 1; i < this.numberOfTiers; i++) {
+            resolutions.unshift(Math.pow(2, i));
             this.tileCountUpToTier.push(
                 this.tierSizeInTiles[i-1].w * this.tierSizeInTiles[i-1].h +
                 this.tileCountUpToTier[i-1]
                 );
         }
+        if (!this.serverResolutions) {
+            this.serverResolutions = resolutions;
+        }
     },

     /**

@dregade
Copy link
Contributor Author

dregade commented Jun 29, 2012

I applied your patch. I looked for cases that may discard this patch but I didn't found any special case.

@ahocevar
Copy link
Member

Thanks @dregade. This looks great now. Have you contributed before? If not, can you please send a CLA? See http://trac.osgeo.org/openlayers/wiki/HowToContribute#ContributorsLicenseAgreements. Please comment here when you have sent the CLA, so we can merge the pull request.

@dregade
Copy link
Contributor Author

dregade commented Jun 29, 2012

I sent the cla to openlayers-cla_at_lists_dot_osgeo_dot_org

ahocevar added a commit that referenced this pull request Jun 29, 2012
fix size initialization and resolution/zoom usage. Thanks @dregade - this change makes fractional zoom work with Layer.Zoomify.
@ahocevar ahocevar merged commit f3b0c2e into openlayers:master Jun 29, 2012
@tschaub
Copy link
Member

tschaub commented Jul 3, 2012

CLA received. Thanks @dregade.

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

Successfully merging this pull request may close these issues.

3 participants