divinen
divinen

Reputation: 81

Disable openlayers map rotation

Is it possible to disable several points duplication when rotating map horizontally. For example here https://openlayers.org/en/latest/examples/cluster.html when zoomed out, we can see that there is duplication of the view enter image description here

I actually do not want this, I need to disable that duplication and have so to say "one world", to be able to drag in only "one world". Any suggestions?

Upvotes: 0

Views: 734

Answers (2)

Mike
Mike

Reputation: 17962

wrapX: false needs to be specified for every layer, and even then you can still wrap onto empty space. In OpenLayers 6 it is easier to restrict the view extent to the default projection extent with the option

extent: new View().getProjection().getExtent();

https://codesandbox.io/s/cluster-forked-x73r9

Upvotes: 2

Viglino Jean-Marc
Viglino Jean-Marc

Reputation: 1421

Set wrapX option to false when you create the source to prevent this.

Upvotes: 2

Related Questions