使用传单和D3在地图(json)上添加标记

时间:2014-09-17 05:41:39

标签: javascript json d3.js leaflet

我已经改编了Mike Bostock的原始D3 + Leaflet示例:http://bost.ocks.org/mike/leaflet/所以我想使用此代码在地图上添加标记。但不可能,肯定是一个小菜鸟的错误。谢谢

var LeafIcon = L.Icon.extend({
options: {
iconSize:     [38,60],
iconAnchor:   [19,45],
popupAnchor:  [-3, -76]
}
});
var fIcon = new LeafIcon({iconUrl: 'puce_f.png'}),
rIcon = new LeafIcon({iconUrl: 'puce_r.png'}),
pIcon = new LeafIcon({iconUrl: 'puce_p.png'}),
vIcon = new LeafIcon({iconUrl: 'puce_v.png'}),
jIcon = new LeafIcon({iconUrl: 'puce_j.png'}),
ggIcon = new LeafIcon({iconUrl: 'puce_gg.png'});
L.marker([48.21,-4.46], {icon: fIcon}).bindPopup("<h2>Crozon</h2><br>").addTo(map);
L.marker([48.37,-4.49], {icon: cIcon}).bindPopup("Jetee").addTo(map);

0 个答案:

没有答案