1
votes

I created geojson turkey map on geojson.io. It works on geojson.io with no trouble.But it doesnt work on dc.js choropleth map.

I checked it with us-states.json on my codes it works but my geojson map doesnt work.

Here My created geojson:

mygeojson

1
please show the dc.js code.Union find
From the docs and your file, you need something like: chart.overlayGeoJson(statesJson.features, "state", function(d) { return d.properties.ED; });Union find
It looks like you're asking the same question multiple ways. stackoverflow.com/questions/27669922/… Please edit your existing questions instead of creating more.Gordon

1 Answers

4
votes

Without your code, hard to answer, but the problems I have usually with dc.js choropleth is

1) not using the right selector or key for overlayGeoJson(yourJson.features, "selector", function(d) { return d.name; });

  • yourJson.features: geo json data (not topojson)
  • "selector" - name of the layer which will be used to generate css class
  • 3rd param - (optional) a function used to generate key for geo path, it should match the dimension key (eg. county name, iso of the country...

use jQuery/underscore/d3 to test your selector

2) not defining the projection (eg. mercator)

.projection(d3.geo.mercator())

3) having the wrong scale/transform Here the map is properly drawn, but not in a visible scale

.scale(something)
.translate([x, y]))

But share your code (preferably on jfiddle), so we can have a look at it