diff --git a/main.js b/main.js index e1ce3a6..c535e2a 100644 --- a/main.js +++ b/main.js @@ -164,6 +164,11 @@ const sourceInput = customLayerDiv.querySelector('input[name=source]'); const colorInput = customLayerDiv.querySelector('input[name=color]'); customLayerDiv.querySelector("button").addEventListener("click", function(){ + if (!sourceInput.value.toLowerCase().endsWith(".geojson")) { + if (!confirm("Input URL doesn't end in .geojson, so is probably not a valid GeoJSON file. Do you want to continue anyway?")) { + return; + } + } newCustomLayer(labelInput.value, sourceInput.value, colorInput.value); }); document.querySelector("aside").appendChild(customLayerDiv);