none
disable zoom when filtering RRS feed

  • Question

  • We have a filter button, from where we will get pins on bing maps based on filter.
    When we zoom out the map to have a clear overview of locations in map and then if we change filter, map is resetting again. 

    We want the modification of filters must not affect to the zoom selected by the user.

    we are using following snippet to set bounds:

    var bounds = null;
            if (locs.length > 0)
                bounds = Microsoft.Maps.LocationRect.fromLocations(locs);

            map.setView({ bounds: bounds, padding: 25 });

    • Edited by Sai Harika Sunday, February 11, 2018 7:44 AM
    Sunday, February 11, 2018 7:35 AM

Answers

  • The map view will only change when filtering if your filtering code has logic that changes the map view. The map itself doesn’t automatically change the view. Walk through your filtering code and you should see where it is changing the view. The code you provided is likely it. Simply remove it from your filtering code if you don’t want it to change the view.

    [Blog] [twitter] [LinkedIn]

    Monday, February 12, 2018 5:41 PM