vendredi 23 août 2019

I have a tile layer in a webmap, I want to create a function that calls the tile layer and returns a value at when the tile layers scale changes

So I have a function for inserting a tile layer

var layer = new TileLayer({
  //  url: "https://servicesbeta.arcgisonline.com/arcgis/rest/services/Firefly_World_Imagery/MapServer"

  });
  map.add(layer);

As you zoom in and out, the scale changes.

I wrote a function that says if the minscale is 500,000 then please return a value of 32 and else return a value of 7.

var scale_condition= {
  if (layer.minScale<=500000){
    return 32;
  },
  else{
    return 7;
  },

  };

Instead I get nothing. This does not seem to difficult, so I' am wondering what am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire