AnsweredAssumed Answered

dojo-config cacheBust causing 404 on esri/symbols/SimpleFillSymbol

Question asked by mgarrod on Apr 29, 2015
Latest reply on May 6, 2016 by PavelVeselsky

When using cacheBust in dojo and adding a SimpleFillSymbol with a style of SimpleFillSymbol.STYLE_DIAGONAL_CROSS on a graphic, the request adds the cacheBust param in the wrong place of the URL and the image can not be found:

 

http://js.arcgis.com/3.13/esri/images/symbol/sfs/?1430314495556diagonalcross.png

 

new SimpleLineSymbol(SimpleLineSymbol

Sample code:

 

<!DOCTYPE html>
<html>
  <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"/>
    <title>Simple Map</title>
    <link rel="stylesheet" href="http://js.arcgis.com/3.13/esri/css/esri.css">
    <style>
      html, body, #map {
        height: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
      }
      body {
        background-color: #FFF;
        overflow: hidden;
        font-family: "Trebuchet MS";
      }
    </style>
    <script src="http://js.arcgis.com/3.13/" data-dojo-config="cacheBust:true"></script>
    <script>
      var map;


      require(["esri/map", "esri/toolbars/draw", "esri/graphic", "esri/symbols/SimpleLineSymbol",
        "esri/symbols/SimpleFillSymbol", "dojo/_base/Color", "dojo/domReady!"], function(Map, Draw, Graphic, SimpleLineSymbol, SimpleFillSymbol, Color) {
        map = new Map("map", {
          basemap: "topo",  //For full list of pre-defined basemaps, navigate to http://arcg.is/1JVo6Wd
          center: [-122.45, 37.75], // longitude, latitude
          zoom: 13
        });
          
        toolbar = new Draw(map);
        toolbar.on("draw-end", addToMap);
        toolbar.activate(Draw['POLYGON']);
          
        function addToMap(evt) {
          toolbar.deactivate();
          
          var symbol = new SimpleFillSymbol(
                SimpleFillSymbol.STYLE_DIAGONAL_CROSS, //STYLE_NULL, 
                new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASH, new Color([255,0,255]), 3), 
                new Color([255,0,255,1])
            );
          
          var graphic = new Graphic(evt.geometry, symbol);
          map.graphics.add(graphic);
        }
          
      });
    </script>
  </head>


  <body>
    <div id="map"></div>
  </body>
</html>

Outcomes