<!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>电子地图定位</title>
<script type="text/javascript" src="./mapfiles/mapapi.js"></script>
<script type="text/javascript" src="./eshapes.js"></script>
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
</style>
</head>
<body onload="initializeGoogleMap()">
<script>
var GooleMapPath = './maptile/googlemaps/';
var RoadMapType = {
tileSize: new google.maps.Size(256, 256),
maxZoom: 18, // 地图显示最大级别
minZoom: 1, // 地图显示最小级别
name: "路线图",
alt: "显示路线图",
isPng: true,
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 strURL = GooleMapPath + "roadmap/";
strURL += zoom + "/" + coord.x + "/" + coord.y + ".PNG";
img.src = strURL;
return img;
},
releaseTile: function (tile) {//删除视图外title事件
}
};
var satelliteMapType = {
tileSize: new google.maps.Size(256, 256),
maxZoom: 17, // 地图显示最大级别
minZoom: 1, // 地图显示最小级别
name: "卫星图",
alt: "显示卫星图",
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 strURL = GooleMapPath + "satellite/";
strURL += zoom + "/" + coord.x + "/" + coord.y + ".jpg";
img.src = strURL;
return img;
},
releaseTile: function (tile) {//删除视图外title事件
}
};
var satelliteOverlayType = {
tileSize: new google.maps.Size(256, 256),
maxZoom: 17, // 地图显示最大级别
minZoom: 1, // 地图显示最小级别
name: "卫星地名",
alt: "显示卫星地名",
isPng: true,
opacity: 0.70,
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 strURL = GooleMapPath + "overlay/";
strURL += zoom + "/" + coord.x + "/" + coord.y + ".png";
img.src = strURL;
return img;
},
releaseTile: function (tile) {//删除视图外title事件
}
};
</script>
<script>
var map = null;
var LocaltionPos = null;
var CellArray = [];
var CarLine = null;
var CellLine = null;
var CellMark=[];
function CreateCarLine(LineArray) {
var PolyArray = [];
for (i = 0; i < LineArray.length; i++) {
PolyArray.push(GoogleMapJP(LineArray[i][0], LineArray[i][1]));
}
if (CarLine != null) {
CarLine.setPath(PolyArray);
}
else {
CarLine = new google.maps.Polyline({
path: PolyArray,
geodesic: true,
strokeColor: '#FF0000',
strokeOpacity: 1.0,
strokeWeight: 2
});
CarLine.setMap(map);
}
}
function CreateCellLine(LineArray,LAC,CI) {
var PolyArray = [];
for (i = 0; i < LineArray.length; i++) {
if (CellMark[i]) CellMark[i].setMap(null);
CellMark[i] = new google.maps.Marker({
icon: "./icon/CI.png",
map: map,
position: GoogleMapJP(LineArray[i][0], LineArray[i][1]),
title: "LAC:"+LAC[i]+" CELLID:"+CI[i]
});
PolyArray[i] = GoogleMapJP(LineArray[i][0], LineArray[i][1]);
}
if (CellLine != undefined) {
CellLine.setPath(PolyArray);
}
else {
CellLine = new google.maps.Polyline({
path: PolyArray,
geodesic: true,
strokeColor: '#0000FF',
strokeOpacity: 1.0,
strokeWeight: 2
});
CellLine.setMap(map);
}
}
function HideCell(ID) {
if (CellArray[ID] != undefined) {
CellArray[ID][0].setMap(null);
CellArray[ID][1].setMap(null);
CellArray[ID][2].setMap(null);
CellArray[ID][3].setMap(null);
}
}
function ShowCell(ID, x, y, radius, MNC,LAC,CELLID,CELLNAME) {
if (CellArray[ID] == undefined) {
CreateCell(ID, x, y, radius, MNC,LAC,CELLID,CELLNAME);
}
else {
CellArray[ID][0].setMap(map);
CellArray[ID][1].setMap(map);
CellArray[ID][2].setMap(map);
CellArray[ID][3].setMap(map);
}
}
function SetMapCenter(x, y) {
map.setCenter(GoogleMapJP(x, y));
}
function CreateCell(ID, x, y, radius, MNC,LAC,CELLID,CELLNAME) {
CellArray[ID] = [];
if (MNC == 1) {
Startdegree = 60;
} else {
Startdegree = 0;
}
var POS = GoogleMapJP(x, y);
for (i = 0; i <= 2; i++) {
if (i == 0) FillColors = '#FF0000';
if (i == 1) FillColors = '#FFFF47';
if (i == 2) FillColors = '#0A0AFF';
triangleCoords = GPolygonSector(POS, radius, Startdegree, Startdegree + 120);
CellArray[ID][i] = new google.maps.Polygon({
paths: triangleCoords,
strokeColor: FillColors,
strokeOpacity: 0,
strokeWeight: 2,
fillColor: FillColors,
fillOpacity: 0.35,
map: map
});
Startdegree = Startdegree + 120;
}
CellArray[ID][3] = new google.maps.Marker({
icon: "./icon/cell.png",
position: POS,
map: map,
draggable: false,
title: "名称:"+CELLNAME+" "+ "LAC:"+LAC+" CI:"+CELLID
});
}
function initializeGoogleMap() {
var initialPosition = new google.maps.LatLng(37.52516, 121.374224);
var myOptions = {
center: initialPosition,
zoom: 4,
navigationControl: true,
disableDefaultUI: true,
rotateControl: true,
panControl: true,
scrollwheel: true,
panControlOptions: {
position: google.maps.ControlPosition.TOP_LEFT
},
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.LARGE,
position: google.maps.ControlPosition.TOP_LEFT
},
scaleControl: true,
scaleControlOptions: {
position: google.maps.ControlPosition.BOTTOM_CENTER,
draggable: true
},
streetViewControl: true,
streetViewControlOptions: {
position: google.maps.ControlPosition.TOP_LEFT
},
mapTypeControl: true,
mapTypeControlOptions: {
mapTypeIds: [ 'RoadMap', 'SatelliteMap'], //定义地图类型,
style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR
}
没有合适的资源?快使用搜索试试~ 我知道了~
谷歌地图离线API3.16.2+简单纠偏算法+画扇形
共189个文件
png:152个
js:26个
db:3个
5星 · 超过95%的资源 需积分: 32 74 下载量 185 浏览量
2014-06-23
17:09:51
上传
评论 3
收藏 2.38MB 7Z 举报
温馨提示
1、谷歌地图离线API3.16.2 2、简单纠偏算法 3、画扇形 4、画轨迹
资源推荐
资源详情
资源评论
收起资源包目录
谷歌地图离线API3.16.2+简单纠偏算法+画扇形 (189个子文件)
crosshair.cur 4KB
closedhand_8_8.cur 326B
openhand_8_8.cur 326B
Thumbs.db 20KB
Thumbs.db 6KB
Thumbs.db 5KB
iw_close.gif 76B
iw_plus.gif 76B
iw_minus.gif 73B
map-simple.html 12KB
common.js 93KB
controls.js 59KB
main.js 49KB
util.js 45KB
poly.js 43KB
onion.js 25KB
marker.js 22KB
visualization_impl.js 19KB
map.js 15KB
kml.js 11KB
places_impl.js 11KB
infowindow.js 10KB
drawing_impl.js 10KB
weather_impl.js 8KB
stats.js 6KB
geometry.js 5KB
mapapi_bak.js 5KB
mapapi.js 5KB
usage.js 4KB
geocoder.js 2KB
places.js 2KB
eshapes.js 2KB
overlay.js 1KB
layers.js 738B
maxzoom.js 477B
drawing.js 402B
12.png 54KB
13.png 54KB
13.png 52KB
13.png 47KB
6.png 44KB
6.png 43KB
13.png 41KB
12.png 40KB
2.png 40KB
12.png 38KB
1.png 37KB
13.png 37KB
2.png 36KB
10.png 36KB
14.png 35KB
10.png 34KB
11.png 34KB
5.png 33KB
3.png 33KB
3.png 32KB
5.png 32KB
2.png 31KB
11.png 31KB
2.png 31KB
12.png 31KB
3.png 31KB
2.png 30KB
10.png 30KB
7.png 30KB
14.png 29KB
6.png 28KB
1.png 27KB
5.png 26KB
10.png 26KB
cb_scout_sprite_api_003.png 26KB
2.png 26KB
11.png 25KB
10.png 25KB
4.png 25KB
0.png 24KB
14.png 24KB
12.png 24KB
0.png 24KB
cb_scout2.png 23KB
1.png 23KB
11.png 23KB
1.png 23KB
1.png 22KB
1.png 22KB
0.png 21KB
10.png 20KB
12.png 20KB
14.png 20KB
3.png 20KB
11.png 20KB
0.png 19KB
11.png 19KB
10.png 19KB
4.png 18KB
7.png 18KB
2.png 18KB
5.png 17KB
1.png 16KB
7.png 16KB
共 189 条
- 1
- 2
资源评论
- yjb3326232016-01-25可以用吧,但注释不全面,慢慢研究了
- y86l12202016-01-28代码不错,值得参考学习
- qq_330733612017-10-12代码算法不错,画扇形部分要是能简单明确些就好了。
- linlhp2015-06-04代码不错,值得参考学习,谢谢楼主的分享
- 二葱2014-09-18代码挺好,但是已经不适用现在的谷歌地图
lovewangyuxiao
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功