Files
openlayers/examples/web-mercator.js
crschmidt efb925d632 Commit fixes for:
* (Closes #2360) make Layer.addOptions call initResolutions if necessary
 * (Closes #2656) no way to pass read options from protocol to format
 * (Closes #2751) Changes in languages: "es" and "ca".
 * (Closes #2814) SLDSelect control tests failing
 * (Closes #2815) Cluster Strategy should not destroy all features

Also:
 * Change examples to use OSGeo, rather than MetaCarta, servers.
 * Change copyright statements to correctly state joint copyright
   in the project, rather than MetaCarta copyright.


git-svn-id: http://svn.openlayers.org/branches/openlayers/2.10@10715 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2010-09-02 21:43:25 +00:00

46 lines
1.5 KiB
JavaScript

// make map available for easy debugging
var map;
// if your application transforms coordinates to and from EPSG:102113 then
// you must uncomment the lines below
// OpenLayers.Projection.addTransform("EPSG:4326", "EPSG:102113",
// OpenLayers.Layer.SphericalMercator.projectForward);
// OpenLayers.Projection.addTransform("EPSG:102113", "EPSG:4326",
// OpenLayers.Layer.SphericalMercator.projectInverse);
function init() {
var options = {
projection: new OpenLayers.Projection("EPSG:102113"),
units: "m",
numZoomLevels: 18,
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
20037508, 20037508.34)
};
map = new OpenLayers.Map('map', options);
// create Google layer with EPSG:102113 code
var gsat = new OpenLayers.Layer.Google("Google Imagery", {
type: G_SATELLITE_MAP,
sphericalMercator: true,
projection: "EPSG:102113"
});
// create WMS layer
var wms = new OpenLayers.Layer.WMS(
"Highways",
"http://sampleserver1.arcgisonline.com/arcgis/services/Specialty/ESRI_StateCityHighway_USA/MapServer/WMSServer",
{layers: "2", format: "image/gif", transparent: "true"},
{
isBaseLayer: false,
wrapDateLine: true
}
);
map.addLayers([gsat, wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(-10723197, 4500612), 3);
}