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

116
Visualizações
D3.JS Multiple Marker or circle on world mao

I am just trying to use D3.js for a map and have a scenario where I want to create multiple marker in different color for same location. For an example location New York has 2 category item listed and I category marker in red and another one is in green. How to achieve that. No matter whatever I do it only rendering one circle.

svg.selectAll(".countries").data(countries).enter().append("path").attr("class", "countries").attr("d", path);
    svg.selectAll(".circles")
        .data(listMapData)
        .enter()
        .append("circle")
        .attr("class", "circles")
        .attr("r", function (d) {
            return 13;
        })
        .attr("cx", function (d) {
            let coords = projection([d.Coordinates.Longitude, d.Coordinates.Latitude]);
            return coords[0];
        })
        .attr("cy", function (d) {
            let coords = projection([d.Coordinates.Longitude, d.Coordinates.Latitude]);
            return coords[1];
        })
        .attr("fill", function (d, i) {
            debugger;
            if (d.Category.indexOf("Market Survey") >= 0) return "yellow";
            else if (d.Category.indexOf("Investigation") >= 0) return "red";
            else if (d.Category.indexOf("Lead") >= 0) return "green";
            else if (d.Category.indexOf("Raid") >= 0) return "#943126";
            else if (d.Category.indexOf("Custom Seizure") >= 0) return "#4633FF";
            else if (d.Category.indexOf("Online Investigation") >= 0) return "green";
            else return "#34495E";
        })
about 4 years ago · Juan Pablo Isaza
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