Calculating pixel positions from origin and grid index causes alignment
issues in the grid. By going back to incremental positioning, we get a
result without blank spaces between tiles again.
Now we also do not use deltas for shiftRow and shiftColumn. Some
refactoring was done so we do not need different calculateGridLayout
methods for layers with top-left and bottom-left tile origin.
TODO: With this commit, ArcGisCache and KaMap layers are broken.
This is because the threshold used for deciding when a column or row is shifted is too far to the bottom right. A tiny fix, but effective. A new test makes sure that we don't shift columns more than necessary when the layer is dragged.
If a layer is configured with serverResolutions, then getServerZoom should return the zoom level as index of the current resolution in the serverResolutions array.
The tileQueue might have entries again after zooming when the previous zoom level hasn't finished loading yet. Removing the check for the tileQueue's length makes layers report loadend correctly again.
layer.maxExtent is always set as soon as the layer is added to a map. Instead, making behavior consistent with tiled layers: don't display outside maxExtent except when displayOutsideMaxExtent is set to true or the layer's extent equals the world bounds for maps with a baseLayer that has wrapDateLine set to true.
The UTFGrid layer's `getTileInfo` method was not correctly handling dateline wrapping (and was a bit more complicated than it needed to be). Since it would be useful to all grid layers to be able to retrieve a tile and pixel offset for any map location, this functionality deserves to be on the Grid layer.
The WMTS layer currently exposes a `getTileInfo` method that is used within the layer and by the WMTSGetFeatureInfo control. This method could be renamed to `getRemoteTileInfo` or something to differentiate it from a method that gets locally cached tile info. Until that change is made, the method on the Grid layer will be called `getGridData`.
For this to be useful (i.e. so listeners can see/modify the tile url), a change in Tile.Image is required so we do not fire the loadstart event before we have the url to load.