bjorn2404 / jQuery-Store-Locator-Plugin

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

refresh mapping on update sku #171

Closed dennisbaum closed 7 years ago

dennisbaum commented 7 years ago

hi,

i can view all my products in stores around the entered city. so far so good! i also like to view my stores, in the same city, for a selected product in a select element. the value is the sku.

so i add a new method inside the jquery.storelocator:

updateSku(value)
  this.settings.sku = value;
  this.processForm();
}

call it from outside at the event-handler of the select-field:

...
$('#sku').change(
  var sku = $(this).val();
  if(sku === 'all') {
    sku = null;
  }
  $element.storeLocator('updateSku', sku);
});
...

the sku is updated and the processForm is running, but if i dont change the city, the mapping will not reload the data and so not dating up the markers correctly. if i change the city and submit the form, the new sku is taking place and updating the map.

how can i achive the update of the map on not changing the city? can i reset the origin values or something? i don't understand exactly the conditions in the mapping method. i think it should reload the data with getData, but it wont - if the city has not changed.

so any advice is very welcome. tnx

bjorn2404 commented 7 years ago

@dennisbaum Have you looked at the taxonomyFilters setting? Code example is here and you can see that code demo here. I think that would cover what you're trying to do.