This commit is contained in:
Walter Hupfeld
2023-10-06 12:01:06 +02:00
3 changed files with 54 additions and 75 deletions

View File

@@ -225,6 +225,7 @@
<script>
// Map ----------------------------------------------------------------------
var mymap = L.map('mapid').setView([<?=$numInfoLat ?>, <?=$numInfoLng ?>], <?=$numZoom ?>);
var mapLink = '<a href="http://openstreetmap.org">OpenStreetMap</a>';
@@ -307,8 +308,6 @@
$('.check').click(function() {
filter = this.name;
console.log(filter);
if (jQuery(this).prop("checked")) {
jQuery.each(marker, function(key, value) {
if (value) {
@@ -326,7 +325,6 @@
function check_all(){
jQuery.each(marker, function(key, value) {
console.log(value);
if (value) { value[0].addTo(mymap); }
});
};
@@ -334,56 +332,39 @@
function uncheck_all()
{
jQuery.each(marker, function(key, value) {
console.log(value);
if (value) { value[0].remove(); }
});
};
$('#check_art').click(function(){
if (jQuery(this).prop("checked")) {
$('.uart').prop( "checked", true );
check_all();
} else {
$('.uart').prop( "checked", false );
uncheck_all();
}
});
$('#check_kat').click(function(){
console.log("test");
if (jQuery(this).prop("checked")) {
$('.ukat').prop( "checked", true );
check_all();
} else {
$('.ukat').prop( "checked", false );
uncheck_all();
}
});
$('#check_typ').click(function(){
if (jQuery(this).prop("checked")) {
$('.utyp').prop( "checked", true );
check_all();
} else {
$('.utyp').prop( "checked", false );
uncheck_all();
}
});
$('#check_art').click(function(){
if (jQuery(this).prop("checked")) {
$('.uart').prop( "checked", true );
check_all();
} else {
$('.uart').prop( "checked", false );
uncheck_all();
}
});
$('input[type=radio][name=kategorie]').on('change', function() {
$('.td_ubet').hide();
$('.td_utyp').hide();
$('.td_uart').hide();
$('.td_ukat').hide();
check_all();
$("input[type=checkbox]").prop('checked', $(this).prop('checked'));
switch ($(this).val()) {
case 'UART':
$('.td_uart').show();
break;
case 'UKAT':
$('.td_ukat').show();
break;
case 'UTYP':
$('.td_utyp').show();
break;
case 'UBET':
$('.td_ubet').show();
$('.veh_<?=$numVehicle?>').hide();
break;
}
});
$('.td_ubet').hide();
$('.td_utyp').hide();
$('.td_uart').hide();
$('.td_ukat').show();
$('input:radio[name=kategorie]').val(['UKAT']);
</script>
</body>
</html>