Closed gerwin123 closed 7 years ago
I Used $(".container").trigger('update', [mapOptions]);
this is my code in Eventhandlers=
eventHandlers: {
click: function (e, id, mapElem, textElem, elemOptions) {
if (typeof elemOptions.myText != 'undefined') {
$('.myText span').html(elemOptions.myText).css({display: 'table'}).fadeIn('slow');
starrating();
$('#sidebar').removeClass('open');
}
}
it works fine but when i change the elemOption.myText by using $(".container").trigger('update', [mapOptions]);
It Uses the Old elemOptions.myText and updating map fails
update trigger also it changes the freq. of the data but the only problem is the EventHandlers
Please send me a modified script to update the EventHandlers just needed it asap. Thank you sir for responding this message.
Hello @Gerwin123, First of all, welcome to GitHub ! I have looked into your issue and it is barely impossible to tell whether the issue comes from the excellent Mapael or from your own code quality and logic. I've noticed the data you get from Advanced filter is now thrown into an alert box. Therefore, I guess you made progress on your problem without creator help.
Also, it's very difficult to understand what blocks you. I'd suggest you first edit your bug report according to the following format:
Information to provide:
General Questions:
Please provide as many screenshots possible, thank you. If you can, please provide a fiddle isolating the issue you're experimenting.
Good luck.
Thanks for your reply sir @adeacetis .. To simplify what i wanted to i will follow the steps you provided: Information to provide: 1.Steps to Reproduce ->To simplify what i wanted to do, just take a look at the example https://rawgit.com/neveldo/jQuery-Mapael/master/examples/advanced/eventHandlers_display_information_about_plotted_cities.html .. I want to update the "myText" element in the json script by using $(".container").trigger('update', [mapOptions]). 2.Expected results ->So for Example whenever the user clicks the button to change "myText" Elements, the text in the displaying container should display differently when the user hover the plots depending on the updated "myText" i wanted to pass using $(".container").trigger('update', [mapOptions]) . 3.Error messages ->There was no error message displaying , but it doesn't only update the myText Elements. 4.Libraries versions ->I dont know to answer this question im only new in developing applications.. Sorry 5.(Web)server details (optional)
General Questions:
1.Do you have an (educated) guess as to the cause of the problem?
->Well my guess to the problem is that no script in jquerymapael.js to update a customize elements like "myText" in every plots/areas
2.Can you suggest a solution?
-> My solution is to have one by modifying this script in jquerymapael.js updateElem: function (elemOptions, elem, animDuration)
but i dont know how to..
I have found a solution to my problem..
Just by setting again the EventHandlers to the updateElem in the script..
if (elemOptions.eventHandlers) self.setEventHandlers(elem.id, elemOptions, elem.mapElem, elem.textElem);
With just a great documentation and coding thats why i can set the code easily.. Thumbs up for Jquery Mapael.. Thank you for the creator/s and contributors.
Hello @gerwin123 ,
Thanks, I'm glad you appreciate jQuery mapael, and thanks for having shared the answer :)
Thanks @adeacetis too for providing help ! :)
Sir, May I know if Event Handlers can also be Updated. As in The Example https://rawgit.com/neveldo/jQuery-Mapael/master/examples/advanced/eventHandlers_display_information_about_plotted_cities.html
I Was trying to update Some of the Contents on the elements so i try to update the whole maps including the 'myText ' in my script but it wasnt been updating.. Tnx for your Response.