Bing Maps MIO api: "BeginLocation and EndLocation with address"

Davy de Kerf 21 Reputation points
2020-11-26T08:48:59.883+00:00

Hi,

I'm playing around with the MIO API and I've almost got it working completely.

One problem I can't get around is that I'm trying to use address for my start- and endlocation, but it won't recognize them. It only works if I specify the long/lat but I don't want to geocode them first.

This is what I'm trying (https://dev.virtualearth.net/REST/V1/Routes/OptimizeItinerary?key=...):

{
"agents": [
{
"name": "agentName",
"shifts": [
{
"startTime": "2020-11-25T08:00:00",
"startLocation": {
"address": "Bijster 43, Breda"
},
"endTime": "2020-11-25T18:00:00",
"endLocation": {
"address": "Bijster 43, Breda"
}
}
],
"capacity": [
16
]
}
],
"itineraryItems": [ …..

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
721 questions
{count} votes

Accepted answer
  1. Alexandru Cristian 86 Reputation points
    2020-12-02T21:51:58.31+00:00

    Hi @Davy de Kerf we noticed that the documentation is lacking in this matter and we will update it soon, thanks for point this out.
    Until then, I hope the example bellow that showcases the address/location functionality for both shifts and items will help you:

    {  
        "agents": [  
            {  
                "name": "Agent location",  
                "shifts": [  
                    {  
                        "StartTime": "2019-11-09T08:00:00",  
                        "StartLocation": {  
                            "Latitude": 47.694117204371,  
                            "Longitude": -122.378188970181  
                        },  
                        "EndTime": "2019-11-09T20:00:00",  
                        "EndLocation": {  
                            "Latitude": 47.7070790545669,  
                            "Longitude": -122.355226696231  
                        }  
                    }  
                ]  
            },  
            {  
                "name": "Agent address",  
                "shifts": [  
                    {  
                        "StartTime": "2019-11-09T08:00:00",  
                        "StartAddress": "1317 E Republican St, Seattle, WA 98102",  
                        "EndTime": "2019-11-09T20:00:00",  
                        "EndAddress": "1317 E Republican St, Seattle, WA 98102"  
                    }  
                ]  
            }  
        ],  
        "itineraryItems": [  
            {  
                "Name": "With address",  
                "OpeningTime": "2019-11-09T09:00:00",  
                "ClosingTime": "2019-11-09T18:00:00",  
                "DwellTime": "01:31:08.3850000",  
                "Priority": 1,  
                "Address": "1317 E Republican St, Seattle, WA 98102"  
            },  
            {  
                "Name": "With coordinates",  
                "OpeningTime": "2019-11-09T09:00:00",  
                "ClosingTime": "2019-11-09T18:00:00",  
                "DwellTime": "01:00:32.6770000",  
                "Priority": 1,  
                "Location": {  
                    "Latitude": 47.6798098928389,  
                    "Longitude": -122.383036445391  
                }  
            }  
        ]  
    }
    
    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.