Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Added possibility to set property fractionalZoom to true in configuration in order to allow zooming to an arbitrary level (between the min and max resolutions) #597

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mricca
Copy link
Contributor

@mricca mricca commented Mar 6, 2015

This is a small improvement about Scale Overlay and Advanced Scale Overlay plugin.
What I did is make configurable map.fractionalZoom property and make editable the scale selector in order to allow the user to enter the value of scale of interest.

This is openlayers's example: http://dev.openlayers.org/examples/fractional-zoom.html

In the commit is also present:
mapStoreConfigGeoScopio.js - the configuration file where you set the fractionalZoom and that you can use to test the new functionality

If fractionalZoom is not set or if it is set to false, the plugins work as always

Description of map.fractionalZoom property:

/**

  • Property: fractionalZoom
  • {Boolean} For a base layer that supports it, allow the map resolution
  • to be set to a value between one of the values in the resolutions
    
  • array.  Default is false.
    
  • When fractionalZoom is set to true, it is possible to zoom to
  • an arbitrary extent.  This requires a base layer from a source
    
  • that supports requests for arbitrary extents (i.e. not cached
    
  • tiles on a regular lattice).  This means that fractionalZoom
    
  • will not work with commercial layers (Google, Yahoo, VE), layers
    
  • using TileCache, or any other pre-cached data sources.
    
  • If you are using fractionalZoom, then you should also use
  • <getResolutionForZoom> instead of layer.resolutions[zoom] as the
    
  • former works for non-integer zoom levels.
    
    */

@@ -176,8 +176,10 @@ gxp.AdvancedScaleOverlay = Ext.extend(Ext.Panel, {
}else{
Ext.get("id_box").insertBefore(Ext.get("zoom_selector"));
}
this.getEl().on("click", this.stopMouseEvents, this);
this.getEl().on("mousedown", this.stopMouseEvents, this);
if(!this._fractionalZoom){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why you don't stop events if you have fractionalZoom, can you explain me?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't stop the events because, in this case, I can not edit the scale selector.
Do you know another solution?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it's correct, I didn't understand the purpose, now it's clear.

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

Successfully merging this pull request may close these issues.

2 participants