AnsweredAssumed Answered

overlays two Tiled Map Services with Different Spatial References

Question asked by sinharcgis on Dec 21, 2016
Latest reply on Dec 22, 2016 by rscheitlin

i use Esri basemap World_Topo_Map (MapServer) 

 then overlay my Tiled Map Services;  my Tiled Map Services display incorrect place.

How To overlays two Tiled Map Services with Different Spatial References in ArcGIS API for JavaScript?( two Services cached scale as same; Different Spatial References)??

my code:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://js.arcgis.com/3.18/esri/css/esri.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<link href="css/main.css" rel="stylesheet" />
<script src="https://js.arcgis.com/3.18/"></script>
<script type="text/javascript">
var map;
require([
"esri/map",
"dojo/ready",
"esri/SpatialReference",
"esri/layers/ArcGISTiledMapServiceLayer",
"dojo/dom",
"dojo/on",
"dojo/_base/array",
"dojo/parser",
"dojo/domReady!"
], function (
Map,
ready,
SpatialReference,
ArcGISTiledMapServiceLayer,
dom,
on,
array,
parser
) {
ready(function () {
parser.parse();
});
var spatialReference2 = new SpatialReference({ "wkt": 'PROJCS["VN-2000",GEOGCS["GCS_VN_2000",DATUM["D_VN_2000",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",107.75],PARAMETER["Scale_Factor",0.9999],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]],VERTCS["Hon_Dau_1992",VDATUM["Hon_Dau_1992"],PARAMETER["Vertical_Shift",0.0],PARAMETER["Direction",1.0],UNIT["Meter",1.0]]'
});
map = new Map("mapDiv", {

spatialReference: spatialReference2
});
var pathGooglemap = "http://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer";

var tiled = new ArcGISTiledMapServiceLayer("http://stnmt.dongnai.gov.vn:8080/atlasadaptor/rest/services/Bandochuyende/NEN_CAOSU_vn_g/MapServer");
map.addLayers([tiled]);

map.on("Click", function (evt) {
GooglemapLayer = new ArcGISTiledMapServiceLayer(pathGooglemap,
{
id: "idchuyende"
});
map.addLayer(GooglemapLayer, 0);
});
});
</script>

<title></title>
</head>
<body class="claro">
<div id="conttain">

<div id="divmap_data">
<div id="mapDiv">
</div>
</div>
</div>

</body>
</html>

Outcomes