1

I have been trying to make a d3 map by cobbling together code from others. See my attempt here on Github: https://gist.github.com/gailzdesign/018f3eabcabad64f3836727748a9a552

I've read through several entries on Stack Overflow, including this one: Plotting points on a map with D3

And another one that had points plotted in San Fran, California, USA.

But I still can't figure out what I'm doing wrong. I can see the points in the DOM but the scale is way off. The circles are not even a part of the svg.

Any help would be appreciated.

Community
  • 1
  • 1
gailz7152013
  • 67
  • 2
  • 10

1 Answers1

2

The points are where they should be, the eastern edge of your geojson is about 67.59 degrees West, but your points (rocks) are further east at about 67.33 degrees West, so they aren't appended visibly within the SVG - as you note. For example, if you set your projection scale to 50000 rather than your scale variable, you'll see the points and the lake:

enter image description here

The points aren't visible because your auto scaling and bounding function doesn't include the points. But I'm assuming the rocks are supposed to be in the lake, so you'll need to update your locations.

If you are unable to get alignment between the lake and the points, you may have conflicting datums.

If the points are intended to be away from the lake, you might find it easier to set the scale manually, as the autoscaling only takes into account the geojson features. Alternatively you could add the points to the geojson.

Andrew Reid
  • 37,021
  • 7
  • 64
  • 83
  • As it turns out, I had made a mistake in converting lat and long from minutes to fractions of degree. I have updated the example: https://gist.github.com/gailzdesign/018f3eabcabad64f3836727748a9a552 – gailz7152013 Apr 04 '17 at 01:06
  • Ah yeah, been there too. Looked at the updated example, looks good. – Andrew Reid Apr 04 '17 at 01:59