Questions tagged [harp.gl]

Harp.gl is an open-source map rendering engine allowing 3D views in the browser.

Harp.gl's documentation and examples are located at https://heremaps.github.io/harp.gl/.

Harp.gl supports:

  • tailored map themes
  • style transitions across zoom levels
  • spherical and planar projections
  • terrain
  • addition of custom ThreeJS objects, including animated objects

Harp.gl is developed by Here.com, a company that also aggregates and serves map data, and whose main clients are automakers.

To get started:

  1. Get your example token at developer.here.com
  2. Replace "YOUR-XYZ-TOKEN" in the following code chunk and copy it in an empty index.html file.
  3. Open the file with a browser, it should display a map:
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"/>
<style>
    body { padding: 0; margin: 0; overflow: hidden; }
    #map { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
</style>
<canvas id="map"></canvas>
<script src="https://unpkg.com/three/build/three.min.js"></script>
<script src="https://unpkg.com/@here/harp.gl/dist/harp.js"></script>
<script>
    const map = new harp.MapView({
       canvas: document.getElementById('map'),
       theme: "https://unpkg.com/@here/harp-map-theme@latest/resources/berlin_tilezen_night_reduced.json",
    });

    const omvDataSource = new harp.OmvDataSource({
       baseUrl: "https://xyz.api.here.com/tiles/herebase.02",
       apiFormat: harp.APIFormat.XYZOMV,
       styleSetName: "tilezen",
       authenticationCode: 'YOUR-XYZ-TOKEN',
    });
    map.addDataSource(omvDataSource);

    const controls = new harp.MapControls(map);
    const ui = new harp.MapControlsUI(mapControls);
    canvas.parentElement.appendChild(ui.domElement);

    const newYork = new harp.GeoCoordinates(40.707, -74.01);
    map.lookAt(newYork, 4000, 50);
</script>
7 questions
3
votes
1 answer

How to remove warnings in visualization-app that depends on multiple versions of same dependency?

While creating visualization-app as mentioned in https://developer.here.com/olp/documentation/data-visualization-library/dev_guide/pages/install-generator.html, get a warning that "requires a peer of three@^0.104.0 but none is installed.". However…
2
votes
1 answer

Draw a line from geojson with harp.gl

Can somesone give me an example how can I draw a line from a geojson LineString in harp.gl? The tutorial and the doc missing it. Currently I'm trying with this in index.js: fetch('my_data.geojson') .then(data => data.json()) .then(data => { const…
Petya
  • 41
  • 2
1
vote
2 answers

Placing Markers on Harp-GL globe

I try to build a globe with markers (like the markers on google maps) with HERE and harp.gl. These markers are SVG-Images and need to be loaded from their file. They also need to be clickable with some metadata attached like an ID. So my questions…
pheuberger
  • 11
  • 2
1
vote
2 answers

harp.gl and angular ng

We are using harp.gl in an ng angular application, but are having trouble connecting to data sources in the same way that worked in our yarn demo. We create the datasource as: const dataSource = new OmvDataSource({ baseUrl:…
0
votes
1 answer

Placing a marker on Harp.gl map

Can somebody share an example on how to place a simple marker on the harp-gl generated map? I can't find any information on how to achieve it. Thank you
faremax
  • 11
  • 2
0
votes
1 answer

harp.gl: properly scaling georeferenced 3D geometries (in metres) added through three.js

I have a 3D model in a coordinate system that is defined in metres. The coordinates have been transformed to have the centre of the bounding box of the model as the origin. A vertex with the coordinates (1, 0, 0) would thus lie 1 metre from the…
0
votes
0 answers

how to draw underground layer in harp.gl and set camera to it

How can we draw underground feature like pipeline and subway? I would like to have them appear to be underground and not merely on road level. Can we also set the map view port to underground level? in documentation, camera pitch angle can only be…