neveldo / jQuery-Mapael

jQuery plugin based on raphael.js that allows you to display dynamic vector maps
https://www.vincentbroute.fr/mapael/
MIT License
1.01k stars 195 forks source link

functions inside mapael options #400

Open SoBerry29 opened 5 years ago

SoBerry29 commented 5 years ago

Hi i'm new using mapael, I have a question or issue, i'm trying to make the css Class property dinamic according to a flag in a DB in mysql to make to area clickable or not besides change the color to show if the area is available or not, i don't know if there is a way i can make CSSCLASS dinamic by the response of an ajax function

here is an example of my code

function check:(id){
    var param ={id:id}
$.ajax({
    data:param,
    url: "get_available.php",
    type: "POST",        
    success: function (result) {             
        return result

    },
    error: function (result) {
        alert("error");
    }
});
}

areas:{ "country-5": { href: "javascript:void(0)",
eventHandlers: { click: function(e, id, mapElem) {ver_modal(id)} },
cssClass:check(5) }, }