Module: webgis4u/ol/util/createImageFromMap

Methods

(static) createImageFromMap(map2export, callback)

Exports asynchron map as base 64 encoded string. The result can be processed further either on the client or the server side.
Parameters:
Name Type Description
map2export ol.Map The map to be exported.
callback module:webgis4u/ol/util/createImageFromMap~CreateImageFromMapCallback The callback.
Source:
Throws:
Is thrown in the case the map cannot be exported.
Type
Error
Example
// calls the callback function with the base 64 encoded map image (e.g. "data:image/png;base64, iVBORw0KGgoAAAANSU...").
createImageFromMap(myMap, (base64Image) => {console.log(base64Image);});

Type Definitions

CreateImageFromMapCallback(base64Image)

Callback used by print.
Parameters:
Name Type Description
base64Image string
Source: