|
(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);
|