10 измењених фајлова са 216 додато и 23 уклоњено
@ -0,0 +1,12 @@ |
|||
package controllers |
|||
|
|||
import "github.com/astaxie/beego" |
|||
|
|||
type MapController struct { |
|||
beego.Controller |
|||
} |
|||
|
|||
func (this *MapController) Get() { |
|||
this.Data["IsMap"] = true |
|||
this.TplName = "map.html" |
|||
} |
@ -0,0 +1,9 @@ |
|||
.nav-container{ |
|||
position: fixed; |
|||
width: 100%; |
|||
z-index: 1000; |
|||
} |
|||
|
|||
.nav-container .sui-navbar .navbar-inner{ |
|||
padding: 0 50px; |
|||
} |
@ -0,0 +1,13 @@ |
|||
|
|||
.map-root { |
|||
position: absolute; |
|||
width: 100%; |
|||
height: 100%; |
|||
left: 0; |
|||
top: 0; |
|||
} |
|||
|
|||
.map-root .map-container { |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
@ -0,0 +1,93 @@ |
|||
/** |
|||
* Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/) |
|||
* http://cssreset.com |
|||
*/ |
|||
html, body, div, span, applet, object, iframe, blockquote, pre, |
|||
a, abbr, acronym, address, big, cite, code, |
|||
del, dfn, em, img, ins, kbd, q, s, samp, |
|||
small, strike, strong, sub, sup, tt, var, |
|||
b, u, i, center, |
|||
dl, dt, dd, ol, ul, li, |
|||
fieldset, form, label, legend, |
|||
table, caption, tbody, tfoot, thead, tr, th, td, |
|||
article, aside, canvas, details, embed, |
|||
figure, figcaption, footer, header, |
|||
menu, nav, output, ruby, section, summary, |
|||
time, mark, audio, video, input { |
|||
margin: 0; |
|||
padding: 0; |
|||
border: 0; |
|||
font-size: 100%; |
|||
font-weight: normal; |
|||
vertical-align: baseline; |
|||
} |
|||
|
|||
/* HTML5 display-role reset for older browsers */ |
|||
article, aside, details, figcaption, figure, |
|||
footer, header, menu, nav, section { |
|||
display: block; |
|||
} |
|||
body { |
|||
line-height: 1; |
|||
} |
|||
|
|||
blockquote, q { |
|||
quotes: none; |
|||
} |
|||
|
|||
blockquote:before, blockquote:after, |
|||
q:before, q:after { |
|||
content: none; |
|||
} |
|||
|
|||
table { |
|||
border-collapse: collapse; |
|||
border-spacing: 0; |
|||
} |
|||
|
|||
/* custom */ |
|||
a { |
|||
color: #7e8c8d; |
|||
text-decoration: none; |
|||
-webkit-backface-visibility: hidden; |
|||
} |
|||
|
|||
li { |
|||
list-style: none; |
|||
} |
|||
|
|||
::-webkit-scrollbar { |
|||
width: 5px; |
|||
height: 5px; |
|||
} |
|||
|
|||
::-webkit-scrollbar-track-piece { |
|||
background-color: rgba(0, 0, 0, 0.2); |
|||
-webkit-border-radius: 6px; |
|||
} |
|||
|
|||
::-webkit-scrollbar-thumb:vertical { |
|||
height: 5px; |
|||
background-color: rgba(125, 125, 125, 0.7); |
|||
-webkit-border-radius: 6px; |
|||
} |
|||
|
|||
::-webkit-scrollbar-thumb:horizontal { |
|||
width: 5px; |
|||
background-color: rgba(125, 125, 125, 0.7); |
|||
-webkit-border-radius: 6px; |
|||
} |
|||
|
|||
html, body { |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
|
|||
body { |
|||
-webkit-text-size-adjust: none; |
|||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); |
|||
} |
|||
|
|||
.cursor{ |
|||
cursor: pointer |
|||
} |
@ -0,0 +1,22 @@ |
|||
{{define "nav"}} |
|||
<div class='nav-container'> |
|||
<div class="sui-navbar"> |
|||
<div class="navbar-inner"> |
|||
<a href="/" class="sui-brand">个人随笔</a> |
|||
<ul class="sui-nav"> |
|||
<li {{if .IsHome}}class="active"{{end}}><a href="/">首页</a></li> |
|||
<li {{if .IsNote}}class="active"{{end}}><a href="/note">笔记</a></li> |
|||
<li {{if .IsMap}}class="active"{{end}}><a href="/map">地图</a></li> |
|||
</ul> |
|||
<form class="sui-form sui-form pull-left"> |
|||
<input type="text" placeholder="宝贝/店铺名称..."> |
|||
<button class="sui-btn">搜索</button> |
|||
</form> |
|||
<ul class="sui-nav pull-right"> |
|||
<li><a href="#">个人中心</a></li> |
|||
<li><a href="#">帮助</a></li> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
{{end}} |
@ -1,4 +1,9 @@ |
|||
{{template "header"}} |
|||
|
|||
<title>首页 - 个人随笔</title> |
|||
</head> |
|||
<body> |
|||
<div class='container'> |
|||
{{template "nav" .}} |
|||
</div> |
|||
</body> |
|||
</html> |
@ -0,0 +1,57 @@ |
|||
{{template "header"}} |
|||
<title>谷歌影像图 - 个人随笔</title> |
|||
<script type="text/javascript" |
|||
src="https://webapi.amap.com/maps?v=1.4.10&key=74c9586333eaf8d6191c576cf59739fa"></script> |
|||
<script src="https://webapi.amap.com/ui/1.0/main.js"></script> |
|||
<link type="text/css" rel="styleSheet" href="/static/css/common.css"/> |
|||
<link type="text/css" rel="styleSheet" href="/static/css/map.css" /> |
|||
</head> |
|||
<body> |
|||
{{template "nav" .}} |
|||
<div class="map-root"> |
|||
<div id="map-container" class="map-container"></div> |
|||
</div> |
|||
</body> |
|||
<script> |
|||
var googleLayerimage = new AMap.TileLayer({ |
|||
getTileUrl: 'https://mt{1,2,3,0}.google.cn/maps/vt?lyrs=s@194&hl=zh-CN&gl=cn&x=[x]&y=[y]&z=[z]', |
|||
zIndex: 2 |
|||
}) |
|||
var googleLayervector = new AMap.TileLayer() |
|||
|
|||
// var roadNet = new AMap.TileLayer.RoadNet() |
|||
var mapObj = new AMap.Map('map-container', { |
|||
layers: [googleLayervector, googleLayerimage], |
|||
center: [108.963148, 34.232709], |
|||
zoom: 11 |
|||
}) |
|||
|
|||
var marker = new AMap.Marker({ |
|||
position: new AMap.LngLat(108.963148, 34.232709), |
|||
map: mapObj |
|||
}) |
|||
|
|||
AMap.event.addListener(marker, 'click', function () { |
|||
AMapUI.loadUI(['overlay/SimpleInfoWindow'], function (SimpleInfoWindow) { |
|||
var infoWindow = new SimpleInfoWindow({ |
|||
infoTitle: '<strong>我的位置</strong>', |
|||
infoBody: '<p>我在这里、看我</p>', |
|||
offset: new AMap.Pixel(0, -30), |
|||
autoMove: true |
|||
}) |
|||
infoWindow.open(mapObj, e.target.getPosition()) |
|||
}) |
|||
}) |
|||
|
|||
|
|||
AMapUI.loadUI(['overlay/SimpleInfoWindow'], function (SimpleInfoWindow) { |
|||
var infoWindow = new SimpleInfoWindow({ |
|||
infoTitle: '<strong>我的位置</strong>', |
|||
infoBody: '<p>我在这里、看我</p>', |
|||
offset: new AMap.Pixel(0, -30), |
|||
autoMove: true |
|||
}) |
|||
infoWindow.open(mapObj, new AMap.LngLat(108.963148, 34.232709)) |
|||
}) |
|||
</script> |
|||
</html> |
Loading…
Reference in new issue