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'm using OpenLayers.Geometry.Polygon.createRegularPolygon to generate some nice circles. After i draw them to the Map i'm Moving them and after some while they where hiding by some tiles. The circle zIndex is higher then the tiles zIndex so there is no problem (hopefully).

I'm using Openlayers Version: Release 2.13

Here is some code i'm using:

var circle = OpenLayers.Geometry.Polygon.createRegularPolygon(
    point,
    rad,
    200,
    0
);
var style = {
    fillColor: '#ea2828',
    strokeColor: '#ea2828',
    strokeOpacity: 1,
    strokeWidth: 4,
    graphicZIndex: 1099,
    fillOpacity: 0
};
var featureInner = new OpenLayers.Feature.Vector(circle, null, style);
layer.addFeatures(featureInner);

when i want to set the new point im using:

layer.removeAllFeatures();

to remove the old circle and then i put it with the code from above again on the layer.

Every time i zoom into the map where i can't see the circle and move to the circle postion i can't see the circle. The Magic at this point is that i can use the controlls hide layer and activate it again and wow the circle is back.

I hope you have a idea for a fix.

Best regards

share|improve this question
    
Did you try redrawing the layer after add features? –  Mingfeng Jul 8 '13 at 12:42
    
Yes it is working :) Thx –  Hackbard Jul 8 '13 at 12:53
    
Glad it helps :) –  Mingfeng Jul 8 '13 at 12:59
    
if you answer it, i can get u some +1 :P –  Hackbard Jul 8 '13 at 13:10

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.