Subversion Repositories wpShopGermany4

Rev

Rev 5261 | Go to most recent revision | 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) { ?>
        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_URL_WP.'wp-admin/admin.php?page=wpsg-Customer&action=edit&edit_id='.$m['customer']['id']; ?>';
        } );              
        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;">
                        <div style="width:100%; height:100%" id="wpsg_mod_statistics_map"></div>        
                </div>
        </div>
</div>