我如何在SSIS包中使用这段JavaScript?

时间:2011-07-20 18:27:47

标签: javascript ssis maps

我需要像这个JavaScript代码那样提取最大缩放级别,但是在SSIS包中,例如在脚本任务中。但我不知道该怎么做。如何在此脚本任务中引用下面的网页代码来引用库?

var map;
var maxZoomService = new google.maps.MaxZoomService();

var tokyo = new google.maps.LatLng(35.6894875, 139.6917064);

function initialize() {
  var mapOptions = {
    zoom: 11,
    center: tokyo,
    mapTypeId: google.maps.MapTypeId.HYBRID
  }
  map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);

  google.maps.event.addListener(map, 'click', showMaxZoom);
}

function showMaxZoom(e) {
  maxZoomService.getMaxZoomAtLatLng(e.latLng, function(response) {
    if (response.status != google.maps.MaxZoomStatus.OK) {
      alert("Error in MaxZoomService");
      return;
    } else {
      alert("The maximum zoom at this location is: " + response.zoom);
    }
    map.setCenter(e.latLng);
  });
}

1 个答案:

答案 0 :(得分:1)

我对JavaScript知之甚少,但任何与GUI交互或弹出消息框的内容都不适合在服务器上运行的SSIS包中。我会建议以下之一:

  • 编写一个独立的命令行脚本,返回您想要的值,然后从执行流程任务中调用它
  • 将您的功能包装到Web服务中并从包中调用服务
  • 在脚本任务中使用.NET代码