谷歌地图:将G多段线光标转到指针

时间:2010-12-02 07:06:00

标签: javascript css google-maps

我有一个GPolyline,点击它时会弹出一个信息窗口。我想在悬停时,从手到指针时转动默认光标。有没有办法访问GPolyline风格? 这是我的功能


//add graph to point
function addGraph(data, x, y, color, desc) {
    //get map width and height in lat lon
    var d = map.getBounds().toSpan();
    var height = d.lng();
    var width = d.lat();
    var maxsize = 0.9;
    var pointpair = [];
    var increment = (parseFloat(height) / 10.0) / 100;
    var start = new GPoint(parseFloat(x), parseFloat(y));
    var volume = parseInt((parseFloat(data) * 100) / maxsize);

    pointpair.push(start);
    //draw the graph as an overlay
    pointpair.push(new GPoint(parseFloat(x + increment), parseFloat(y + increment)));
    var line = new GPolyline(pointpair, color, volume);


    var label = new Label(new GLatLng(parseFloat(y), parseFloat(x)), parseInt(data * 100) + "%", "f", new GSize(-15, 0));

    map.addOverlay(label);
    map.addOverlay(line);
    GEvent.addListener(line,'click',function(para)
        {map.openInfoWindowHtml(para,desc )});

}

1 个答案:

答案 0 :(得分:1)

让它运转起来:D

 GEvent.addListener(line, "mouseover", function() {
        $('#map').css("cursor" ,"pointer");
    });