Skip to main content
deleted 38 characters in body
Source Link
underdark
  • 84.5k
  • 22
  • 233
  • 415

I solved the problem:

  1. re-project the wms layer in ArcMap to WGS_1984_Web_Mercator_Auxiliary_Sphere(epsg3857).
  2. 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);

I solved the problem:

  1. re-project the wms layer in ArcMap to WGS_1984_Web_Mercator_Auxiliary_Sphere(epsg3857).
  2. use this code:

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);

I solved the problem:

First, re-project the wms layer in ArcMap to WGS_1984_Web_Mercator_Auxiliary_Sphere(epsg3857). Then use this code:

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);
Source Link

I solved the problem:

  1. re-project the wms layer in ArcMap to WGS_1984_Web_Mercator_Auxiliary_Sphere(epsg3857).
  2. use this code:

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);