Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have an animation where I move a point along a line. At certain spots of that line I open a popup to show a picture. I want the popup to be centered on the point. It seems to work for some points and not for others. Sometimes the popup is centered and sometimes it is just offset off the point. I tried to set that the relative position is "tr", but that did not help(maybe I did it wrong?):

    var popup_point = new OpenLayers.LonLat(fence_point.x,fence_point.y);
    var anchor = {'size': new OpenLayers.Size(0,0), 'offset': new OpenLayers.Pixel(-100, -100)};

    popup = new OpenLayers.Popup.Anchored("fence",
                       popup_point,
                       new OpenLayers.Size(200,200),
                       contentString,
                       anchor,
                       false);

    // popup.autoSize = true;
    map.addPopup(popup);
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.