小编gre*_*gan的帖子

d3 v4 geo绘制边界倒置

当我在SVG元素中绘制百慕大三角形时,比例不是我所期望的(三角形应该延伸到框的边缘)并且填充是向后的(而不是绘制三角形,它绘制一个切出三角形的正方形).

var geojson = {
  "features": [
    {
      "type": "Feature",
      "properties": {
        "name": "Bermuda Triangle",
        "area": 1150180
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [-64.73, 32.31],
            [-80.19, 25.76],
            [-66.09, 18.43],
            [-64.73, 32.31]
          ]
        ]
      }
    }
  ],
  "type":"FeatureCollection"
};

var width = 480;
var height = 480;

var svg = d3.select("body").append("svg")
  .attr("width", width)
  .attr("height", height)
  .attr("style", "border: 2px solid black");

var projection = d3.geoMercator().fitSize([width, height], geojson);
var path = d3.geoPath().projection(projection);

svg.selectAll('path')
  .data(geojson.features)
  .enter()
  .append('path')
  .attr('d', path)
  .style("fill", "red")
  .style("stroke-width", …
Run Code Online (Sandbox Code Playgroud)

javascript svg geo d3.js

3
推荐指数
2
解决办法
360
查看次数

Azure VM自定义脚本扩展SAS令牌支持

我正在尝试使用ARM模板部署向Azure VM添加自定义脚本扩展,并且希望它使用SAS令牌从存储帐户下载文件。

这是模板(简体):

{
    "name": "CustomScriptExtension"
    "type": "Microsoft.Compute/virtualMachines/extensions",
    "location": "eastus",
    "properties": {
        "publisher": "Microsoft.Compute",
        "type": "CustomScriptExtension",
        "typeHandlerVersion": "1.8",
        "settings": {
            "fileUris": [
                "https://{storage-account}.blob.core.windows.net/installers/{installer}.msi?sv=2015-04-05&sig={signature}&st=2017-05-03T05:18:28Z&se=2017-05-10T05:18:28Z&srt=o&ss=b&sp=r"
            ],
            "commandToExecute": "start /wait msiexec /package {installer}.msi /quiet"
        },
    }
}
Run Code Online (Sandbox Code Playgroud)

部署它会导致以下错误:

{
  "name": "CustomScriptExtension",
  "type": "Microsoft.Compute.CustomScriptExtension",
  "typeHandlerVersion": "1.8",
  "statuses": [
    {
      "code": "ProvisioningState/failed/3",
      "level": "Error",
      "displayStatus": "Provisioning failed",
      "message": "Failed to download all specified files. Exiting. Error Message: Missing mandatory parameters for valid Shared Access Signature"
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

如果我直接用SAS令牌访问URL,它将很好地下拉文件,因此我知道SAS令牌是正确的。自定义脚本扩展名是否不支持带有SAS令牌的URL?

azure azure-virtual-machine azure-resource-manager azure-template

2
推荐指数
1
解决办法
2301
查看次数