Change TextSymbol size with map scale?

220
0
01-29-2019 01:57 AM
omega_cancer
Occasional Contributor II

I want to change TextSymbol size with every change in map scale.

1. I have seen this sample but I was not able make it work with graphicsLayer.

2. Tried following:

simpleRenderer.setVisualVariables(
  {
    "type": "sizeInfo",
    "field": "pop2000",
    "minDataValue": 493782,
    "maxDataValue": 33871648,
    "valueUnit": "unknown",

    "minSize": {
      "type": "sizeInfo",
      "expression": "view.scale",
      "stops": [
        { "value": 1128, "size": 16 },
        { "value": 288895, "size": 16 },
        { "value": 73957191, "size": 9 },
        { "value": 591657528, "size": 2 }
       ]
      },

     "maxSize": {
     "type": "sizeInfo",
     "expression": "view.scale",
     "stops": [
       { "value": 1128, "size": 80 },
       { "value": 288895, "size": 80 },
       { "value": 73957191, "size": 50 },
       { "value": 591657528, "size": 25 }
      ]
  }
  });‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

graphicLayer.renderer = simpleRenderer;

I dont know what to put in expression and field field. This is not working.

All the samples for renderers use featureLayer, I am wondering if they are meant to work  with graphicsLayer or otherwise.

I am using JS API version 3.15.

0 Kudos
0 Replies