AnsweredAssumed Answered

CDE - Map Component: How to change marker colors dinamically

Question asked by B523W5TI on Dec 11, 2017
Latest reply on Dec 12, 2017 by B523W5TI

Hello world

 

I would like to change dinamically the color of markers on my Map Component throught the field "value" on my SQL:

 

select

9.1895100 as "Longitude",

45.3819300 as "Latitude",

'Rozzano' as "Description",

300 as "Value"

UNION

select

9.08065 as "Longitude",

45.80079 as "Latitude",

'Como' as "Description",

60 as "Value"

UNION

select

9.3334 as "Longitude",

45.52716 as "Latitude",

'Cernusco sul Navoglio' as "Description",

140 as "Value"

 

I tried with the following code in Pre Execution without success:

 

function()

{

   this.styleMap =

   {

    markers:

    {

        r: 15,

        symbol: 'circle',

        fill: function()

      {

          if(Value <=100)

          {

              return "red";

          }

          else if(Value >100 && Value <=180)

          {

              return "yellow";

          }

          else

          {

              return "green";

          }

      }

    }

   } 

}

 

Please can anyone help me on this?

 

Regards

Outcomes