So I have an MVC webapp that aims to search a vehicle by its plate, return a large string with latitude and longitude coordinates from my database showing where it's been through, and then draw a route on a map with every set of 'lat,long' as a waypoint.
I know that if I input every coordinate manually it works, but what I'm trying to do, since every plate is going to return a different set of coordinates, is assigning an array to routingParameters' via, using H.service.Url.MultiValueQueryParameter()
.
I have an array named slice, which displays the following:
["'-23.502750,-46.845710'", "'-23.502750,-46.845710'", "'-23.502655,-46.845567'", "'-23.502655,-46.845567'", "'-23.502655,-46.845567'", "'-23.506386,-46.838802'...]"
I then assign it to via as such:
'via': new H.service.Url.MultiValueQueryParameter(slice)
and Here Maps API returns the following error:
{"title":"Malformed request","status":400,"code":"E605001","cause":"Error while parsing request:
Invalid location specification at ''-23.502750,-46.845710''
Invalid waypoint at ''-23.502750,-46.845710''
Unexpected input at ''-23.502750,-46.845710''
Invalid value for parameter 'via' at ''-23.502750,-46.845710''","action":"","correlationId":"e01765c2-9db1-465c-87bd-ab9b1e9cc444"}
Is there any way this can be done?
question from:
https://stackoverflow.com/questions/66065304/here-maps-javascript-api-malformed-request-when-trying-to-dynamically-add-mult 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…