Error - vectorTileDataset.setStyleSet(styles); not a function - Following Harp.GL tutorial on HERE Dev Portal
Closed this issue · 2 comments
cpandit201 commented
I am following tutorial posted on HERE Developer portal
https://developer.here.com/tutorials/harpgl/#introduction
Currently was on step to add remote data on map to style
https://developer.here.com/tutorials/harpgl/#add-data-to-the-map
// At the bottom of index.ts
async function addRailRoads() {
const globalRailroads = new VectorTileDataSource({
baseUrl: "https://xyz.api.here.com/hub/spaces/hUJ4ZHJR/tile/web",
apiFormat: APIFormat.XYZSpace,
authenticationCode: 'ACbs-cqcFI4FlPRLK_VF1co', //Use this token!
});
await mapView.addDataSource(globalRailroads);
const styles = [
{
when: ["==", ["geometry-type"], "LineString"],
renderOrder: 1000,
technique: "solid-line",
color: "#D73060",
opacity: 1,
metricUnit: "Pixel",
lineWidth: 1,
}
];
globalRailroads.setStyleSet(styles);
mapView.update();
}
addRailRoads();
However I am getting the error on last third line
globalRailroads.setStyleSet(styles);
index.js:106 Uncaught (in promise) TypeError: globalRailroads.setStyleSet is not a function
at addRailRoads (index.js:106)
nzjony commented
Thanks @cpandit201 for the bug report and finding an issue in the tutorial!! I will fix it ASAP
nzjony commented
@cpandit201 , thanks for your patience. It is now up to date, please see: https://developer.here.com/tutorials/harpgl/#further-examples