<?php $__env->startSection('contenido'); ?>
<style>
    #map {
        min-height: 600px;
    }

</style>
<div class="content">
    <div class="row">
        <div class="col-md-6">
            <!-- Simple list -->
            <div class="card">
                <div class="card-header header-elements-inline">
                    <h5 class="card-title">STATUS VISITADORES</h5>
                    <div class="header-elements">
                        <div class="list-icons">
                            <a class="list-icons-item" data-action="collapse"></a>
                        </div>
                    </div>
                </div>

                <div class="card-body">
                    <ul class="media-list listaAPM">
                        <!-- <li class="media font-weight-semibold py-1">ALFA</li> -->
                        <?php $__currentLoopData = $apms; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $apm): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li class="media">
                            <div class="media-body">
                                <div class="media-title font-weight-semibold">
                                    <?php echo e($apm['primer_nombre']); ?> <?php echo e($apm['segundo_nombre']); ?> <?php echo e($apm['primer_apellido']); ?> <?php echo e($apm['segundo_apellido']); ?>

                                </div>
                                <span class="text-muted"><?php echo e($apm->linea['descripcion_linea']); ?></span>
                            </div>

                            <div class="align-self-center ml-3">
                                <div class="list-icons list-icons-extended">
                                    <!-- border-danger -->
                                    <?php if($apm->status): ?>
                                        <span class="badge badge-mark border-success"></span>
                                    <?php else: ?>
                                        <span class="badge badge-mark border-danger"></span>
                                    <?php endif; ?>

                                    <span class="text-success">
                                        <?php if(@$socios->id_apm==$apm['id_user']): ?>
                                            <i data-logitud="<?php echo e($socios->coordenada_log); ?>" data-latiud="<?php echo e($socios->coordenada_lat); ?>" data-nombre="<?php echo e($socios->primer_nombre_socio); ?> <?php echo e($socios->primer_apellido_socio); ?>" class="mapaUbicacion icon-pin-alt font-size-base mr-1"></i>
                                        <?php endif; ?>
                                    </span>
                                </div>
                            </div>
                        </li>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </ul>
                </div>
            </div>
            <!-- /simple list -->

        </div>
        <div class="col-md-6">
            <div id="map"></div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('javascript'); ?>
<script
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBsmICYP3n5S2U6HCoAT_Phxe2AUqAcivI&callback=initMap&libraries=&v=weekly"
async
></script>
<script>
    function initMap() {
        const myLatlng = { lat: 14.58276, lng: -90.5773056 };
        const map = new google.maps.Map(document.getElementById("map"), {
            zoom: 10,
            center: myLatlng,
        });
        // Create the initial InfoWindow.
        // Configure the click listener.

    }

    jQuery( document ).ready(function() {
        $('.mapaUbicacion').on('click',function(){
            var ln=parseFloat($(this).attr('data-logitud'));
            var lt=parseFloat($(this).attr('data-latiud'));
            var n=$(this).attr('data-nombre');
            const myLatlng = { lat: lt, lng: ln };
            const map = new google.maps.Map(document.getElementById("map"), {
                zoom: 10,
                center: myLatlng,
            });
            // Create the initial InfoWindow.
            let infoWindow = new google.maps.InfoWindow({
                content: 'Socio: '+n,
                position: myLatlng,
            });
            infoWindow.open(map);
            // Configure the click listener.
            map.addListener("click", (mapsMouseEvent) => {
                // Close the current InfoWindow.
                infoWindow.close();
                // Create a new InfoWindow.
                infoWindow = new google.maps.InfoWindow({
                position: mapsMouseEvent.latLng,
                });
                infoWindow.setContent(
                JSON.stringify(mapsMouseEvent.latLng.toJSON(), null, 2)
                );
                infoWindow.open(map);
            });
        })
    });
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.index', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\jarvis\resources\views/dashboard/gerente_linea.blade.php ENDPATH**/ ?>