initMap Error: Couldn't create WebGL context

793 Views Asked by At

I'm developing an angular web app and after migrating HERE maps from 3.0 to 3.1 got a problem rendering the new version of the map.

The following error:

initMap Error: Couldn't create WebGL context.

Error message: Couldn't create WebGL context

1

There are 1 best solutions below

0
On

The HERE Maps API for JavaScript version 3.1 contains a new default rendering engine.The engine uses an HTML5 WebGL canvas element and enables rendering of rich and customizable vector maps. In order to make the most of the WebGL engine, use the new vector tiles. The snippet below shows how to switch to the vector tiles:

// Obtain the default map types from the platform object:
var defaultLayers = platform.createDefaultLayers();

// Instantiate (and display) a map object:
var map = new H.Map(
    document.getElementById('mapContainer'),
    defaultLayers.vector.normal.map,
    {
      zoom: 10,
      center: { lat: 52.5, lng: 13.4 }
    });

For more detail please go through this link. https://developer.here.com/documentation/maps/3.1.15.1/dev_guide/topics/migration.html