MCPcopy Create free account
hub / github.com/Maps4HTML/MapML.js / getCenter

Function getCenter

src/mapml/handlers/ContextMenu.js:880–884  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

878 // while gecko returns an object (for e.originalEvent).
879 if (Browser.gecko) {
880 const getCenter = function (el) {
881 let w = el.getBoundingClientRect().width;
882 let h = el.getBoundingClientRect().height;
883 return { x: Number.parseInt(w / 2), y: Number.parseInt(h / 2) };
884 };
885 pt = getCenter(this._map.getContainer());
886 }
887 this._container.removeAttribute('hidden');

Callers 1

ContextMenu.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected