0

I am using a .svg file for plotting India map. It is displaying India map as desired. Now I want to display circles on this map using latitude and longitude.

How can I draw circles by using places array? Any source code and web link would be appreciated.

My index.html code is as like below and the svg file I am using is here. The final output of my script is here.

** Please also guide me, is this the correct way of displaying map?

    <!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title></title>
        <script type="text/javascript" src="d3.v3.min.js"></script>
        <style type="text/css">
        </style>
    </head>

    <body>
        <script type="text/javascript">
            var places = [
              {
                name: "GUNA",
                location: {
                  latitude: 24.5429,
                  longitude: 77.1032
                }
              },
              {
                name: "THE DANGS",
                location: {
                  latitude: 20.4633,
                  longitude: 73.4646
                }
              }
            ]

            d3.xml("toilet.svg", function(xml) {
                var x = document.importNode(xml.documentElement, true);
                document.body.appendChild(x)
            });
        </script>
    </body>
</html>
Vivek
  • 663
  • 2
  • 13
  • 40
  • [This question](http://stackoverflow.com/questions/20987535/plotting-points-on-a-map-with-d3) should help. – Lars Kotthoff Jul 02 '14 at 11:10
  • Thanks for replying LarsKotthoff sir. I could not solve this puzzle by following your hint so I did it by using json format. BTW... I am your big fan @LarsKotthoff – Vivek Jul 02 '14 at 12:10
  • 1
    This may also help: http://bost.ocks.org/mike/bubble-map/ – Union find Jul 02 '14 at 14:39

0 Answers0