X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=js%2Fsrc%2Forg.argeo.app.geo.js%2FMapPart.js;fp=js%2Fsrc%2Forg.argeo.app.geo.js%2FMapPart.js;h=0000000000000000000000000000000000000000;hb=7328e106f7523d006b9516651dc9f6dd5475b035;hp=5711233a629767c5647405cbcf40e11b32a2c750;hpb=d20dc77d29ffae31c6c5b0a45b1b26224b80fc31;p=gpl%2Fargeo-suite.git diff --git a/js/src/org.argeo.app.geo.js/MapPart.js b/js/src/org.argeo.app.geo.js/MapPart.js deleted file mode 100644 index 5711233..0000000 --- a/js/src/org.argeo.app.geo.js/MapPart.js +++ /dev/null @@ -1,72 +0,0 @@ -/** API to be used by Java. - * @module MapPart - */ - -/** Abstract base class for displaying a map. */ -export default class MapPart { - - /** The name of the map, will also be the name of the variable */ - #mapName; - - constructor(mapName) { - this.#mapName = mapName; - this.createMapDiv(this.#mapName); - } - - // - // ABSTRACT METHODS - // - - /** Zoom the map to the given value. */ - setZoom(zoom) { - throw new Error("Abstract method"); - } - - /** Set the center of the map to the given coordinates. */ - setCenter(lng, lat) { - throw new Error("Abstract method"); - } - - /** Add a single point. */ - addPoint(lng, lat, style) { - throw new Error("Abstract method"); - } - - addUrlLayer(url, format) { - throw new Error("Abstract method"); - } - - // - // EXTENSIONS - // - loadMapModule(url) { - var script = document.createElement("script"); - script.src = url; - document.head.appendChild(script); - // import(url) - // .then(module => { }) - // .catch((error) => 'An error occurred while loading the component'); - } - - // - // ACCESSORS - // - getMapName() { - return this.#mapName; - } - - // - // HTML - // - createMapDiv(id) { - var mapDiv = document.createElement('div'); - mapDiv.id = id; - mapDiv.className = this.getMapDivCssClass(); - mapDiv.style.cssText = 'width: 100%; height: 100vh;'; - document.body.appendChild(mapDiv); - } - - getMapDivCssClass() { - throw new Error("Abstract method"); - } -}