2683 |
daniel |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
5866 |
hartmut |
4 |
* Template f�r die Anzeige der Kundenkarte innerhalb des Statistikmoduls
|
2683 |
daniel |
5 |
*/
|
|
|
6 |
|
|
|
7 |
?>
|
|
|
8 |
<script type="text/javascript">/* <![CDATA[ */
|
|
|
9 |
|
|
|
10 |
function wpsg_mod_statistics_initialize()
|
|
|
11 |
{
|
|
|
12 |
|
|
|
13 |
var mapOptions = {
|
|
|
14 |
center: new google.maps.LatLng(-34.397, 150.644),
|
|
|
15 |
zoom: 5,
|
|
|
16 |
mapTypeId: google.maps.MapTypeId.ROADMAP
|
|
|
17 |
};
|
|
|
18 |
|
|
|
19 |
var map = new google.maps.Map(document.getElementById("wpsg_mod_statistics_map"), mapOptions);
|
|
|
20 |
var bounds = new google.maps.LatLngBounds();
|
5866 |
hartmut |
21 |
var markers = [];
|
|
|
22 |
|
2683 |
daniel |
23 |
<?php $i = 1; foreach ($this->view['wpsg_mod_statistics']['marker'] as $m) { ?>
|
|
|
24 |
var marker<?php echo $i; ?> = new google.maps.Marker({
|
5866 |
hartmut |
25 |
position: new google.maps.LatLng(<?php echo $m['lat']; ?>, <?php echo $m['long']; ?>),
|
2683 |
daniel |
26 |
map: map
|
|
|
27 |
} );
|
5866 |
hartmut |
28 |
markers.push(marker<?php echo $i; ?>);
|
|
|
29 |
|
2683 |
daniel |
30 |
google.maps.event.addListener(marker<?php echo $i; ?>, 'click', function() {
|
|
|
31 |
location.href = '<?php echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Customer&action=edit&edit_id='.$m['customer']['id']; ?>';
|
|
|
32 |
} );
|
|
|
33 |
bounds.extend(marker<?php echo $i; ?>.getPosition());
|
|
|
34 |
<?php $i ++; } ?>
|
|
|
35 |
|
|
|
36 |
map.fitBounds(bounds);
|
|
|
37 |
map.setZoom(15);
|
5866 |
hartmut |
38 |
|
|
|
39 |
var markerCluster = new MarkerClusterer(map, markers,
|
|
|
40 |
{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
|
|
|
41 |
|
2683 |
daniel |
42 |
|
|
|
43 |
} // function wpsg_mod_statistics_initialize()
|
|
|
44 |
|
|
|
45 |
google.maps.event.addDomListener(window, 'load', wpsg_mod_statistics_initialize);
|
|
|
46 |
|
|
|
47 |
/* ]]> */</script>
|
|
|
48 |
|
|
|
49 |
<div style="" id="wpsg_mod_customermap_layer">
|
|
|
50 |
<div class="postbox" id="wpsg_modcustomermap">
|
|
|
51 |
<div style="height:500px;">
|
|
|
52 |
<div style="width:100%; height:100%" id="wpsg_mod_statistics_map"></div>
|
|
|
53 |
</div>
|
|
|
54 |
</div>
|
|
|
55 |
</div>
|