将响应从REST API传递到AzureMap Control SDK

时间:2019-07-17 22:20:33

标签: azure-maps

如何将结果从https://atlas.microsoft.com/map/tile/pbf传递到Azure Map Control WebSDK?我想从我的API调用Azure Map终结点,所以我不需要在JavaScript中维护密钥,然后将字节数组传递给Web SDK进行渲染。我希望在构造函数上使用一种简单的方法,但是我看不到:

map = new atlas.Map('myMap',  {byte array result from api here});

1 个答案:

答案 0 :(得分:0)

如果使用Azure Active Directory(AAD)进行身份验证。来源:https://docs.microsoft.com/en-us/azure/azure-maps/how-to-use-map-control

<script type="text/javascript">
    var map = new atlas.Map('myMap', {
        center: [-122.33, 47.6],
        zoom: 12,
        language: 'en-US',
        authOptions: {
            authType: 'aad',
            clientId: '<Your AAD Client Id>',
            aadAppId: '<Your AAD App Id>',
            aadTenant: 'msft.ccsctp.net'
        }
    });
</script>