diff --git a/src/mapml/GlobalM.js b/src/mapml/GlobalM.js
index 4876b9d7e..2d0cda1f9 100644
--- a/src/mapml/GlobalM.js
+++ b/src/mapml/GlobalM.js
@@ -696,6 +696,9 @@ import './handlers/keyboard';
}
});
+ M.geojson2mapml = Util.geojson2mapml;
+ M.mapml2geojson = Util.mapml2geojson;
+
// see https://leafletjs.com/examples/extending/extending-3-controls.html#handlers
L.Map.addInitHook('addHandler', 'query', QueryHandler);
L.Map.addInitHook('addHandler', 'contextMenu', ContextMenu);
diff --git a/test/e2e/geojson/geojson2mapml.html b/test/e2e/geojson/geojson2mapml.html
index 73319dbda..7cdf28c4c 100644
--- a/test/e2e/geojson/geojson2mapml.html
+++ b/test/e2e/geojson/geojson2mapml.html
@@ -11,7 +11,7 @@
-
+
diff --git a/test/e2e/geojson/geojson2mapml.test.js b/test/e2e/geojson/geojson2mapml.test.js
index 480848fa1..96db82200 100644
--- a/test/e2e/geojson/geojson2mapml.test.js
+++ b/test/e2e/geojson/geojson2mapml.test.js
@@ -158,4 +158,15 @@ test.describe('GeoJSON API - geojson2mapml', () => {
);
expect(out).toEqual(exp);
});
+ test('M.geojson2mapml public API method exists and works', async ()=>{
+ const viewer = page.getByTestId('map');
+ await viewer.evaluate((v)=>{
+ let l = M.geojson2mapml(point, {label: 'M.geojson2mapml public API method works'});
+ v.appendChild(l);
+ l.setAttribute('data-testid','test-layer');
+ });
+ const layer = page.getByTestId('test-layer');
+ await expect(layer).not.toHaveAttribute('disabled');
+ await expect(layer).toHaveAttribute('label','M.geojson2mapml public API method works');
+ });
});
diff --git a/test/e2e/geojson/mapml2geojson.html b/test/e2e/geojson/mapml2geojson.html
index d87541597..e19ff1dc2 100644
--- a/test/e2e/geojson/mapml2geojson.html
+++ b/test/e2e/geojson/mapml2geojson.html
@@ -13,7 +13,7 @@
-
+
Point
diff --git a/test/e2e/geojson/mapml2geojson.test.js b/test/e2e/geojson/mapml2geojson.test.js
index 208be6dc8..74f4c1589 100644
--- a/test/e2e/geojson/mapml2geojson.test.js
+++ b/test/e2e/geojson/mapml2geojson.test.js
@@ -125,4 +125,11 @@ test.describe('GeoJSON API - mapml2geojson', () => {
);
expect(out10).toEqual(exp10);
});
+ test('M.mapml2geojson public API method exists and works', async () => {
+ const geojsonPoint = await page.evaluate(() => {
+ let layer = document.querySelector('[data-testid=point]');
+ return M.mapml2geojson(layer);
+ });
+ expect(geojsonPoint.title).toEqual('Point Geometry');
+ });
});