]>
git.argeo.org Git - gpl/argeo-suite.git/blob - js/src/geo/MapPart.js
1 /** API to be used by Java.
5 /** Abstract base class for displaying a map. */
6 export default class MapPart
{
8 /** The name of the map, will also be the name of the variable */
11 constructor(mapName
) {
12 this.#mapName
= mapName
;
13 this.createMapDiv(this.#mapName
);
19 /** Set the center of the map to the given coordinates. */
21 throw new Error("Abstract method");
28 var script
= document
.createElement("script");
30 document
.head
.appendChild(script
);
32 // .then(module => { })
33 // .catch((error) => 'An error occurred while loading the component');
47 var mapDiv
= document
.createElement('div');
49 mapDiv
.className
= this.getMapDivCssClass();
50 mapDiv
.style
.cssText
= 'width: 100%; height: 100vh;';
51 document
.body
.appendChild(mapDiv
);
55 throw new Error("Abstract method");
59 const func
= new Function(js
);