Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2.     ///////////////////////////////////////////////////////////////////
  3.     // Powered By MapsEasy.com Maps Generator                        
  4.     // Please keep the author information as long as the maps in use.
  5.     // You can find the free service at: http://www.MapsEasy.com    
  6.     ///////////////////////////////////////////////////////////////////
  7.     function LoadGmaps() {
  8.         var myLatlng = new google.maps.LatLng(<?=$this->initialCoordinates?>);
  9.         var myOptions = {
  10.             zoom: 16,
  11.             center: myLatlng,
  12.             disableDefaultUI: true,
  13.             panControl: true,
  14.             zoomControl: true,
  15.             zoomControlOptions: {
  16.                 style: google.maps.ZoomControlStyle.DEFAULT
  17.             },
  18.  
  19.             mapTypeControl: false,
  20.             streetViewControl: false,
  21.             mapTypeId: google.maps.MapTypeId.ROADMAP
  22.             }
  23.         var map = new google.maps.Map(document.getElementById("MyGmaps"), myOptions);
  24.                
  25.                 <?php foreach($this->devices as $d): ?>
  26.                    
  27.                     var m<?=$d->id ?> = new google.maps.Marker({
  28.                             position:  new google.maps.LatLng(<?=$d->map_position?>),
  29.                             map: map,
  30.                             title:<?='"'.$d->ssid.'"'?>
  31. //                            icon: 'markerIcon',
  32.                          
  33.                     });
  34.                    
  35.                      var iw<?=$d->id ?> = new google.maps.InfoWindow({
  36.                         content: <?='"'.$d->ssid.'"'?>
  37.                     });
  38.                    
  39.                 google.maps.event.addListener(m<?=$d->id ?>, "click", function (e) { iw<?=$d->id ?>.open(map, m<?=$d->id ?>); });
  40.                 <?php endforeach; ?>
  41.     }
  42. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement