1
var non_tfl_lines_JubileetoIlford = L.geoJson(non_tfl_lines_JubileetoIlford, {
pointToLayer: function(feature, latlng) {
switch (feature.geometry.type) {
case 'LineString': return new L.polyline(latlng, {
color: feature.properties.color
});
case 'Point': return new L.Circle(latlng, 400, {
color: getColor(feature.properties.relief_JtI)});
}
onEachFeature: popup
}
}).addTo(map);
出於某種原因,折線的顏色是默認的顏色,而不是指定的顏色。在同一時間,它給了我正確的圓圈顏色。任何想法可能是錯的?無法識別的傳單
仍然有問題。我已經發布了它作爲答案,因爲它需要很長時間才能發表評論。所有圖層(包括點)都會調用 – Bla 2014-08-31 21:22:59
風格。您只能返回LineString的樣式(請參閱更新後的答案)。 – YaFred 2014-08-31 21:50:42
新的貼子怎麼樣? – Bla 2014-08-31 22:16:22