js-shapefile-to-geojson
js-shapefile-to-geojson copied to clipboard
Subsequent request fails
var pnt = {
radius: 3,
fillColor: "#009688",
color: "#000",
weight: 1,
opacity: 1,
fillOpacity: 0.8
};
var area = {
weight: 2,
color: "#999",
opacity: 1,
fillColor: "#B0DE5C",
fillOpacity: 0.5
};
parser = L.geoJson([], {
style: function (feature) {
return feature.properties && area;
}
}).addTo(map);
var starttime = +new Date;
shapefile = new Shapefile({
shp: "/data/1.shp",
dbf: "/data/1.dbf"
}, function(data){
features = parser.addData(data.geojson);
console.log("took",new Date - starttime,"milliseconds")
})
parser1 = L.geoJson([], {
pointToLayer: function (feature, latlng) {
return L.circleMarker(latlng, pnt);
}
}).addTo(map);
var starttime1 = +new Date;
shapefile1 = new Shapefile({
shp: "/data/2.shp",
dbf: "/data/2.dbf"
}, function(data){
features1 = parser1.addData(data.geojson);
console.log("took",new Date - starttime1,"milliseconds")
})
when using the above code, only shapefile1 is visible and there is no error.