Browse Source

Loader: support json files where multiline strings are split as string-arrays

master
parent
commit
d56fb14de0
  1. 1
      package.json
  2. 2
      src/OpenStreetBrowserLoader.js

1
package.json

@ -12,6 +12,7 @@
"font-awesome": "^4.7.0",
"i18next-client": "^1.11.4",
"ip-location": "^1.0.1",
"json-multiline-strings": "^0.1.0",
"leaflet": "^1.0.3",
"leaflet-geosearch": "^2.4.0",
"leaflet.locatecontrol": "^0.61.0",

2
src/OpenStreetBrowserLoader.js

@ -1,4 +1,5 @@
var OverpassLayer = require('overpass-layer')
var jsonMultilineStrings = require('json-multiline-strings')
function OpenStreetBrowserLoader () {
this.types = {}
@ -31,6 +32,7 @@ OpenStreetBrowserLoader.prototype.getCategory = function (id, callback) {
}
var data = JSON.parse(req.responseText)
data = jsonMultilineStrings.join(data, { exclude: [ [ 'const' ] ] })
this.getCategoryFromData(id, data, function (err, category) {
if (category) {

Loading…
Cancel
Save