我正在尝试实现一个自定义的infoBubble,其中的框打开到标记的一侧而不是顶部的默认位置.事实证明这比预期更难.
使用普通的infoWindow,您可以使用pixelOffset.请参阅此处获取文档
使用infoBubble似乎并非如此.无论如何在infoBubble中使用pixelOffset,还是会做同样的事情?
我发现这很难搜索,因为使用Google这样的搜索会返回Google搜索没有相关结果
以下是我一直使用的所有资源.
现在我的javascript就在这里jsfiddle链接被破坏了.
<script type="text/javascript">
$(document).ready(function () {
init();
});
function init() {
//Setup the map
var googleMapOptions = {
center: new google.maps.LatLng(53.5167, -1.1333),
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
//Start the map
var map = new google.maps.Map(document.getElementById("map_canvas"),
googleMapOptions);
var marker = new google.maps.Marker({
position: new google.maps.LatLng(53.5267, -1.1333),
title: "Just a test"
});
marker.setMap(map);
infoBubble = new InfoBubble({
map: map,
content: '<div class="phoneytext">Some label</div>',
//position: new google.maps.LatLng(-35, 151),
shadowStyle: …Run Code Online (Sandbox Code Playgroud)