如何用ASP.NET将.png图像转换为Bing或Google地图的tile

本文关键字:Bing Google 地图 tile 转换 ASP 何用 NET 图像 png | 更新日期: 2023-09-27 18:03:24

我正在寻找一种方法来转换。png(像这个:http://1drv.ms/1O9lrG5)到瓷砖,我可以使用谷歌或必应地图。我正在考虑一个服务器端脚本,每10分钟这样做一次(因为. png的内容可能会改变)。

我知道像MapCruncher这样的工具,但这不是我想要的:我想要一个完全自动化的方式来获得相关的。png,生成瓷砖(从所有4个角的纬度/长),并让我的客户端应用程序访问。

任何想法?

如何用ASP.NET将.png图像转换为Bing或Google地图的tile

如果你想要的是:MapTilerLayer(或overlay-simple),你可以使用一个动态url来渲染图像,并将其设置为覆盖的源图像。

示例来自Google Maps Javascript API:

function initialize() {
  var mapOptions = {
    zoom: 11,
    center: new google.maps.LatLng(62.323907, -150.109291),
    mapTypeId: google.maps.MapTypeId.SATELLITE
  };
  var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
  var swBound = new google.maps.LatLng(62.281819, -150.287132);
  var neBound = new google.maps.LatLng(62.400471, -150.005608);
  var bounds = new google.maps.LatLngBounds(swBound, neBound);
  // THE DYNAMIC IMAGE URL
  var srcImage = 'http://your.url/image.ashx';
  // The custom USGSOverlay object contains the USGS image,
  // the bounds of the image, and a reference to the map.
  overlay = new USGSOverlay(bounds, srcImage, map);
}

除非您想自己编写切片代码,否则可能使用较旧的DeepZoomTools.dll。

你可以通过下载deep zoom composer并从它的bin中拉出它来获得.dll。

这是一个博客的链接,展示了如何以编程方式创建磁贴。

几年前我在一个项目中使用了它,效果很好。如果需要,我可以试着找出代码。