How a script works from V7 to V8

New home Forums Pro Add-on Installing and Updating How a script works from V7 to V8

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #61642
    jmric68
    Member

    Hello
    You wrote me for the V7 a script that displays polylines according to category. the script is placed in custom JS.

    will this script work in v8

    Script:
    jQuery(“body”).on(“change”, “#wpgmza_filter_select”, function() {

    var selectedValue = jQuery(this).find(“:selected”).val();
    var wpgmza_map_id = this.getAttribute(“mid”);
    filter_polygons(wpgmza_map_id,selectedValue);

    });

    function filter_polygons(map_id, cat_id) {

    for(var polygon_id in WPGM_Path)
    {
    var polygon = WPGM_Path[polygon_id];
    var polyid = polygon_id;
    var stroke_color = polygon.strokeColor;

    polygon.setVisible(false);
    if (cat_id == 1 && stroke_color == “#FF0000”) {
    polygon.setVisible(true);
    }else if (cat_id == 2 && stroke_color == “#FFEA30”) {
    polygon.setVisible(true);
    }else if (cat_id == 3 && stroke_color == “#FF9A00”) {
    polygon.setVisible(true);
    }else if (cat_id == 5 && stroke_color == “#C000FA”) {
    polygon.setVisible(true);
    }else if (cat_id == 6 && stroke_color == “#1D00FF”) {
    polygon.setVisible(true);
    }else if (cat_id == 7 && stroke_color == “#00D9FA”) {
    polygon.setVisible(true);
    }else if (cat_id == 8 && stroke_color == “#FF4D00”) {
    polygon.setVisible(true);
    }else if (cat_id == 9 && stroke_color == “#00FF46”) {
    polygon.setVisible(true);
    } else if (cat_id == 0) {
    polygon.setVisible(true);
    }
    }

    }

    thank you for your reply

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.