diff --git a/src/core/operations/ShowOnMap.mjs b/src/core/operations/ShowOnMap.mjs index fe0e2484..4a362fec 100644 --- a/src/core/operations/ShowOnMap.mjs +++ b/src/core/operations/ShowOnMap.mjs @@ -21,7 +21,7 @@ class ShowOnMap extends Operation { this.name = "Show on map"; this.module = "Hashing"; - this.description = "Displays co-ordinates on an OpenStreetMap slippy map.

Co-ordinates will be converted to decimal degrees before being shown on the map.

Supported formats:
This operation will not work offline."; + this.description = "Displays co-ordinates on a slippy map.

Co-ordinates will be converted to decimal degrees before being shown on the map.

Supported formats:
This operation will not work offline."; this.infoURL = ""; this.inputType = "string"; this.outputType = "string"; @@ -81,34 +81,32 @@ class ShowOnMap extends Operation { * @returns {string} */ async present(data, args) { - if (data.replace(/\s+/g, "") !== "") { - const zoomLevel = args[0]; - const tileUrl = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", - tileAttribution = "© OpenStreetMap contributors", - leafletUrl = "https://unpkg.com/leaflet@1.4.0/dist/leaflet.js", - leafletCssUrl = "https://unpkg.com/leaflet@1.4.0/dist/leaflet.css"; - return ` + if (data.replace(/\s+/g, "") === "") { + data = "0, 0"; + } + const zoomLevel = args[0]; + const tileUrl = "https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png", + tileAttribution = "Wikimedia maps | © OpenStreetMap contributors", + leafletUrl = "https://unpkg.com/leaflet@1.5.0/dist/leaflet.js", + leafletCssUrl = "https://unpkg.com/leaflet@1.5.0/dist/leaflet.css"; + return `
`; - } else { - // Don't do anything if there's no input - return ""; - } } }