想在离线goole 地图的基础上
再创建一条行人轨迹线,请各位帮帮忙
以下是一个goole离线地图代码:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link href="mapfiles/css/default.css" rel="stylesheet" type="text/css" />
<title>Google Maps JavaScript API v3 Example: Map Simple</title>
<!--script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script-->
<script type="text/javascript" src="mapapi3.8.6.js"></script>
<script type="text/javascript">
function LocalMapType() {}
LocalMapType.prototype.tileSize = new google.maps.Size(256, 256);
LocalMapType.prototype.maxZoom = 19; //地图显示最大级别
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";
//地图存放路径
//谷歌矢量图 maptile/googlemaps/roadmap
//谷歌影像图 maptile/googlemaps/roadmap
//MapABC地图 maptile/mapabc/
var strURL = "maptile/mapabc/";
strURL += zoom + "/" + coord.x + "/" + coord.y + ".PNG";
img.src = strURL;
return img;
};
var localMapType = new LocalMapType();
function initialize() {
var myLatlng = new google.maps.LatLng(26.63605, 106.62849);
var myOptions = {
center: myLatlng,
zoom: 12,
streetViewControl: false,
mapTypeControlOptions: {
mapTypeIds: [
google.maps.MapTypeId.ROADMAP,
google.maps.MapTypeId.HYBRID,
google.maps.MapTypeId.SATELLITE,
google.maps.MapTypeId.TERRAIN,
'locaMap' ] //定义地图类型
}
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
map.mapTypes.set('locaMap', localMapType); //绑定本地地图类型
map.setMapTypeId('locaMap'); //指定显示本地地图
//var markerOptions = new google.maps.MarkerOptions({draggable:true});
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
draggable:true,
title:"Hello World!"
});
var infowindow = new google.maps.InfoWindow(
{ content:"latlng:" + marker.getPosition().toString(),
size: new google.maps.Size(50,50)
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent("latlng:<a href='http://baidu.com'>111</a>" + marker.getPosition().toUrlValue(6));
infowindow.open(map,marker);
});
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas"></div>
</body>
</html>
用了一个地图下载器,下载并合并之后就差不多了,借鉴了liongis大神的地图详解
正题就是怎样在这个基础上弄一条行人轨迹的?下面这个是我通过百度有线api弄的一个。
goole离线怎么整?哎..