TestTrial

Showing up a service in a map container

Discussion created by TestTrial on May 29, 2012
Latest reply on May 29, 2012 by srikanthgkp463
Hi all,
I am a novice in the field of working with ArcGIS ApI's.,

I just wrote a simple JavaScript code, which fetches a service running on ArcGIS server(10.0)

The code looks something like this..

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>GIS Dashboard</title>
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/" type="text/javascript"></script> 
<link href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.7/js/dojo/dijit/themes/claro/claro.css" rel="stylesheet" type="text/css" >
<script>
dojo.require("esri.map");
  var map; 
  
   function init()
   {   
    map = new esri.Map("mapDiv",{extent: new esri.geometry.Extent({xmin:-20098296,ymin:-2804413,xmax:5920428,ymax:15813776,spatialReference:{wkid:54032}})
  });
 
    var basemapURL= "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" ;
    var basemap = new esri.layers.ArcGISTiledMapServiceLayer(basemapURL); 
    map.addLayer(basemapURL);
    var mymxdURL= "http://MYSHEC258069D:8399/arcgis/services/t234/MapServer"; 
   var mymxd=new esri.layers.ArcGISDynamicMapServiceLayer(mymxdURL);
   map.addLayer(mymxd);
   }
  dojo.addOnLoad(init);
    

</script>
</head>
<body class="claro"> 
  <div id="mapDiv" style="width:900px; height:600px; border:1px solid #000;"></div> 


</body>
</html>


The map from my local server never loads up
What am i missing here ?

Outcomes