Skip to content

Terrain.load can't be used from server side nodejs simulation #82

@derickson

Description

@derickson

Describe the bug
Terrain.load is dependent on the DOM
const img = document.createElement("img");
so it won't work when running a server side model without a web browser.

To Reproduce
Steps to reproduce the behavior:

  1. run the model headless in a nodejs app
  2. create a terrain and attempt to load a local image using the path, as described in function comments
  3. get error as document object not found

Expected behavior
need example on how to use this from nodjs rather than browser. I'm using a terrain image to model a complex environment for an ABM

Desktop (please complete the following information):
node v14.15.1
flocc v0.15.19

great project! thanks for all the work on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions