Adding a scaled layer.
This commit is contained in:
@@ -40,7 +40,23 @@ var map = new OpenLayers.Map({
|
|||||||
"Google Satellite",
|
"Google Satellite",
|
||||||
"http://maps.googleapis.com/maps/api/staticmap?sensor=false&maptype=satellite",
|
"http://maps.googleapis.com/maps/api/staticmap?sensor=false&maptype=satellite",
|
||||||
null, options
|
null, options
|
||||||
)
|
),
|
||||||
|
// the same layer again, but scaled to allow map sizes up to 1280x1280 pixels
|
||||||
|
new OpenLayers.Layer.Grid(
|
||||||
|
"Google Satellite (scale=2)",
|
||||||
|
"http://maps.googleapis.com/maps/api/staticmap?sensor=false&maptype=satellite&scale=2",
|
||||||
|
null, OpenLayers.Util.applyDefaults({
|
||||||
|
getURL: function() {
|
||||||
|
var center = this.map.getCenter().transform("EPSG:3857", "EPSG:4326"),
|
||||||
|
size = this.map.getSize();
|
||||||
|
return [
|
||||||
|
this.url, "¢er=", center.lat, ",", center.lon,
|
||||||
|
"&zoom=", (this.map.getZoom() - 1),
|
||||||
|
"&size=", Math.floor(size.w / 2), "x", Math.floor(size.h / 2)
|
||||||
|
].join("");
|
||||||
|
}
|
||||||
|
}, options)
|
||||||
|
),
|
||||||
],
|
],
|
||||||
center: new OpenLayers.LonLat(10.2, 48.9).transform("EPSG:4326", "EPSG:3857"),
|
center: new OpenLayers.LonLat(10.2, 48.9).transform("EPSG:4326", "EPSG:3857"),
|
||||||
zoom: 5
|
zoom: 5
|
||||||
|
|||||||
Reference in New Issue
Block a user