日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

自定义地图怎么做成html,自定义html为谷歌地图制作标记

發布時間:2023/12/4 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 自定义地图怎么做成html,自定义html为谷歌地图制作标记 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

好吧,似乎Custom Overlays會做我想要的。這是ping層:

function PingLayer(bounds, map) {

this.bounds = bounds;

this.setMap(map);

}

PingLayer.prototype = new google.maps.OverlayView();

PingLayer.prototype.onAdd = function() {

var div = document.createElement('DIV');

div.className = "ping";

this.getPanes().overlayLayer.appendChild(div);

div.appendChild(document.createElement("DIV"))

this.div = div;

setTimeout(function(){div.className += " startPing"}, 10);

}

PingLayer.prototype.draw = function() {

var overlayProjection = this.getProjection();

var sw = overlayProjection.fromLatLngToDivPixel(this.bounds.getSouthWest());

var ne = overlayProjection.fromLatLngToDivPixel(this.bounds.getNorthEast());

var div = this.div;

div.style.left = sw.x - 60 + 'px';

div.style.top = ne.y - 65 + 'px';

}這是將em添加到地圖的方法:

var swBound = new google.maps.LatLng(lat, lng);

var neBound = new google.maps.LatLng(lat, lng);

var bounds = new google.maps.LatLngBounds(swBound, neBound);

new PingLayer(bounds, map);這是做動畫的CSS:

.ping {

position: absolute;

width: 100px;

height: 100px;

}

.ping div {

top: 50px;

left: 50px;

position: relative;

width: 10px;

height: 10px;

border-radius: 50%;

-moz-border-radius: 50%;

-webkit-border-radius: 50%;

background: none;

border: solid 5px #000;

text-align: center;

font-size: 20px;

color: #fff;

-moz-transition-property: width, height, top, left, opacity;

-moz-transition-duration: 2s;

}

.ping.startPing div{

width: 100px;

height: 100px;

top: 0;

left: 0;

opacity: 0;

-moz-transition-duration: 2s;

}

總結

以上是生活随笔為你收集整理的自定义地图怎么做成html,自定义html为谷歌地图制作标记的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。