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:
@@ -69,6 +69,14 @@ OpenLayers.Layer.Google = OpenLayers.Class(
|
||||
*/
|
||||
type: null,
|
||||
|
||||
/**
|
||||
* APIProperty: wrapDateLine
|
||||
* {Boolean} Allow user to pan forever east/west. Default is true.
|
||||
* Setting this to false only restricts panning if
|
||||
* <sphericalMercator> is true.
|
||||
*/
|
||||
wrapDateLine: true,
|
||||
|
||||
/**
|
||||
* APIProperty: sphericalMercator
|
||||
* {Boolean} Should the map act as a mercator-projected map? This will
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -65,6 +65,14 @@ OpenLayers.Layer.VirtualEarth = OpenLayers.Class(
|
||||
*/
|
||||
type: null,
|
||||
|
||||
/**
|
||||
* APIProperty: wrapDateLine
|
||||
* {Boolean} Allow user to pan forever east/west. Default is true.
|
||||
* Setting this to false only restricts panning if
|
||||
* <sphericalMercator> is true.
|
||||
*/
|
||||
wrapDateLine: true,
|
||||
|
||||
/**
|
||||
* APIProperty: sphericalMercator
|
||||
* {Boolean} Should the map act as a mercator-projected map? This will
|
||||
|
||||
@@ -63,6 +63,14 @@ OpenLayers.Layer.Yahoo = OpenLayers.Class(
|
||||
*/
|
||||
type: null,
|
||||
|
||||
/**
|
||||
* APIProperty: wrapDateLine
|
||||
* {Boolean} Allow user to pan forever east/west. Default is true.
|
||||
* Setting this to false only restricts panning if
|
||||
* <sphericalMercator> is true.
|
||||
*/
|
||||
wrapDateLine: true,
|
||||
|
||||
/**
|
||||
* APIProperty: sphericalMercator
|
||||
* {Boolean} Should the map act as a mercator-projected map? This will
|
||||
|
||||
Reference in New Issue
Block a user