Making it so layers that use the SphericalMercator mixin call getLonLatFromViewPortPx and getViewPortPxFromLonLat on the Layer prototype instead of relying on the underlying map object for pixel to map location translations. This allows the Google (and other SM) layers to be used as a base layer but not be visible (with allOverlays set true on the map). r=ahocevar (closes #2759)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10554 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -50,6 +50,38 @@ OpenLayers.Layer.SphericalMercator = {
|
||||
return extent;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: getLonLatFromViewPortPx
|
||||
* Get a map location from a pixel location
|
||||
*
|
||||
* Parameters:
|
||||
* viewPortPx - {<OpenLayers.Pixel>}
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.LonLat>} An OpenLayers.LonLat which is the passed-in view
|
||||
* port OpenLayers.Pixel, translated into lon/lat by map lib
|
||||
* If the map lib is not loaded or not centered, returns null
|
||||
*/
|
||||
getLonLatFromViewPortPx: function (viewPortPx) {
|
||||
return OpenLayers.Layer.prototype.getLonLatFromViewPortPx.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: getViewPortPxFromLonLat
|
||||
* Get a pixel location from a map location
|
||||
*
|
||||
* Parameters:
|
||||
* lonlat - {<OpenLayers.LonLat>}
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Pixel>} An OpenLayers.Pixel which is the passed-in
|
||||
* OpenLayers.LonLat, translated into view port pixels by map lib
|
||||
* If map lib is not loaded or not centered, returns null
|
||||
*/
|
||||
getViewPortPxFromLonLat: function (lonlat) {
|
||||
return OpenLayers.Layer.prototype.getViewPortPxFromLonLat.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: initMercatorParameters
|
||||
* Set up the mercator parameters on the layer: resolutions,
|
||||
|
||||
Reference in New Issue
Block a user