Closed derdida closed 8 years ago
You might try just calling the processForm method again, which is public. That processes the form again and then passes everything to the mapping method, which should do what you're wanting.
$('#bh-sl-map-container').data('plugin_storeLocator').processForm();
For filters, the filtering is inclusive by default. So it should work as you are describing it.
Thanks for your answer! When i manually call the processForm() method, there are no values send to my "service" to filter. When ill check in this line:
if(this.getQueryString(this.settings.addressID) || this.getQueryString(this.settings.searchID) || this.getQueryString(this.settings.maxDistanceID)){
It looks like that it only sends the values for Search, MaxDistance and AdressID to the service. And not any filter value. Can i manually edit the JSON Paramters send to service? For example:
User select a custom Filter -> ill call processForm(); and the service checks all my manually added filters (maybe in the function beforeSend) and POST them to the Service (dataLocation) - ill prepare the result and return a list for that filters.
At the moment it looks like that all filters work with javascript.
And for what is the querystringParams? Is that only for the Search, MaxDistance and AdressID Parameters?
Thanks again!
The filtering setup is also a public method and could be called before processForm:
$('#bh-sl-map-container').data('plugin_storeLocator').taxonomyFiltering();
queryStringParams is used for query string URL parameters. You can refer to the options.md file for an explanation of the settings: https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/master/options.md
Thanks again for your answer! So you mean that i am able to send some POST/GET Parameters (for Filtering) to my Service-Url? When ill try (to refresh the map) with:
$('#reload').click(function() {
$('#bh-sl-map-container').data('plugin_storeLocator').taxonomyFiltering();
$('#bh-sl-map-container').data('plugin_storeLocator').processForm();
});
The filter gets called as expected, but no parameters would be send to the server. (Ill check with Firefox, the Script does not attach any POST/GET Values) - I am unable to perform a server-side filtering. So i am not sure if were talking about the same things, but is it possible to perform the filter request on the backend out of the box, or do i need some customization?
So in my case i would like to reload the map with some custom parameters -> Append these parameters as POST/GET to the Ajax request, and the service returns the matching Places/Point of Interessts.
Oh I see, do you have a lot of locations? I guess it depends on what filters you are wanting to add but I'd recommend trying to do it on the front-end instead of server side (assuming you don't have thousands of locations). If you can add the data you're wanting to filter by as new attributes in the data you can filter by them. https://github.com/bjorn2404/jQuery-Store-Locator-Plugin/blob/master/dist/categories-example.html
Otherwise, you'll probably need to modify the _getData method around line 461 and add the additional data values. By default is passes the latitude, longitude and form field input but there are no settings to pass additional parameters.
Hello,
that might be an easy question, but how do i reload my map (in my example ill can change a marker image, and need to reload the map with the new marker image). I could simulate an changed filter, to force an reload - but is there a better solution?
And anoher question: I would like to add some filters, but ill need to combine them. For example:
Filter of Type, and Filter for Priority:
Type could be type1, type2, and type3 - and Priority could be standard or high - now i would like to filter all with are type1 and 2, and priority high. So ill need to need to make filter "groups". Any ideas how to solve that? Can i send some values to the JSON Controller? So that he should return me only that POIs that i want to show?
Thanks in advance for sharing that great plugin!