AECgeeks / BIMsurfer2

MIT License
106 stars 25 forks source link

Uncaught ReferenceError: BimServerClient is not defined #1

Closed DaJansenGit closed 4 years ago

DaJansenGit commented 4 years ago

When trying to load data from a bimserver via your index.html example I get the javascript error:

index.html:27 Uncaught ReferenceError: BimServerClient is not defined
    at loadFromBimserver (index.html:27)
    at HTMLButtonElement.loadProjectsBtn.onclick (index.html:140)

Due to line 27 where var client = new BimServerClient(address); is assigned and the BimServerClient is not declared. I tried to find the defintion of the BimServerClient but didn't fiend anything. Could you point me to the right files? Thanks in advance! I'm using your latest commit 4 days ago: 3a0a6c9

DaJansenGit commented 4 years ago

I solved the problem by downloading the bimserverjavascriptapi from github and import it directly with:

<script type="module">
import {BimServerClient} from './bimserverjavascriptapi/bimserverclient.js';
import {BimServerApiPromise} from './bimserverjavascriptapi/bimserverapipromise.js';
window.BimServerClient = BimServerClient;
window.BimServerApiPromise = BimServerApiPromise;

maybe this helps somebody else. I will close this issue.

aothms commented 4 years ago

Good point, thanks. BIMserver and this repository are a bit out of sync, BIMserver migrated to ES6 modules. Depending on the BIMserver version you use, BimServerGeometryLoader.js will probably also need some updates.

You might also like https://github.com/opensourceBIM/BIMsurfer if you're device supports webgl2. It is developed more in sync with the BIMserver.