updated; code samples

This commit is contained in:
Marc Harter 2013-08-26 16:58:35 -05:00
parent 907d16da83
commit db9bfd55d8
1 changed files with 16 additions and 16 deletions

View File

@ -23,36 +23,36 @@ You can use it to parse shapefiles (.shp) or dBase files (.dbf) or both. Here a
Load Shapefile Only
var shapefile = new Shapefile("myshapefile.shp",function(data){
new Shapefile("myshapefile.shp", function (data) {
// data returned
};
});
Load DBF Only
var dbf = new DBF("mydbf.dbf",function(data){
new DBF("mydbf.dbf", function (data) {
// data returned
};
});
Load Shapefile w/ DBF Attributes
var shapefile = new Shapefile({
new Shapefile({
shp: "myshape.shp",
dbf: "myshape.dbf"
}, function(data){
}, function (data) {
// data returned
};
});
Use with OpenLayers
var
parser = new OpenLayer.Format.GeoJSON(),
features,
shapefile = new Shapefile({
shp: "myshape.shp",
dbf: "myshape.dbf"
}, function(data){
features = parser.read(data.geojson);
};
var parser = new OpenLayer.Format.GeoJSON(),
features;
new Shapefile({
shp: "myshape.shp",
dbf: "myshape.dbf"
}, function (data) {
features = parser.read(data.geojson);
});
### Resources