Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

122
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!