diff --git a/src/mapml/features/feature.js b/src/mapml/features/feature.js
index aaa657b44..4085c9ff5 100644
--- a/src/mapml/features/feature.js
+++ b/src/mapml/features/feature.js
@@ -240,6 +240,11 @@ export var Feature = L.Path.extend({
     this._outline = [];
     for (let coords of this._markup.querySelectorAll('map-coordinates')) {
       let nodes = coords.childNodes, cur = 0, tempDiv = document.createElement('div'), nodeLength = nodes.length;
+      for(let i = 0; i < nodes.length; i++){
+        if(nodes[i].textContent.trim().length === 0){
+          nodes[i].remove();
+        }
+      }
       for (let n of nodes) {
         let line = [];
         if (!n.tagName) {  //no tagName means it's text content
diff --git a/test/e2e/core/mapSpan.css b/test/e2e/core/mapSpan.css
new file mode 100644
index 000000000..e4ac03688
--- /dev/null
+++ b/test/e2e/core/mapSpan.css
@@ -0,0 +1,53 @@
+
+path.fclass { stroke: blue; }
+
+g[data-fid="fclass.73"] > path { stroke: blue; fill: #DDA0DD;}
+
+
+/* Those parts which are wrapped in a span also inherit the class
+values of the span element, which in this case are taken to be noline and
+aren"t therefore drawn at all (they are there only to represent tile boundaries)*/
+path.noline { display: none}
+
+*, ::before, ::after {
+    box-sizing: border-box;
+}
+
+html,
+body {
+    height: 100%;
+}
+
+body {
+    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
+    margin: 0;
+    line-height: 1.5;
+}
+
+
+/*
+ * map viewers
+ */
+mapml-viewer:defined,
+[is="web-map"]:defined {
+    height: 100%;
+    max-width: 100%;
+    width: 100%;
+    vertical-align: middle;
+}
+
+/* Pre-style to avoid FOUC of inline layer- and fallback content. */
+mapml-viewer:not(:defined) > * {
+    display: none;
+}
+[is="web-map"]:not(:defined) + img[usemap],
+[is="web-map"]:not(:defined) > :not(area):not(.mapml-web-map) {
+    display: none;
+}
+/* Ensure inline layer content is hidden if custom/built-in elements isn't
+supported, or if javascript is disabled. This needs to be defined separately
+from the above, because the `:not(:defined)` selector invalidates the entire
+declaration in browsers that do not support it. */
+layer- {
+    display: none;
+}
\ No newline at end of file
diff --git a/test/e2e/core/mapSpan.html b/test/e2e/core/mapSpan.html
new file mode 100644
index 000000000..3ed808e8e
--- /dev/null
+++ b/test/e2e/core/mapSpan.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <meta name="viewport" content="width=device-width,initial-scale=1">
+  <title>MapML Vector Tiles</title>
+  <script type="module" src="mapml-viewer.js"></script>
+  <link rel="stylesheet" href="mapSpan.css">
+  <style>
+    mapml-viewer:defined {
+      height: 50%;
+      border: 0;
+      vertical-align: middle;
+    }
+
+    mapml-viewer:defined ~ mapml-viewer:defined {
+      border-top: 1px inset;
+    }
+  </style>
+</head>
+<body>
+<mapml-viewer projection="WGS84" zoom="0" lat="0" lon="0" controls>
+  <layer- label="Countries - WorldCRS84Quad" checked>
+    <map-link rel="stylesheet" href="mapSpan.css" >
+      <map-extent units="WGS84">
+        <map-input name="zoomLevel" type="zoom" min="0" max="2" value="0"></map-input>
+
+        <map-input name="row" type="location" axis="row" units="tilematrix" min="0" max="5"></map-input>
+        <map-input name="col" type="location" axis="column" units="tilematrix" min="0" max="5"></map-input>
+
+        <map-link rel='tile' type='text/mapml' title='Tiles for ne_10m_admin_0_countries (as MapML)' tref='data/wgs84/{zoomLevel}/r{row}_c{col}.mapml'/>
+      </map-extent>
+  </layer->
+</mapml-viewer>
+
+<mapml-viewer projection="OSMTILE" zoom="2" lat="0" lon="0" controls>
+  <layer- label="Countries - WebMercatorQuad" checked>
+    <map-link rel="stylesheet" href="mapSpan.css" >
+      <map-extent units="OSMTILE">
+        <map-input  name="zoomLevel" type="zoom" min="0" max="2" value="0"></map-input>
+        <map-input  name="row" type="location" axis="row" units="tilematrix" min="0" max="1"></map-input>
+        <map-input  name="col" type="location" axis="column" units="tilematrix" min="0" max="1"></map-input>
+        <map-link rel='tile' type='text/mapml' tref='data/osmtile/{zoomLevel}/{row}_{col}.mapml' ></map-link>
+      </map-extent>
+  </layer->
+</mapml-viewer>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test/e2e/core/mapSpan.test.js b/test/e2e/core/mapSpan.test.js
new file mode 100644
index 000000000..f8151cd4d
--- /dev/null
+++ b/test/e2e/core/mapSpan.test.js
@@ -0,0 +1,62 @@
+const playwright = require("playwright");
+jest.setTimeout(50000);
+(async () => {
+    for (const browserType of BROWSER) {
+        describe(
+            "<map-span> test " + browserType,
+            ()=> {
+                beforeAll(async () => {
+                    browser = await playwright[browserType].launch({
+                        headless: ISHEADLESS,
+                        slowMo: 100,
+                    });
+                    context = await browser.newContext();
+                    page = await context.newPage();
+                    if (browserType === "firefox") {
+                        await page.waitForNavigation();
+                    }
+                    await page.goto(PATH + "mapSpan.html");
+                });
+                afterAll(async function () {
+                    await browser.close();
+                });
+
+                test("[" + browserType + "]" + " <map-span> hides tile boundaries", async ()=>{
+                    const total = await page.$eval(
+                        'body > mapml-viewer:nth-child(1) div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-overlay-pane > div > div.leaflet-layer.mapml-templatedlayer-container > div > div > div:nth-child(1) > svg > g > g:nth-child(1) > path:nth-child(2)',
+                        (path) => path.getAttribute("style")
+                    );
+
+                    const featureOutline = await page.$(
+                        'body > mapml-viewer:nth-child(1) div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-overlay-pane > div > div.leaflet-layer.mapml-templatedlayer-container > div > div > div:nth-child(1) > svg > g > g:nth-child(1) > path.fclass._2.mapml-feature-outline'
+                    );
+
+                    const hidden = await page.$eval(
+                        'body > mapml-viewer:nth-child(1) div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-overlay-pane > div > div.leaflet-layer.mapml-templatedlayer-container > div > div > div:nth-child(1) > svg > g > g:nth-child(1) > path.noline.fclass._2',
+                        (path) => path.getAttribute("d")
+                    );
+                    expect(featureOutline).not.toBe(null);
+
+                    const d = await featureOutline.getAttribute("d");
+                    const spliced = await hidden.slice(3, hidden.length);
+                    //Makes sure that the part that should be hidden is not part of the feature outline
+                    let index = d.indexOf(spliced);
+
+                    expect(total).toEqual("stroke: none;");
+                    expect(index).toEqual(-1);
+                });
+
+                //https://github.com/Maps4HTML/Web-Map-Custom-Element/issues/559#issuecomment-959805896
+                test("[" + browserType + "]" + " White space parsing for map-coordinates", async ()=>{
+                    await page.waitForTimeout(1000);
+                    const feature = await page.$eval(
+                        'body > mapml-viewer:nth-child(2) div > div.leaflet-pane.leaflet-map-pane > div.leaflet-pane.leaflet-overlay-pane > div > div.leaflet-layer.mapml-templatedlayer-container > div > div > div:nth-child(1) > svg > g > g > path.fclass.mapml-feature-outline',
+                        (path) => path.getAttribute("d")
+                    );
+
+                    expect(feature).toEqual("M0 217L0 217L0 217L2 217L4 218L6 218L6 218L6 216L2 214L0 216L0 216");
+                });
+            }
+        );
+    }
+})();
\ No newline at end of file
diff --git a/test/e2e/data/tiles/osmtile/2/1_1.mapml b/test/e2e/data/tiles/osmtile/2/1_1.mapml
new file mode 100644
index 000000000..35b457027
--- /dev/null
+++ b/test/e2e/data/tiles/osmtile/2/1_1.mapml
@@ -0,0 +1,21 @@
+<mapml- xmlns="http://www.w3.org/1999/xhtml">
+    <map-head>
+        <map-title>ne_10m_admin_0_countries</map-title>
+        <map-meta charset="utf-8"/>
+        <map-meta content="text/mapml" http-equiv="Content-Type"/>
+      <map-meta name="projection" content="OSMTILE"></map-meta>
+      <map-meta name="cs" content="pcrs"></map-meta>
+    </map-head>
+    <map-body>
+        <map-feature id="fclass.73" class="fclass">
+            <map-geometry>
+                <map-polygon>
+                    <map-coordinates>
+                        -10019154.93269 1538354.08306 -10018754.17139 1538179.92761 -9953778.73157 1518203.74208 -9871068.81875 1482220.46653 -9790805.04014 1478766.01397 -9768484.06551 1498870.65375 -9796003.07532 1547622.63538 -9951944.13091 1647924.2825 -10018754.17139 1569038.46245 
+                        <map-span class="noline">-10019154.93269 1569012.97177 -10019154.93269 1538354.08306</map-span>
+                    </map-coordinates>
+                </map-polygon>
+            </map-geometry>
+        </map-feature>
+    </map-body>
+</mapml->
diff --git a/test/server.js b/test/server.js
index 70a998479..580f8ed45 100644
--- a/test/server.js
+++ b/test/server.js
@@ -20,6 +20,7 @@ app.get('/data/query/us_map_query', (req, res, next) => {
 
 app.use("/data", express.static(path.join(__dirname, "e2e/data/tiles/cbmt")));
 app.use("/data", express.static(path.join(__dirname, "e2e/data/tiles/wgs84")));
+app.use("/data", express.static(path.join(__dirname, "e2e/data/tiles/osmtile")));
 app.use(
   "/data/cbmt/0",
   express.static(path.join(__dirname, "e2e/data/tiles/cbmt/0"))
@@ -40,6 +41,10 @@ app.use(
   "/data/wgs84/1",
   express.static(path.join(__dirname, "e2e/data/tiles/wgs84/1"))
 );
+app.use(
+    "/data/osmtile/2",
+    express.static(path.join(__dirname, "e2e/data/tiles/osmtile/2"))
+);
 
 console.log("Running on localhost:" + port);
 
