使用 Bing 映射作为 Google 映射覆盖 - 谁能帮助更新我的代码?
Using Bing mapping as a Google mapping overlay - anyone help update my code?
这听起来有点弱,但是...我一直在使用 Liam Corner 的一个可爱的 javascript,叫做 "Google Maps OS",我从一个 greasemonkey 插件 http://userscripts.org/scripts/review/84975 (不再存在)。
我从来没有真正理解脚本是如何工作的,但直到几个星期前它工作得很好。然后 1:50000 和 1:25000 比例尺的详细军械测量地图就消失了,这是来自 Bing 地图并覆盖在我的 google 地图上。该脚本现在提供一些非常平淡的地图图块,这些图块对我的目的没有用。
覆盖映射的脚本的重要部分如下所示...
Create: function (){
var customMapLayer ={
getTileUrl: function (pos, zoom){
var serverID = (((pos.y & 1) << 1) + (pos.x & 1));
var URL = "http://ecn.t" + serverID + ".tiles.virtualearth.net/tiles/r";
for (i = zoom - 1; i >= 0; i--){
URL = URL + (((((pos.y >> i) & 1) << 1) + ((pos.x >> i) & 1)));
}
// OS tiles are only available for zoom levels 12 - 16, otherwise fall back to standard Bing map tiles
if (zoom >= 12){
URL = URL + ".png?g=41&productSet=mmOS";
}else{
URL = URL + "?g=550&shading=hill";
}
return URL;
},
tileSize: new google.maps.Size(256, 256),
isPng: true,
maxZoom: 16,
minZoom: 2,
opacity: 1,
name: "OS maps",
alt: "OS 1:50k maps at Zoom 12-14, and 1:25k maps at Zoom 15-16"
};
window._gmaps_os_customMapType = new google.maps.ImageMapType(customMapLayer);
};
那么有没有什么方法可以修复它以便它可以获得 OS 映射?
我知道 Bing 还没有完全撤回军械测量局的地图,因为我仍然可以在 Bing 地图上看到它 - 例如https://www.bing.com/mapspreview?v=2&cp=53.755093~-1.661820&lvl=15&sty=s&form=LMLTCC
有什么建议吗?
在 Bing 地图控件之外使用 Bing 地图中的军械测量地图数据是违反使用条款的。几周前,图块服务器被锁定,以防止这些图块在 Bing 地图 API 之外使用。请注意,英国陆军测量局不允许将他们的任何数据用于 Google 地图。这样做也违反了军械测量局的使用条款。
这听起来有点弱,但是...我一直在使用 Liam Corner 的一个可爱的 javascript,叫做 "Google Maps OS",我从一个 greasemonkey 插件 http://userscripts.org/scripts/review/84975 (不再存在)。
我从来没有真正理解脚本是如何工作的,但直到几个星期前它工作得很好。然后 1:50000 和 1:25000 比例尺的详细军械测量地图就消失了,这是来自 Bing 地图并覆盖在我的 google 地图上。该脚本现在提供一些非常平淡的地图图块,这些图块对我的目的没有用。
覆盖映射的脚本的重要部分如下所示...
Create: function (){
var customMapLayer ={
getTileUrl: function (pos, zoom){
var serverID = (((pos.y & 1) << 1) + (pos.x & 1));
var URL = "http://ecn.t" + serverID + ".tiles.virtualearth.net/tiles/r";
for (i = zoom - 1; i >= 0; i--){
URL = URL + (((((pos.y >> i) & 1) << 1) + ((pos.x >> i) & 1)));
}
// OS tiles are only available for zoom levels 12 - 16, otherwise fall back to standard Bing map tiles
if (zoom >= 12){
URL = URL + ".png?g=41&productSet=mmOS";
}else{
URL = URL + "?g=550&shading=hill";
}
return URL;
},
tileSize: new google.maps.Size(256, 256),
isPng: true,
maxZoom: 16,
minZoom: 2,
opacity: 1,
name: "OS maps",
alt: "OS 1:50k maps at Zoom 12-14, and 1:25k maps at Zoom 15-16"
};
window._gmaps_os_customMapType = new google.maps.ImageMapType(customMapLayer);
};
那么有没有什么方法可以修复它以便它可以获得 OS 映射? 我知道 Bing 还没有完全撤回军械测量局的地图,因为我仍然可以在 Bing 地图上看到它 - 例如https://www.bing.com/mapspreview?v=2&cp=53.755093~-1.661820&lvl=15&sty=s&form=LMLTCC
有什么建议吗?
在 Bing 地图控件之外使用 Bing 地图中的军械测量地图数据是违反使用条款的。几周前,图块服务器被锁定,以防止这些图块在 Bing 地图 API 之外使用。请注意,英国陆军测量局不允许将他们的任何数据用于 Google 地图。这样做也违反了军械测量局的使用条款。