When the page loads fully it starts a function, I would like that when clicking a button that same function would initialize again passing a text as Query String
. I have the code:
$(document).ready(function() {
function initMapplic(title){
var mapplic = $('#mapplic').mapplic({
source: '<?php echo base_url();?>assets/plugins/mapplic2/server.php?title='+title, // Using mall.json file as map data
sidebar: false, // Enable sidebar
developer:true,
minimap: false, // Enable minimap
markers: true, // Disable markers
fillcolor: true, // Disable default fill color
fullscreen: true, // Enable fullscreen
maxscale: 3 // Setting maxscale to 3
});
}
initMapplic('');
$("#searchfilters").on('click',function(){
initMapplic('apertou');
});
});
It starts normally, but when I click the button it does not appear to refresh by passing the text pressed as I would like.