eblondel / OpenFairViewer

OpenFairViewer - a FAIR, ISO and OGC (meta)data compliant GIS data viewer
https://github.com/eblondel/OpenFairViewer
MIT License
6 stars 3 forks source link

Installation init #173

Open kikislater opened 3 months ago

kikislater commented 3 months ago

Hi,

Following readme.md, I have successfully deployed in VM and btw with Docker but app requests a kind of error (output in browser) :

import $ from 'jquery'; window.$ = $; import OpenFairViewer from 'openfairviewer/src/OpenFairViewer.js'; window.OFV = null; $(document).ready(function(){ new OpenFairViewer({ id: 'OFV', profile : '

Welcome to my data portal! powered by OpenFairViewer
', OGC_CSW_BASEURL: "https://xxxxxxxx.fr/geonetwork/srv/eng/csw" }).init(true); //init is required to initialize the instance console.log(OFV); });

Any recommendation ?

eblondel commented 3 months ago

Append ´.init();´ once you created the ofv instance

kikislater commented 3 months ago

init was already there but mistake in my side.

Btw it was not working due to ol/Control reference :

server-1  | Server running at http://localhost:1234 
server-1  | ⚠  Could not load existing sourcemap of "node_modules/bootstrap-slider/dist/css/bootstrap-slider.css".
server-1  | ⚠  Could not load existing sourcemap of "node_modules/bootstrap-slider/dist/css/bootstrap-slider.css".
server-1  | 🚨  /usr/src/app/node_modules/openfairviewer/src/OpenFairViewer.js:82:74: Cannot resolve dependency 'ol/Control'
server-1  |   80 | import Map from 'ol/Map';
server-1  |   81 | import {unByKey} from 'ol/Observable';
server-1  | > 82 | import {MousePosition, OverviewMap, Zoom, ZoomToExtent, Attribution} from 'ol/Control';
server-1  |      |                                                                          ^
server-1  |   83 | import {OSM, WMTS, TileArcGISRest, XYZ, TileWMS, ImageWMS, Vector, Cluster} from 'ol/source';
server-1  |   84 | import WMTSTileGrid from 'ol/tilegrid/WMTS';
server-1  |   85 | import {Group as LayerGroup, Tile as TileLayer, Image as ImageLayer, Vector as VectorLayer} from 'ol/layer';
server-1 exited with code 1

I got it working with the following commit : https://github.com/kikislater/OpenFairViewer/commit/185c5f97b2744a6976e63482e52831f3343529a4