2

Between Here Maps Api for Javascript version 3.1 and Here Maps Api for Javascript version 3 is a big difference. The loading time, zooming, routes displaying is much much slower , up to 3 times.

We are usisng the default settings, but even so, on half of our computers on which we used HERE version 3 we cannot use the new version 3.1. It is not loading (cannot be used).

What can be done? I cannot afford to change all the computer to another computers of last generation. Are there some settings which can be used to reduce the responsive time of the maps?

agdobos
  • 23
  • 3

1 Answers1

2

What you could do is to load legacy packages and use legacy rendering engine (no tilting/rotation, only raster base layer):

load legacy core package:

<!DOCTYPE html>
  <html>
    <head>
    .....
      <script src="https://js.api.here.com/v3/3.1/mapsjs-core-legacy.js" type="text/javascript" charset="utf-8"></script>
    .....

create map with legacy rendering engine:

// assuming platform is instantiated

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

let map = new H.Map(
    document.getElementById('mapContainer'),
    defaultLayers.raster.normal.map,
    {
      zoom: 10,
      center: { lat: 52.5, lng: 13.4 },
      engineType: H.map.render.RenderEngine.EngineType.P2D
    });

by default, fractional zoom levels are enabled in 3.1, therefore to have crisp map it is recommended to disable it:

//assuming that UI and mapevents behavior are instantiated

// disable fractional zooming for Behavior
behavior.disable(H.mapevents.Behavior.Feature.FRACTIONAL_ZOOM);

// add H.ui.ZoomControl with the disabled fractional zooming
var zoomControl = new H.ui.ZoomControl({fractionalZoom: false});
ui.addControl('zoom', zoomControl);

For more information check the Migration guide

Tomas
  • 1,849
  • 1
  • 13
  • 13
  • It works, but in 3.1 there are no traffic tiles for raster maps (normal, satellite, terrain). Do you know how to enable them in legacy/raster mode? Thanks. – marcinn Nov 04 '20 at 05:55
  • Answering myself - there is a same question solved (again) by @tomas: https://stackoverflow.com/questions/61247014/here-maps-for-javascript-api-traffic-flow-without-webgl Also there is possibility to add new layer only with traffic imaginery by using `flowtile` instead of `traffictile`. – marcinn Nov 04 '20 at 09:16
  • 1
    I'm glad my answer helped. – Tomas Nov 05 '20 at 09:38