question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to change View center without triggering layer requests

See original GitHub issue

Is your feature request related to a problem? Please describe. Hi, I’d like to know if it is possible to change a View center without automatically triggering layer requests (WMS, WMTS…). I have tried map.getView().set('center', [ lon, lat], true); using the opt_silent parameter but the view is not moving at all.

Describe the solution you’d like In OL2 you could use setCenter on a Map object with the dragging parameter set to false. Is there any equivalent in OL6? Thanks.

setCenter: function(	lonlat,
zoom,
dragging, // {Boolean} Specifies whether or not to trigger movestart/end events
forceZoomChange	)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ahocevarcommented, Apr 20, 2022

@nboisteault What @mike-000 said only applies to tile layers. In your case the layer is an image layer, which usually does not load new images during panning. You can see that in https://openlayers.org/en/latest/examples/wms-image.html. I’m surprised to see the requests in your example. Looks like you might have some custom loading behavior that triggers this.

0reactions
mike-000commented, Apr 20, 2022

@nboisteault What @mike-000 said only applies to tile layers. In your case the layer is an image layer, which usually does not load new images during panning. You can see that in https://openlayers.org/en/latest/examples/wms-image.html. I’m surprised to see the requests in your example. Looks like you might have some custom loading behavior that triggers this.

Yes. a standard ImageWMS source behaves in a similar way to the previous vector source with bbox strategy example when an animating state is maintained https://codesandbox.io/s/wms-image-forked-k7xcjz?file=/main.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenLayers v7.2.2 API - Class: View
A View object represents a simple 2D view of the map. This is the object to act upon to change the center, resolution,...
Read more >
Configuring CC and follower permissions - Zendesk help
In Admin Center, click Objects and rules in the sidebar, then select Tickets > Settings. In the CCs and followers section, select the...
Read more >
MapView | API Reference | ArcGIS Maps SDK for JavaScript ...
To render a map and its layers in 3D, see the documentation for SceneView. ... Represents the view's center point; when setting the...
Read more >
Triggering click event on Leaflet map? - GIS Stack Exchange
One approach that I have tried (and which works) is to identify the object in the leaflet layer and to trigger a click...
Read more >
Adding Interactivity - deck.gl
Controlling the Camera. Out of the box, deck.gl offers viewport controllers that map keyboard, mouse or touch input to camera state change. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found