怎样下载谷歌卫星地图并在内网中使用

离线谷歌卫星地图加载服务中间件调用示例ForGoogle API
1.说明
水经离线谷歌卫星地图加载服务中间件可利用离线地图的.dat文件在本地建立服务端,并生成影像、标签、高程等服务地址,可以在GoogleAPI中直接调用该服务地址,并将请求到的服务资源显示在前端,当请求的地图资源不存在可通过网络直接下载缺失的地图,并储存在.dat文件中。百度网盘下载:http://pan.baidu.com/s/1bnjZDZx
2.实现
2.1准备水经注万能地图下载器下载好需要的地图范围
2.2准备GoogleMapAPIV3
下载GoogleMapAPIV3.rar。
在其目录下新建一个html文件“RiverMapServerSampleFor Google API.html”,如下图。
利用记事本打开“RiverMapServerSample For GoogleAPI.html”并进行编辑,具体内容如下。
\u0026lt;!DOCTYPE html\u0026gt;
\u0026lt;html\u0026gt;
\u0026lt;head\u0026gt;
\u0026lt;metahttp-equiv="Content-Type" content="text/html;charset=utf-8" /\u0026gt;
\u0026lt;title\u0026gt;RiverMapServerSample ForGoogle API\u0026lt;/title\u0026gt;
\u0026lt;linkhref="https://www.zhihu.com/api/v4/questions/30428611/mapfiles/css/default.css" rel="stylesheet"type="text/css" /\u0026gt;
\u0026lt;scripttype="text/javascript" src="https://www.zhihu.com/api/v4/questions/30428611/mapapi.js"\u0026gt;\u0026lt;/script\u0026gt;
\u0026lt;script\u0026gt;
function tlen(len, mystr){
mystr = String(mystr);
var num = len - mystr.length;
for (var i = 0; i \u0026lt;= num; i++)
{
mystr = "0" + mystr;
}
return mystr;
};
function CoordMapType(tileSize) {
this.tileSize = tileSize;
}
CoordMapType.prototype.getTile =function(coord, zoom, ownerDocument) {
var div =ownerDocument.createElement(\u0026#39;DIV\u0026#39;);
var ymax = 1 \u0026lt;\u0026lt;zoom;
var y = coord.y;
y = tlen(5,y);
var x = tlen(5,coord.x);
zoom = tlen(1,zoom+1);
div.innerHTML = y +"," + x + "," + zoom;
div.style.width =this.tileSize.width + \u0026#39;px\u0026#39;;
div.style.height =this.tileSize.height + \u0026#39;px\u0026#39;;
div.style.fontSize = \u0026#39;10\u0026#39;;
div.style.borderStyle =\u0026#39;solid\u0026#39;;
div.style.borderWidth =\u0026#39;1px\u0026#39;;
div.style.borderColor =\u0026#39;#AAAAAA\u0026#39;;
return div;
};
function LocalMapType() {}
LocalMapType.prototype.tileSize =new google.maps.Size(256, 256);
LocalMapType.prototype.maxZoom =20;
【怎样下载谷歌卫星地图并在内网中使用】 LocalMapType.prototype.minZoom =0;
LocalMapType.prototype.name ="本地";
LocalMapType.prototype.alt ="显示本地地图";
LocalMapType.prototype.getTile =function(coord, zoom, ownerDocument) {
var img =ownerDocument.createElement("img");
img.style.width = this.tileSize.width +"px";
img.style.height = this.tileSize.height+ "px";
var ymax = 1 \u0026lt;\u0026lt; zoom;
var y = coord.y;
y = tlen(5,y);
var x = tlen(5,coord.x);
zoom = tlen(1,zoom+1);
var strURL ="http://127.0.0.1:1002/getDefinedImage?" + "x=" + x +"\u0026amp;y=" + y + "\u0026amp;z=" + zoom;


推荐阅读