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

overview map is not so intuitive #8836

Closed
kuige opened this issue Oct 18, 2018 · 8 comments

Comments

Projects
None yet
3 participants
@kuige
Copy link

commented Oct 18, 2018

First, please take a look at this example, I think it's better than OpenLayers's current overview map.

https://openseadragon.github.io/examples/ui-viewport-navigator/

In this example, the background of the overview map won't change or resize when panning or zooming in the map, it's always the thumbnail of the whole map, and I can quickly and intuitively navigate to any position, which makes it much clear and easy to understand. Plus, when dragging the rectangle box, the viewport of the map changes in real time, which results in a better experience.

So, I think OpenLayers's overview map should behave like the example above, at least adding an option for it.

@ahocevar

This comment has been minimized.

Copy link
Member

commented Oct 18, 2018

You can configure ol/control/OverviewMap with a custom view already. If you create a view with resolutions set to an array with a single entry, you'll get the desired behavior.

@ahocevar ahocevar closed this Oct 18, 2018

@kuige

This comment has been minimized.

Copy link
Author

commented Oct 22, 2018

@ahocevar Hi, ahocevar, I have set the overview map with the resolutions parameter,

new OverviewMap({
    collapsed: false,
    view: new View({
       resolutions: [ view.getMaxResolution() ]
    })
 })

When I panning or zooming the map, the overview map is no longer resized, however, its position still changed. Did I miss something?

@cs09g

This comment has been minimized.

Copy link
Contributor

commented Oct 22, 2018

as the example you linked, overview map is not resizable and not movable. only the square on the overview map moves as you drag the map. when you do not modify ol.css or use className for ol-overviewmap size, the overview map will be moved because map is bigger than its container.

@kuige

This comment has been minimized.

Copy link
Author

commented Oct 23, 2018

I think the overview map should automatically be contained in its container, no matter what the dimensions of container are, just like css background size, background-size: contain, so the overview map will never 'overflow' its container.

I have set the width and height of the container much bigger than the overview map using css, however, the position of the overview map still can't be locked.

@ahocevar

This comment has been minimized.

Copy link
Member

commented Oct 23, 2018

What if you also configure the view's extent with the center of your map as both bottom left and top right, e.g. extent: [0, 0, 0, 0]?

@kuige

This comment has been minimized.

Copy link
Author

commented Oct 24, 2018

I have set the extent and resolutions parameters of the overview map, but it's still not working.

Here is the demo: https://jsfiddle.net/sangelee/kd40t5va/

@cs09g

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2018

extent doesn't work for overviewmap though. seems to be fixed? https://jsfiddle.net/kd40t5va/15/

@ahocevar

This comment has been minimized.

Copy link
Member

commented Oct 24, 2018

The right way to fix this would be an option to restrict the view to an extent, as attempted in #2777 and #7062. Unfortunately both pull requests were incomplete and are now outdated. But if anyone wants to take a stab, a pull request for that would still be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.