Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twCounty2010.topo.json使用D3.js v3.2 以上無法正確顯示問題 #34

Open
blueswen opened this issue Jul 10, 2014 · 2 comments
Open

Comments

@blueswen
Copy link

我是參考 http://blog.safaribooksonline.com/2014/02/11/d3-js-maps/ 這篇文章進行地圖的繪製
但是繪製出來的時候會無法正確顯示(http://ghost.cs.nccu.edu.tw/~s10033/newmap/error.html)
搜尋了 D3 的 issue 之後找到了可能的原因
根據 d3/d3#1315 的說法
D3 在跨到新版的時候進行了一些判定的重新設計,可是實在看不太懂是什麼意思
只好做了一些測試,發現如果把台東縣、宜蘭縣、台中市、連江縣、澎湖縣、新北市刪除後就會比較正常(http://ghost.cs.nccu.edu.tw/~s10033/newmap/geojson.html)
所以應該是這些縣市的點有因為 D3 的更新導致無法繪製出來
不知道能有辦法修復這個問題?

@yourskc
Copy link

yourskc commented Sep 8, 2014

所參考範例有點問題 請照以下修改即可
(1)
topo = topojson.feature(data, data.objects["twCounty2010.geo"]);
改為
topo = topojson.feature(data, data.objects.layer1);
(2)
prj = d3.geo.mercator().center([120.979531, 23.978567]).scale(50000);
改為
prj = d3.geo.mercator().center([120.979531, 23.978567]).scale(5000);

@kurorido
Copy link
Contributor

d3.json("twCounty2010.topo.json", function (data) {
改為
d3.json("./json/twCounty2010.topo.json", function(error, data) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants