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

Map Recenters on Wrong Place after Selection #73

Open
nheick opened this issue Mar 29, 2017 · 0 comments
Open

Map Recenters on Wrong Place after Selection #73

nheick opened this issue Mar 29, 2017 · 0 comments

Comments

@nheick
Copy link

nheick commented Mar 29, 2017

When selecting a new place on the map after a place has been selected from the map, the tile panel, or the detail panel, the map will inconsistently recenter on the previous selection, the point for the next slide after the previous selection, and sometimes the current selection. This only occurs when zoomed in to the point where not all the features are displayed. I've traced the issue back to the following function in DetailPanel.js:

this.showDetails = function (selected) {
    ...
    prepSwiperDisplay();

This appears to cause the detail panel to advance to the next slide and return to the current slide. With the selection on top of that, the active slide changes three times. Each slide change then creates multiple events including the onSlideChangeEnd event. These events trigger the onSlideChangeEnd event handler assigned in the buildSlides function:

newSwiper.on('onSlideChangeEnd', function (swiper) {
    ...
    if (_mainView.selected && !app.map.extent.contains(_mainView.selected.geometry) && ! app.data.getWebAppData().getGeneralOptions().filterByExtent || app.isInBuilder) {
        app.map.centerAt(_mainView.selected.geometry);
        }
    }
    ...

Therefore, the map pans once for each of the three features that aren't in the current extent. The current extent also changes after each pan. On top of that, these pans are not necessarily in the order the active slide changes. This means that the map might pan multiple times very quickly, sometimes showing other areas altogether, before stopping at one of these three locations.

Removing the call to prepSwiperDisplay() eliminates the issue along with the detail panel hiding and reappearing in a flash. It does cause a new issue, which is that when you click on a point on the map for the first time, the detail panel starts on your first slide and then takes a noticeable while to switch to the selected slide. Also, setting a timeout on the map recentering fixes the problem, but it doesn't seem to be the best solution.

I am using IE 11 and the Shortlist 2.1.0 app.

Thanks,
Nathan

@nheick nheick changed the title Panning Around Map and Clicking on Places Causes Recenter on Previous Selection Map Recenters on Wrong Place after Selection Mar 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant