duheng
2025-04-03 82f8a7ead37ff50dec3d0d40e572d4331f14a8b2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 
(function ($) {
 
    $(".button_select").on("click", function () {
        var jq_btn = $(this);
        if (jq_btn.attr("target") == "true") {
            jq_btn.next().hide();
            jq_btn.attr("target", "false");
        } else {
            jq_btn.next().show();
            jq_btn.attr("target", "true");
        }
    });
 
    $(".top_menu").mouseleave(function () {
 
        $(this).children("ul").hide();
        $(this).children("button").attr("target", "false");
    });
 
    $(".top_menu").find("input").each(function () {
 
        $(this).on("change", function () {
 
            var data = [];
            $(".top_menu").find("input").each(function () {
                var Visible = $(this).is(':checked');
                var Type = $(this).attr("name");
                data.push({
                    Visible: Visible,
                    Type: Type
                });
            })
            setDisplayStyle(data);
        });
    })
 
        //设置地图显示样式 
    function setDisplayStyle(data) {
        var features = [];
        for (var i = 0; i < data.length; i++) {
 
            if (data[i].Visible === true) {
                features.push(data[i].Type);
            }
        }
        _map.setFeatures(features);
    }
 
 
})(jQuery);