<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="gs_infowindow.css">
<script type="text/javascript" src="http://ditu.google.cn/maps/api/js?libraries=drawing&sensor=true&language=zhCN"></script>
<script type="text/javascript" src="gs_googlemap.js"></script>
<script type="text/javascript">
var pointerXOffset=-17;
var pointerYOffset=-44;
var largeXOffset=-17;
var largeYOffset=-44;
var markerMainPointWidth=22;
var markerMainPointHeight=31;
var markerNormalPointWidth=18;
var markerNormalPointHeight=26;
var mGmap;
var centerLat=31.2399;//东方明珠坐标
var centerLon=121.4996;
function initialize() {
mGmap=new GMap(0);
mGmap.init("map_canvas");
var latLon= mGmap.LatLng(centerLat,centerLon);
mGmap.setCenter(latLon);
var overlay3= new USGSOverlay(getLargeView(),mGmap.LatLng(31.2399,121.4996),{x:largeXOffset,y:largeYOffset},'infobox','m');
mGmap.addOverlay('infobox',overlay3);
overlay3.bind("click",function(event){
var box=mGmap.getOverlay('infobox','m');
//box.hide();
});
var overlay1= new USGSOverlay(getPointView(),mGmap.LatLng(31.2399,121.4996),{x:pointerXOffset,y:pointerYOffset},'infobox','m');
mGmap.addOverlay('infobox',overlay1);
overlay1.bind("click",function(event){
var box=mGmap.getOverlay('infobox','m');
//box.hide();
});
}
function getLargeView()
{
//config start
var bgColor="#41AFEA";
var borderColor="#058BBC";
var contentText="Hello GoogleMap!Hello GoogleMap!Hello GoogleMap!Hello GoogleMap!";
//config end
var htmlObj=document.createElement("div");
var fav=document.createElement("div");
fav.className = "fav"
fav.innerHTML = "<img src='gs_nmap_marker_detail_star.png' />";
htmlObj.appendChild(fav);
var containerHeight=32;//34px --2px border⁄
var containerWidth=100;//102px
var contentWidth=containerWidth-(4+4+2);//margin=4,border=2
var contentHeight=containerHeight-(4+4+2);
var sLeft=(containerWidth-20)/2;
var sTop=containerHeight+1;
largeXOffset=-containerWidth/2+4;
largeYOffset=-containerHeight-12-(markerMainPointHeight-6);//26 31 point height
htmlObj.className = "container";
htmlObj.style.background=bgColor;
htmlObj.style.borderColor=borderColor;
htmlObj.style.width=containerWidth+"px";
htmlObj.style.height=containerHeight+"px";
var textNode=document.createTextNode(contentText);
var elementD=document.createElement("div");
var elementS=document.createElement("s");
var elementI=document.createElement("i");
elementD.className = "content";
elementD.style.width=contentWidth+"px";
elementD.style.height=contentHeight+"px";
elementD.appendChild(textNode);
elementS.appendChild(elementI);
elementI.style.borderTopColor=bgColor;
elementS.style.borderTopColor=borderColor;
htmlObj.appendChild(elementD);
htmlObj.appendChild(elementS);
return htmlObj;
}
function getPointView() {
//22*31 == mainpoi
//18*26 == collect & normal
var imgWidth=markerMainPointWidth;
var imgHeight=markerMainPointHeight;
pointerXOffset=-imgWidth/2+5;
pointerYOffset=-imgHeight+5;
var htmlObj = document.createElement("div");
htmlObj.className = "imgContainer";
htmlObj.innerHTML = "<img src='ico_map_gs_nmap_marker_point_funny.png' width="+imgWidth+"px height="+imgHeight+"px/>";
return htmlObj;
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width: 100%; height: 600px"></div>
</body>
</html>
kr.mao
- 粉丝: 76
- 资源: 12
最新资源
- 惯性导航系统INS和GPS综合导航MATLAB程序.zip
- 官方MATLAB实现的稀疏反卷积v103.zip
- 合成孔径雷达成像 相关Some work I did during my graduate studies Matla.zip
- 光速matlab工具箱.zip
- 光学无监督聚类算法的MATLAB实现.zip
- 绘图库的MATLAB.zip
- 华中科技大学电信学院软件无线电MATLAB实验代码实验报告学习资料等个人版16QAMOFDMDDC无线电信道化接收机等.zip
- 机器人机器视觉的MATLAB工具箱的通用代码.zip
- 机器视觉工具箱的MATLAB.zip
- 机器人视觉控制第三版在MATLAB中的新工具箱数据和示例.zip
- TensorFlow神经网络Playground的MATLAB实现.zip
- SSVEP刺激器使用MATLAB和Psychtoolbox.zip
- SQAT是一个开源的MATLAB代码库,其中包含用于定量音质分析的关键指标的实现.zip
- TextMate支持Matlab Octave.zip
- VLBenchmark是一套用于计算机视觉功能的MATLAB基准测试套件.zip
- WarpFactory是一个用于分析曲速引擎时空的数值工具包.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈