matthew.f.tenold

Error: scriptError The resource from this URL is not text: http://js.arcgis.com/3.8.

Discussion created by matthew.f.tenold on Mar 28, 2014
Latest reply on Mar 31, 2014 by jeff.pace
I can't figure out why I am getting this error that the JS 3.8 URL is not text.

[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Cluster Layer</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.8/js/esri/css/esri.css">
    <style>
      html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
    </style>
<script src="http://js.arcgis.com/3.8/"></script>
    <script type="text/javascript">var djConfig = {parseOnLoad: true};</script>
   
<!--script data-dojo-config="async: true" src="//ajax.googleapis.com/ajax/libs/dojo/1.9.3/dojo/dojo.js"></script>
    <!--Include cluster layer -->
    <!--script type="text/javascript" src="http://localhost/lele3p.layers.ClusterLayer_new.js"></script-->

    <script type="text/javascript">
      //dojo.require("dijit.layout.BorderContainer");
      //dojo.require("dijit.layout.ContentPane");
      //dojo.require("esri.map");
      //dojo.require("esri.layers.graphics");
  
   require(["//inetpub/wwwroot/lele3p.layers.ClusterLayer_new"], function(ClusterLayer){
  
      var map;

      function init() {
        basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer");
        map = new esri.Map("map");

        map.addLayer(basemap);

        //resize the map when the browser resizes - view the 'Resizing and repositioning the map' section in
        //the following help topic for more details http://help.esri.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_guidelines.htm
        var resizeTimer;
        dojo.connect(map, 'onLoad', function(theMap) {
          dojo.connect(dijit.byId('map'), 'resize', function() {  //resize the map if the div is resized
            clearTimeout(resizeTimer);
            resizeTimer = setTimeout( function() {
              map.resize();
              map.reposition();
            }, 500);
          });
        });

        runQuery();
      }

  function runQuery() {

   var queryTask = new esri.tasks.QueryTask("http://gis.phila.gov/ArcGIS/rest/services/PhilaGov/Police_Incidents/MapServer/0");

   var query = new esri.tasks.Query();
   query.returnGeometry = true;
   query.where = '1=1';
   query.outFields = ["*"];

   dojo.connect(queryTask, "onComplete", function(featureSet) {

    var cL = new ClusterLayer({
     displayOnPan: false,
     map: map,
     features: featureSet.features,
     infoWindow: {
      template: new esri.InfoTemplate("${Sector}"),
      width: 325,
      height: 85
     },
     flareLimit: 15,
     flareDistanceFromCenter: 20
       });

             map.addLayer(cL);

   });

   dojo.connect(queryTask, "onError", function(err) {
    alert(err.details);
   });

   queryTask.execute(query);
  }

      dojo.addOnLoad(init);
   });
    </script>
  </head>

  <body class="tundra">
    <div dojotype="dijit.layout.BorderContainer" design="headline" gutters="false"
    style="width: 100%; height: 100%; margin: 0;">
      <div id="map" dojotype="dijit.layout.ContentPane" region="center" style="overflow:hidden;">
      </div>
    </div>
  </body>

</html>[/HTML]

Outcomes