Using the new defaults, we don't need to pass options to the Navigation
control anymore. As a side effect, we get ZoomBox, but need to add css for
it to work properly. For users outside Vienna, an OSM fallback layer was
added which gets activated when the viewport does not intersect Vienna.
Quick explanation:
Let targetCenterPx be described by PX and PY. Let oldRes and newRes be R0 and R1 respectively. Let centerPx (center after zoom) be described by CX and CY. And assume there is some anchored pixel point out there that represents the same map location before and after zoom. Let this be the origin OX and OY.
We want to recenter the map on the provided box. This means the map distance between the origin and box center at R0 is the same as the map distance between the origin and the map center at R1.
That is,
R0 * (OX - PX) = R1 * (OX - CX), and
R1 * (OY - PY) = R1 * (OY - CY)
Or, solving for OX and OY:
OX = (R0 * PX - R1 * CX) / (R0 - R1), and
OY = (R0 * PY - R1 * CY) / (R0 - R1)
There are still tests failing, but this change addresses some of the new failures after 4b163e0482 (which is an awesome improvement despite the test failures :).
When the TileManager adds an image to its cache, it might be a backbuffer
image. Backbuffer images have an id with a '_bb' postfix. Regular images
do not have an id at all. In OpenLayers.Layer.Grid, in
addTileMonitoringHooks, a loadend listener is created for each tile. This
listener checks for tie image id, and will remove it from its parent node.
This will cause images to be removed from the layerDiv if the image comes
from the TileManager's tileCache and was on a backbuffer by the time it was
added to the cache.
Simply removing the image's id before assigning it to a tile resolves the
issue.
The properties
* layers
* queryVisible
* url
* layerUrls
* infoFormat
* vendorParams
* format
* formatOptions
should all be visible in the public API since they are essentially very
convenient to use when customizing the control.
The geodesic-property is used inside of our examples, yet isn't officially
part of the public API.
The displaySystem-property provides a very useful way of configuring the
output of the measurements and should be promoted as well.
IE9 leaks when `navigator.geolocation` is accessed (see #461). The goal of this change is to avoid that leak in builds that include the Geolocate control but do not use it.