0

I am working on an OpenLayers 2.10 map using Internet Explorer 8 (used by work), and am encountering some issues with the pan/navigation buttons disappearing after sepcific events:

  1. If I change the layer to another background, the pan/navigation panel buttons lose their picture
  2. If I resize the browser window, the pan/navigation panel buttons lose their picture

When one of these events occurs, the buttons show the broken image link icon. If I refresh the page, the buttons come back.

After perusing some answers, the only similar solutions I came up with were at OpenLayers - redrawing map after container resize using the map.updatesize command. These commands did not seem to work, though I am not entirely sure where to place them. Also, I just started using OpenLayers a couple months ago, and a solution may exist using terminology I am not aware of.

I would like a solution that keeps the pan/navigation/zoom panel buttons constantly displayed, even if layers are changed or if the page is resized. It is also acceptable for the buttons to refresh after an event that will cause the button to no longer load. Thanks in advance for any guidance.

1

I've used a javascript/jquery solution to fix the issue with the navigation buttons disappearing when the window has resized. In the section, I have incorporated the following function:

<script>
    $(window).bind('resize', function(e) 
    {   
        this.location.reload(false); 
    }); 
</script>

The code above was modified from the solution found here.

This still does not refresh the page when a new layer has been selected, but I am looking into using the onFeatureSelect functionality with some of the code mentioned above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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