Reputation: 2310
I'm having trouble getting Here Maps' routing system working on web, for now by following the official documentation.
The part that isn't clear is that I don't know how to call the routingCallback()
function, or actually where to call it, and what are it's parameters.
The documentation states the following:
"A route can be added to the map only after it has been calculated. For this reason, the routing manager must be given an observer to be called when the route is ready. The observer watches the Manager's property "state""
What exactly is this "observer" object? When should I call the routingCallback()
function?
I am using the exact same code that can be found in the documentation.
Thanks!
Upvotes: 0
Views: 287
Reputation: 1107
I can see the confusion, they don't show where/how to attach the observer.
Note however that you don't call the routingCallback yourself, the routing manager calls that function automatically once the async call is done e.g.
var routingManager = new nokia.maps.advrouting.Manager();
routingManager.addObserver("state", routingCallback, routingManager);
Upvotes: 1