1
我正在寻找使用Polymaps仅显示某些状态。我使用的是失业图为例:限制polymaps只显示某些状态?
http://polymaps.org/ex/unemployment.html
我意识到返回的瓦片从polymaps.appspot.com,我已经尝试创建一个回调函数这样:
map.add(po.geoJson().url("http://polymaps.appspot.com/state/{Z}/{X}/{Y}.json").on("load", load2).id("state"));
function load2(c) {
for (var b = 0; b < c.features.length; b++) {
if (c.features.length > 1) {
if (c.features[b].data.properties.name == "California") {
var a = c.features[b];
a.element.setAttribute("class", "hidden");
}
}
}
}
但这里的问题是)它不工作(即使有正确的CSS),如果它没有,它只是隐藏状态,而不是覆盖全县的轮廓。我仍然想保持县重叠的细节水平,而不是所有的州。
我该如何去做这件事?
谢谢!
谢谢@Rio ...需要这个 – Fergus 2012-05-28 17:18:32