Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

127
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda