I have an application which has to perform a HTTP request (which will handle some map transformations) before fetching WMS tiles from server.

Is there a way to pause TileWMS auto-refreshing after dragging the map?

Setting invisible or removing and adding the layer will work, but I don't want the layer to disappear while performing the HTTP request. I also tried setUrl('') but the layer will also disappear.

I also tried to read OpenLayers source code to define a property to be checked before performing the requests but I couldn't find in code where the requests are made.

  • Which version of Openlayers are you use? – winsent Dec 12 '15 at 21:44
  • Not bound to any specific version, it is a new app. If you know the answer for any specific version I'll be glad to see your solution. Even if it is in OpenLayers 2. – caiohamamura Dec 13 '15 at 14:58
  • you could try just telling the user there is a process going on. start a "processing graphic" or something and when the map bits load, hide the graphic when it finishes. A quick search found this: gis.stackexchange.com/questions/123497/… – user1269942 Jan 24 '17 at 19:03
  • This will go against my requirements of giving a sense of fluidity in the application, I don't want anything to appear or disappear, just the tiles being replaced smoothly with the new ones and not for every drag of the map appear a message of "loading..." or displaying a blank map while new tiles load. – caiohamamura Jan 24 '17 at 19:18

I found some documents that may be able to assist you.

In the source code, Line 167 there is the refresh line.

I found documentation for OL2 that goes into more detail. You may be able to use this as a reference for your application.

The latest API Docs for OpenLayers will be your best bet. You will need to change the option from the default of silent.

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.