bjorn2404 / jQuery-Store-Locator-Plugin

A store locator plugin using Google Maps API version 3
MIT License
493 stars 235 forks source link

Zoom (bounding box) doesn't work when searching, does work when using `taxonomyFilters`. This seems like a bug? #251

Open mvaneijgen opened 5 years ago

mvaneijgen commented 5 years ago

I've made a video to better explain the problem: https://youtu.be/cmw6H5Ogybk

IMAGE ALT TEXT HERE

Zooming based on the amount of pointers that a filters works when using taxonomyFilters, but doesn't work when just searching. How do I get both to work the same way?

Here is what my code looks like:

var schoolLocator = $("#bh-sl-map-container").storeLocator({
    // Import data
    dataRaw: [{...data}],
    dataType: "json",
    // Google map settingsMap settings
    originMarker: true,
    // Show map on frist load with all markers in zoom
    fullMapStart: true,
    slideMap: true,
    // Extra options
    maxDistance: true,
    // autoGeocode: true, // Auto check where users lives
    distanceAlert: -1,
    distanceErrorAlert: false,
    lengthUnit: 'km',
    // Custom filters
    taxonomyFilters : {
      'onderwijstype' : 'onderwijstype-filter',
    },
    // Disable popup alerts
    callbackNotify: function() {
      console.warn('No results');
    }
  });