SimpleMarkerSymbol no longer formats outline style in 4.10

940
4
02-22-2019 07:09 AM
GlennErion
New Contributor

In 4.9, the following code creates a circle with a green dotted line as the outline when the map is clicked. In 4.10, it ignores:

style: "short-dot"

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
  <title>Intro to ArcGIS API for JavaScript</title>
  <style>
    html,
    body,
    #viewDiv {
      padding: 0;
      margin: 0;
      height: 100%;
      width: 100%;
    }
  </style>
  <link rel="stylesheet" href="https://js.arcgis.com/4.3/esri/css/main.css">
  <script src="https://js.arcgis.com/4.10/"></script>
</head>
<body>
  <div id="viewDiv"></div>
</body>
<script>
  require([
    "esri/Map",
    "esri/views/MapView",
    "esri/symbols/SimpleMarkerSymbol",
    "esri/Graphic"
  ], function (
    Map,
    MapView,
    SimpleMarkerSymbol,
    Graphic
  ) {

    var map = new Map({
      basemap: "topo"
    });

    var view = new MapView({
      container: "viewDiv",
      map: map,
      zoom: 10,
      center: [-118, 34],
      rotation: 30
    });

    const markSymbol = new SimpleMarkerSymbol({
      size: 20,
      color: "white",
      style: "circle",
      outline: {
        color: [56, 158, 0, 1],
        width: 2,
        style: "short-dot"
      }
    });
    view.on("click", function (event) {
      console.log(event)
      var symbolGraphic = new Graphic({geometry: event.mapPoint, symbol: markSymbol});
      view.graphics.add(symbolGraphic);
    });
  });
</script>
</html>
Tags (1)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

Glenn,

   Have you reported this bug to esri tech support so that it can be fixed in the 4.11 release coming next month?

0 Kudos
GlennErion
New Contributor

Not yet. I have to figure out who the contact is for my company.

0 Kudos
GlennErion
New Contributor

From ESRI support:

BUG-000119970:

The indication on the bug is that is actually by design. The JavaScript API at v4.x was never intended to support dashed outlines for marker symbols, so it has been marked as resolved and closed. Unfortunately, you'll not be able to use the short-dot style in your picture marker symbols.

The documentation says that it is supported and it worked up to and including 4.9.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Glenn,

  Then you need to request an enhancement.

0 Kudos