Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

130
Visualizações
How to draw circlemarkers for multiple values?

I currently have a circlemarker which create circles of red colour for the unhealthy instances.

Now on this same world map, I wish to have circles of green color as well for the healthy instances.

To give an example, City name "Phoenix" can have 20 unhealthyinstances and 3 healthyinstances. So in this case I would like to have a circle of RED color for unhealthy instances and a circle of green color for healthy instances for Phoenix.

{
    CityMapData.map((city, index) => {
    const {
            unhealthyInstancesCount,
            healthyInstancesCount,
            entityName,
            totalInstancesCount,
            timeZoneData,
          } = city;

    return (
            <CircleMarker
            key={index}
            center={timeZoneData.coordinates}
            radius={10 * Math.log(unhealthyInstancesCount+ 1)}
            fillOpacity={0.5}
            stroke={false}
            color={COLORS.RED}
            >
           );
    })
}
about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Just choose color depending on a condition and pass unhealthyInstancesCount and healthyInstancesCount as instancesCount to this component wherever you need

const {
          instancesCount
          entityName,
          totalInstancesCount,
          timeZoneData,
          isHealthy
    } = city;

return (
    <CircleMarker
    key={index}
    center={timeZoneData.coordinates}
    radius={10 * Math.log(instancesCount+ 1)}
    fillOpacity={0.5}
    stroke={false}
    color={isHealthy ? COLORS.GREEN : COLORS.RED}
>
about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda