Gregoire
Gregoire

Reputation: 24832

Rotate map with Here Maps JavaScript API

Is there any function that allows us to rotate an Here map using the JavaScript API ?

I have found it for android (https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics/maps.html) but I am not able to find it for JavaScript.

If this function does not exist what is the best alternative (still using Here JavaScript API) ?

Upvotes: 0

Views: 1350

Answers (2)

Valstorm
Valstorm

Reputation: 126

The documentation for rotation isn't very well described but I found an example in the organisation's repo:

https://github.com/heremaps/developer-blog/blob/bef386d743d062275ac976546e3c745932ed8e47/javascript-api-3.1/js/MapRotation.js

You can affect the rotation of a map by setting the heading property in the ViewModel:

let mapView = map.getViewModel();

mapView.setLookAtData({
  heading: 90
});

Upvotes: 2

wrldbt
wrldbt

Reputation: 181

H.map.ViewModel.control

https://developer.here.com/javascript-apis/documentation/v3/maps/topics_api_nlp/h-map-viewmodel.html#h-map-viewmodel__control

It looks like you can control the angleX or angleY from the ViewModel if you are able to set this somewhere.

Upvotes: 0

Related Questions