]>
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
);
20 /** Zoom the map to the given value. */
22 throw new Error("Abstract method");
25 /** Set the center of the map to the given coordinates. */
27 throw new Error("Abstract method");
30 /** Add a single point. */
31 addPoint(lng
, lat
, style
) {
32 throw new Error("Abstract method");
35 addUrlLayer(url
, format
) {
36 throw new Error("Abstract method");
43 var script
= document
.createElement("script");
45 document
.head
.appendChild(script
);
47 // .then(module => { })
48 // .catch((error) => 'An error occurred while loading the component');
62 var mapDiv
= document
.createElement('div');
64 mapDiv
.className
= this.getMapDivCssClass();
65 mapDiv
.style
.cssText
= 'width: 100%; height: 100vh;';
66 document
.body
.appendChild(mapDiv
);
70 throw new Error("Abstract method");
74 const func
= new Function(js
);