export function GetLocationMapImageUrl()

in Node/core/src/services/bing-geospatial-service.ts [26:46]


export function GetLocationMapImageUrl(apiKey: string, location: RawLocation, index?: number) {
    if (location && location.point && location.point.coordinates && location.point.coordinates.length == 2) {

        var point = location.point;
        var url: string;
        var sIndex = typeof index === "undefined" ? "" : index.toString();

        if (location.bbox && location.bbox.length == 4) {
            url = sprintf(findImageByBBoxUrl, location.bbox[0], location.bbox[1], location.bbox[2], location.bbox[3], point.coordinates[0], point.coordinates[1], sIndex)
        }
        else {
            url = sprintf(findImageByPointUrl, point.coordinates[0], point.coordinates[1], sIndex)
        }            
        
        url = addKeyToUrl(url, apiKey);

        return url;
    }

    throw "Invalid Location Format: " + location;
}