google map v3离线版地图

包含的文件夹格式如下:

程序运行效果如下:


页面代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
	#map_canvas{
		background-color: #CCC;
		width:100%;
		height: 95%;
  		position: absolute;
  		bottom:0px;
  		left:0;
  		right:0;
  		top:20;
  		margin: 0;
  		padding: 0;
	}
</style>

<script type="text/javascript" src="mapapi.js"></script>
<script type="text/javascript">
var map;
var myCenter = new google.maps.LatLng(22.786607,100.977316);
function CoordMapType() {
}
CoordMapType.prototype.tileSize = new google.maps.Size(256,256);
CoordMapType.prototype.maxZoom = 19;

CoordMapType.prototype.getTile = function(coord, zoom, ownerDocument) {
  var div = ownerDocument.createElement('div');
  div.innerHTML = '<img name="" src="./tiles/' + zoom + '/gs_'  + coord.x +'_'+ coord.y + '_' + zoom + '.jpg"  οnerrοr="errpic(this)"/>';
  div.style.width = this.tileSize.width + 'px';
  div.style.height = this.tileSize.height + 'px';
  div.style.fontSize = '10';
  div.style.borderStyle = 'solid';
  div.style.borderWidth = '1px';
  div.style.borderColor = '#AAAAAA';
  return div;
};
//实现更换图片功能
var web_url="./";
function errpic(thepic){
	thepic.src=web_url+"undefined.jpg";
}

CoordMapType.prototype.name = "Tile #s";
CoordMapType.prototype.alt = "Tile Coordinate Map Type";

var coordinateMapType = new CoordMapType();

function initialize() {
  var mapOptions = {
    zoom: 6,
    center: myCenter,
    mapTypeId: "coordinate"
  };
  map = new google.maps.Map(document.getElementById("map_canvas"),
      mapOptions);
      
   map.mapTypes.set('coordinate',coordinateMapType);
}
</script>


</head>

<body onLoad="initialize()">
<div>
</div>
<div id="map_canvas"></div>
</body>
</html>

程序源代码下载地址: http://download.csdn.net/detail/qinpeng100423/4788057

全文完。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值