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 singleTiled layer in OL (using chrome). The layer don't draw completely unless I pan the map slowly to the south (here is example how the layer keep drawing itself each time I pan) :

enter image description here

enter image description here

enter image description here

This is how I create the layer :

var vectors = new OpenLayers.Layer.Vector('vectors', {
    isBaseLayer: false,
    singleTile: true,
    layerName: 'vectors',
    displayInLayerSwitcher: true,
    styleMap: roadsStyleMap
});

Any idea why it happens in chrome only ? (in FF I don't have this problem)

share|improve this question

1 Answer 1

up vote 2 down vote accepted
+100

From glancing at your screen shots, it seems like your whole vector layer is getting clipped at the same horizontal line. I saw this once before and my fix was to change my CSS.

OpenLayers uses SVG for rendering vectors on Chrome (I'm 95% sure). So whatever styles apply to the svg element might affect your vector layers. When I had this problem, I added this to my stylesheet:

svg {
    overflow: visible;
}

Then the problem went away. This seems like a sloppy solution (since it just tells the svg element not to clip at its boundaries), and I never identified why the svg element was sized wrong. But it fixed the problem and I never saw any ill effects.

You might also try using Chrome's developer tools to find your vector layer's svg element and see what size it thinks it is.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.