John
John

Reputation: 475

How do i use this piece of JavaScript in a SSIS package?

I am needing to extract the max zoom level as this JavaScript code does, but in a SSIS package, such as in a script task. But i do not know how to do this. How do i reference the library as the web page code below does in this script task?

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);
  });
}

Upvotes: 0

Views: 1429

Answers (1)

Pondlife
Pondlife

Reputation: 16260

I don't know much about JavaScript, but anything that interacts with a GUI or pops up a message box will not fit well into an SSIS package running on a server. I would suggest one of the following:

  • Write a standalone command-line script that returns the value you want, then call it from an Execute Process task
  • Wrap your function into a web service and call the service from the package
  • Use .NET code in a Script Task

Upvotes: 2

Related Questions