如何制作永久性标记在openlayers中显示弹出窗口?

时间:2013-03-27 22:29:38

标签: javascript openlayers openstreetmap

下午好,我正在通过弹出窗口向OpenLayers添加书签,但我想让这个标记始终处于活动状态,而不是隐藏在其中,并且没有必要点击显示。

    // popup successful, but the click event is on
    marker.events.register("click", marker, function(e){
        popup = new OpenLayers.Popup.FramedCloud(data.idunidad,
            marker.lonlat,
            new OpenLayers.Size(200,200),
            '<p>Info HTML</p>',
            null,true);
        mapa.addPopup(popup);
    });

没有鼠标事件的弹出

    // popup without mouse event
    popup = new OpenLayers.Popup.FramedCloud(data.idunidad,
        marker.lonlat,
        new OpenLayers.Size(200,200),
        '<p>Info HTML</p>',
        null,true);
    mapa.addPopup(popup);

在后者中我得到一个错误:未捕获的TypeError:无法读取属性'x'的null

我该怎么办?

0 个答案:

没有答案