Fix order of coordinates in BBOX
[gpl/argeo-suite.git] / js / src / geo / OpenLayersMapPart.js
index a75956680ee1e165ebf0151015d973725df8ef62..293b6995c8f086b278bc0f8846da4c8c047ba5e2 100644 (file)
@@ -4,8 +4,6 @@
 
 import Map from 'ol/Map.js';
 import View from 'ol/View.js';
-import OSM from 'ol/source/OSM.js';
-import TileLayer from 'ol/layer/Tile.js';
 import { fromLonLat, getPointResolution } from 'ol/proj.js';
 import VectorSource from 'ol/source/Vector.js';
 import Feature from 'ol/Feature.js';
@@ -37,21 +35,15 @@ export default class OpenLayersMapPart extends MapPart {
                super(mapName);
                this.#map = new Map({
                        layers: [
-                               //                              new TileLayer({
-                               //                                      source: new SentinelCloudless(),
-                               //                              }),
-                               //                                                              new TileLayer({
-                               //                                                                      source: new OSM(),
-                               //                                                                      opacity: 0.4,
-                               //                                                                      transition: 0,
-                               //                                                              }),
                        ],
-                       //                      view: new View({
-                       //                              center: [0, 0],
-                       //                              zoom: 2,
-                       //                      }),
+                       //                                              view: new View({
+                       //                                                      projection: 'EPSG:4326',
+                       //                                                      center: [0, 0],
+                       //                                                      zoom: 2,
+                       //                                              }),
                        target: this.getMapName(),
                });
+               //this.#map.getView().set('projection', 'EPSG:4326', true);
        }
 
        /* GEOGRAPHICAL METHODS */
@@ -60,8 +52,8 @@ export default class OpenLayersMapPart extends MapPart {
                this.#map.getView().setZoom(zoom);
        }
 
-       setCenter(lng, lat) {
-               this.#map.getView().setCenter(fromLonLat([lng, lat]));
+       setCenter(lat, lon) {
+               this.#map.getView().setCenter(fromLonLat([lon, lat]));
        }
 
        addPoint(lng, lat, style) {
@@ -282,4 +274,4 @@ export default class OpenLayersMapPart extends MapPart {
                });
                vectorLayer.setStyle(olStyleFunction);
        }
-}
\ No newline at end of file
+}