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

106
Vistas
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 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