我正在使用下面有Array
的Google地图:
drivers = [{
desc: 'teddy johnson | GPS: on <br> tow - light duty wheel lift <br> ETA: 15min ',
lat: 42.366285,
long: -71.135091,
icon: {
url: '../img/map-icon/RCWeb6_8MAP_IMG_InRoute (1).png',
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(16, 24)
},
labelset: [-100, 50]
},
...
...
];}
...
...
Infobox
选项:
var myOptions = {
content: boxa,
disableAutoPan: false,
maxWidth: 0,
//pixelOffset: new google.maps.Size(-100, 50),
pixelOffset: new google.maps.Size(drivers[i].labelset[0],
drivers[i].labelset[1]),
closeBoxURL: "",
zIndex: null,
isHidden: false,
infoBoxClearance: new google.maps.Size(1, 1),
pane: "floatPane",
enableEventPropagation: false
};
我可以使用Infobox
这样控制pixelOffset
位置:
pixelOffset: new google.maps.Size(-100, 50),
但是当我从(-100, 50)
得到Array
这样的值时:
pixelOffset: new google.maps.Size(drivers[i].labelset[0],
drivers[i].labelset[1])
它不起作用?
请帮帮我吗?