I solved the problem:
- re-project the wms layer in ArcMap to WGS_1984_Web_Mercator_Auxiliary_Sphere(epsg3857).
- use this code:
var map = new OpenLayers.Map({
maxScale: 1/5000, minScale: 1/500000, projection: new OpenLayers.Projection("EPSG:3857")First, displayProjection: new OpenLayers.Projection re-project the wms layer in ArcMap to WGS_1984_Web_Mercator_Auxiliary_Sphere("EPSG:4326"), div: "map", allOverlays: true }epsg3857); . . . var proj = new OpenLayers.Projection("EPSG Then use this code:4326"); var lonlat = new OpenLayers.LonLat(1468582.90048, 7501836.76895); lonlat.transform(proj, map.getProjectionObject()); map.setCenter(lonlat, 5);
var map = new OpenLayers.Map({
maxScale: 1/5000,
minScale: 1/500000,
projection: new OpenLayers.Projection("EPSG:3857"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
div: "map",
allOverlays: true
});
var proj = new OpenLayers.Projection("EPSG:4326");
var lonlat = new OpenLayers.LonLat(1468582.90048,7501836.76895);
lonlat.transform(proj, map.getProjectionObject());
map.setCenter(lonlat, 5);