This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

feature and popup

0

Hi, I'm trying to use feature, marker and popup but cannot access the popup properties.

    var feature = new OpenLayers.Feature(markers, lonLat); 
feature.closeBox = false;
feature.popupClass = OpenLayers.Class(OpenLayers.Popup.Anchored, {
        'autoSize': true
    });
feature.data.popupContentHTML = infoWindow;

How do I get access to 'backgroundColor' for example? Thanks :)

asked 22 Mar '12, 13:05

lowfreq78's gravatar image

lowfreq78
11112
accept rate: 0%

edited 22 Mar '12, 15:50

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866


One Answer:

0

What do you mean by "access"?

If you want only set the value of the "backgroundColor" properties, you can simply add it with the "autosize", ie:

feature.popupClass = OpenLayers.Class(OpenLayers.Popup.Anchored, {
    'autoSize': true,'backgroundColor'='#aaccee';
});

answered 26 Mar '12, 13:22

NicolasDumoulin's gravatar image

NicolasDumoulin
3.3k42256
accept rate: 13%

Source code available on GitHub .