Was this helpful?

HERE Maps API for JavaScript

It is possible to use the HERE Maps API for JavaScript.

GeoJSON Data display

You can refer to the documentation for covering data display using the GeoJSON file format.

1// ... Initialize your map
2
3// Update YOUR_ACCESS_TOKEN and the itinerary/XXX with your details
4const url =
5  "https://mapping.withalpaca.travel/v1/itinerary/XXX.geojson?accessToken=YOUR_ACCESS_TOKEN";
6
7// Create GeoJSON reader which will down the specified file from Alpaca Travel
8const reader = new H.data.geojson.Reader(url, {
9  style: function (mapObject) {
10    // Parsed geo object can be styled using setStyle method
11    // Refer to styling at the here.com documentation
12  },
13});
14
15// Start parsing the file
16reader.parse();
17
18// Add layer which shows GeoJSON data on the map
19map.addLayer(reader.getLayer());
See More

alpaca.tech

Copyright © 2024 - Made with love ❤️ in Australia.