Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Drawing Feature when Pan map to whole world #16544

Open
MShewals opened this issue Jan 12, 2025 · 1 comment
Open

Issue with Drawing Feature when Pan map to whole world #16544

MShewals opened this issue Jan 12, 2025 · 1 comment
Labels

Comments

@MShewals
Copy link

When I draw feature, zoom In and Pan map to whole world. There is issue , I can not redraw feature.

To Reproduce
Steps to reproduce the behavior:

  1. Zoom in to zoom level 10 and draw feature.
  2. Pan map to whole world and come back to drawn feature
  3. Draw again and feature will not be drawn.

Expected behavior
I should be able to redraw feature

image

@MShewals MShewals added the bug label Jan 12, 2025
@ahocevar
Copy link
Member

This is a limitation we had to make to avoid issues with "date line wrapping". My recommendation is to configure your map's view with an extent to avoid panning around the globe:

import View from 'ol/View.js';
import { get as getProjection } from 'ol/proj.js';

new View({
  extent: getProjection('EPSG:3857').getExtent(),
  center: [0, 0],
  zoom: 2
});

If you need to edit features in an area around the date line, use a local projection suitable for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants