Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ Usage
var map = L.map('map').fitWorld();
...
L.Control.fileLayerLoad({
// Allows you to use a customized version of L.geoJson.
// Allows you to use a customized version of L.GeoJSON.
// For example if you are using the Proj4Leaflet leaflet plugin,
// you can pass L.Proj.geoJson and load the files into the
// L.Proj.GeoJson instead of the L.geoJson.
layer: L.geoJson,
// See http://leafletjs.com/reference.html#geojson-options
// you can pass L.Proj.GeoJSON and load the files into the
// L.Proj.GeoJSON instead of the L.geoJSON.
layer: L.geoJSON,
// See https://leafletjs.com/reference.html#geojson
layerOptions: {style: {color:'red'}},
// Add to map after loading (default: true) ?
addToMap: true,
Expand Down
4 changes: 2 additions & 2 deletions src/leaflet.filelayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}(function fileLoaderFactory(L, toGeoJSON) {
var FileLoader = L.Layer.extend({
options: {
layer: L.geoJson,
layer: L.geoJSON,
layerOptions: {},
fileSizeLimit: 1024
},
Expand Down Expand Up @@ -198,7 +198,7 @@
if (typeof content === 'string') {
content = JSON.parse(content);
}
layer = this.options.layer(content, this.options.layerOptions);
layer = this.options.layer.addData(content, this.options.layerOptions);

if (layer.getLayers().length === 0) {
throw new Error('GeoJSON has no valid layers.');
Expand Down