In case anyone remembers or have seen my earlier post, I was trying to parse a GeoJSON string with limited success. That issue has been resolved, however I have a geojson file with roughly 80k lines. I took out the string in my .js file and trying to point my geojsonObject at the filepath of the geojson file. It seemed simple enough, but now I get "Unsupported GeoJSON type: undefined" in Microsoft Edge's console. The error points to the bundle-url.js
Not sure what's going wrong.
The code from the .js file linked in the console:
var bundleURL = null;
function getBundleURLCached() {
if (!bundleURL) {
bundleURL = getBundleURL();
}
return bundleURL;
}
function getBundleURL() {
// Attempt to find the URL of the current script and use that as the base URL
try {
throw new Error;
} catch (err) {
var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):$
if (matches) {
return getBaseURL(matches[0]);
}
}
return '/';
}
function getBaseURL(url) {
return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)\/$
}
exports.getBundleURL = getBundleURLCached;
exports.getBaseURL = getBaseURL;
The code from my .js file. The url points to the geojson file that is in the same folder of the .js:
var geojsonObject = {
url: './locality.geojson',
format: new GeoJSON()
}
var vectorSource = new VectorSource({
features: new GeoJSON().readFeatures(geojsonObject, {
dataProjection: 'EPSG:4326',
featureProjection: 'EPSG:3857'
})
});
I have put my geojson through two validators, which have come up with no issues. This is all on a localhost (Ubuntu VPS), using npm.
As stated above, the geojson file is 80k lines long so I can't stick it all in here so here is a snippet;
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.65073,54.34794 ]
},
"properties": {
"Site":"ARMAGH"
}
},