Google Maps Infobox定位

时间:2014-06-28 05:33:43

标签: jquery google-maps

我正在使用下面有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])

它不起作用?

请帮帮我吗?

0 个答案:

没有答案