error when load map form client

676
0
05-08-2014 08:59 AM
LinhTa
by
New Contributor
I have problem with Web Application. I build a web Asp.net using ArcGIS API for JavaScript for mainpage.
When i build this Web on my Server(WindowServer 2008 with ArcGIS 11.0) then it work well, but when i publish this web using IIS, error when
open this web form Client via : http://203.160.215.85/..... . All Map and Layer is hidden. And page nothing on map.
This my code:

[HTML]
    <script type="text/javascript">
        var map;

        require([
        "esri/config",
        "esri/map",
        "esri/SnappingManager",
        "esri/dijit/editing/Editor",
        "esri/layers/FeatureLayer",
        "esri/tasks/GeometryService",
        "esri/toolbars/draw",
        "dojo/keys",
        "dojo/parser",
        "dojo/_base/array",
        "dojo/i18n!esri/nls/jsapi",
        "dijit/layout/BorderContainer",
        "dijit/layout/ContentPane",
        "dojo/domReady!"
      ], function (
        esriConfig, Map, SnappingManager, Editor, FeatureLayer, GeometryService,
        Draw, keys, parser, arrayUtils, i18n
        ) {

          parser.parse();

          //snapping is enabled for this sample - change the tooltip to reflect this
          i18n.toolbars.draw.start += "<br/>Press <b>CTRL</b> to enable snapping";
          i18n.toolbars.draw.addPoint += "<br/>Press <b>CTRL</b> to enable snapping";

          //This sample requires a proxy page to handle communications with the ArcGIS Server services. You will need to
          //replace the url below with the location of a proxy on your machine. See the 'Using the proxy page' help topic
          //for details on setting up a proxy page.


          //This service is for development and testing purposes only. We recommend that you create your own geometry service for use within your applications
          esriConfig.defaults.geometryService = new GeometryService("http://203.160.215.85:6080/arcgis/rest/services/Utilities/Geometry/GeometryServer");
          //for details on setting up a proxy page.
          esriConfig.defaults.io.proxyUrl = "/proxy";
          map = new Map("map", {
              basemap:"topo",
              center: [106, 21.5],
              zoom: 10
          });

          map.on("layers-add-result", initEditing);
//          var layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://203.160.215.85:6080/arcgis/rest/services/BaseMap/MapServer");
//          map.addLayer(layer);

          var operationPointLayer = new FeatureLayer("http://203.160.215.85:6080/arcgis/rest/services/BaseMap/FeatureServer/9", {
              mode: FeatureLayer.MODE_ONDEMAND,
              outFields: ["*"]
          });


          map.addLayers([
          operationPointLayer, operationPointLayer2, operationPointLayer3, operationPointLayer4, operationPointLayer5, operationsLineLayer, operationsLineLayer2, operationsLineLayer3, operationsLineLayer4, operationsLineLayer5
        ]);
          map.infoWindow.resize(400, 300);

          function initEditing(event) {
              var featureLayerInfos = arrayUtils.map(event.layers, function (layer) {
                  return {
                      "featureLayer": layer.layer
                  };
              });

              var settings = {
                  map: map,
                  layerInfos: featureLayerInfos
              };
              var params = {
                  settings: settings
              };
              var editorWidget = new Editor(params, 'EditPanel');

              var options = { snapKey: keys.copyKey };
              map.enableSnapping(options);
          }
      });
    </script>
[/HTML]
I think my Map some wrong: public local, have yet shared on ArcGIS.com.
Please help me resolve this problem ! Thanks.
0 Kudos
0 Replies