Subversion Repositories wpShopGermany4

Rev

Rev 7612 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

        /**
         * Template f�r die Anzeige der Kundenkarte innerhalb des Statistikmoduls
         */
 
?> 
<script type="text/javascript">/* <![CDATA[ */
        
        function wpsg_mod_statistics_initialize() 
        {
                
        var mapOptions = {
                center: new google.maps.LatLng(-34.397, 150.644),
                zoom: 5,
                mapTypeId: google.maps.MapTypeId.ROADMAP
        };

        var map = new google.maps.Map(document.getElementById("wpsg_mod_statistics_map"), mapOptions);
        var bounds = new google.maps.LatLngBounds();
        var markers = [];
        
        <?php $i = 1; foreach ($this->view['wpsg_mod_statistics']['marker'] as $m) { 
            
            if (floatval($m['lat']) === 0.0 || floatval($m['long']) === 0.0) continue;
            
            ?>
        var marker<?php echo $i; ?> = new google.maps.Marker({
                        position: new google.maps.LatLng(<?php echo $m['lat']; ?>, <?php echo $m['long']; ?>),
                        map: map
        } );            
        markers.push(marker<?php echo $i; ?>);

        google.maps.event.addListener(marker<?php echo $i; ?>, 'click', function() {
                        location.href = '<?php
                        
                                echo wpsg_admin_url('Customer', 'edit', ['edit_id' => $m['customer']['id']], [], true);
                                
                        ?>';
        } );              
        bounds.extend(marker<?php echo $i; ?>.getPosition());   
        <?php $i ++; } ?>

        map.fitBounds(bounds);
        map.setZoom(15);

        var markerCluster = new MarkerClusterer(map, markers,
                {imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
                
        
        } // function wpsg_mod_statistics_initialize() 

        google.maps.event.addDomListener(window, 'load', wpsg_mod_statistics_initialize);
 
/* ]]> */</script>

<div style="" id="wpsg_mod_customermap_layer">
        <div class="postbox" id="wpsg_modcustomermap">
                <div style="height:500px; width:500px;">
                        <div style="width:100%; height:100%" id="wpsg_mod_statistics_map"></div>        
                </div>
        </div>
</div>