labeling by arcade ||| etiquetar con arcade

1464
10
Jump to solution
06-07-2022 07:54 AM
Labels (1)
JavierCMartínezPrieto
Occasional Contributor

good afternoon, everyone,
I have a webmap where I represent kilometer points every meter, I would like to be able to label those P.K every 5 meters and for that I need to use an expression in arcade, but I can't find the solution.
I am currently trying a conditional with the expression equal or default but I don't get what I am looking for.
Does anyone know what would be the expression to label those P.K every 5 meters?

Thanks to all of you who participate.

example code:


if (DefaultValue($feature.cngmetros, 0))
return Pkinicial
else (DefaultValue($feature.cngmetros, 5))
return PK5metros
else (DefaultValue($feature.cngmetros, ','))
return Pk5metros
else (DefaultValue($feature.cngmetros, '.'))
return Pk5metros

Greetings Javier

#############################ESPAÑOL##########################################

 

buenas tardes a todos ,
tengo un webmap donde represento puntos kilométricos cada metro, me gustaría poder etiquetar esos P.K cada 5 metros y para ello necesito utilizar un expresión en arcade, pero no encuentro la solución.
actualmente estoy intentando un condicional con la expresion equal o default pero no consigo lo que busco.
¿alguien sabe cual seria la expresion para etiquetar esos P.K cada 5 metros?

Gracias a todos lo que participeis.

ejemplo de codigo:


if (DefaultValue($feature.cngmetros, 0))
return Pkinicial
else (DefaultValue($feature.cngmetros, 5))
return PK5metros
else (DefaultValue($feature.cngmetros, ','))
return Pk5metros
else (DefaultValue($feature.cngmetros, '.'))
return Pk5metros

Saludos Javier

Javier C. Martinez Prieto
Tags (3)
0 Kudos
10 Replies
e_mcc
by
New Contributor II

Hi,

 

Actually, the round function does round and works fine. The label is not shown because you are returning the original value (see "return inpval") . You do the rounding in the condition statement and it dose pass the condition but it returns the original value. so, you need to modify ur code and return the rounded value

 

Cheers,

E.