API Docs for: 1.0.2
Show:

GIScene.RasterOverlayMaterial Class

This Material renders a georeferenced texture on a mesh without using textureCoordinates, but realWorldCoordinates of each fragment(pixel).

Constructor

GIScene.RasterOverlayMaterial

(
  • config
)

Parameters:

  • config Object

    an Object with config properties

Example:

    rasterOverlayMaterial = new GIScene.RasterOverlayMaterial({
            lowerLeft:  new GIScene.Coordinate2(llX, llY), //the lower left coordinate of the image boundingBox
            upperRight: new GIScene.Coordinate2(urX, urY), //the upper right coordinate of the image boundingBox
            offset2:    new GIScene.Coordinate2(offsetX,offsetY), //optional
            url:"http://www.example.com/rasterimage.jpg",
            crossOrigin:"anonymous" 
            // texture: texture //instead of url you can also pass an existing texture  
    });

Methods

clone

() GIScene.RasterOverlayMaterial

Clones the material. BUT reuses the texture without cloning it.

Returns:

setLowerLeft

(
  • coord2
)

Sets the lower left corner coordinate of the bounding box which georeferences the texture

Parameters:

  • coord2 GIScene.Coordinate2

    Coordinate in CRS units

setOffset2

(
  • coord2
)

Sets an offset which will be subtracted from real world coordinates in case the geometry uses also an offset (scene.offset)

Parameters:

  • coord2 GIScene.Coordinate2

setTexture

(
  • texture
)

Sets a raster image as overlay texture

Parameters:

  • texture THREE.Texture

setTextureFromUrl

(
  • url
  • crossOrigin
  • callback
)

asyncronously loads and attaches a texture by specifiing a url to an image and optionally updates the material uniforms (lowerLeft and upperRight)

Parameters:

  • url String
  • crossOrigin String

    either "anonymous" or "use-credentials"

  • callback Function

    function after texture has been loaded and attached to material

setUpperRight

(
  • coord2
)

Sets the upper right corner coordinate of the bounding box which georeferences the texture

Parameters:

  • coord2 GIScene.Coordinate2

    Coordinate in CRS units

Properties

config

Object

The config which is used to initialize the RasterOverlayMaterial. Merged from defaults and passed config Object.

Events

settexture fires after a new texture has been set to the material