Вход Регистрация
Файл: assets/plugins/markerclusterer/1.0.1/examples/advanced_example.html
Строк: 176
<?php
<!DOCTYPE>
<
html>
  <
head>
    <
meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <
title>MarkerClusterer v3 Example</title>

    <
style type="text/css">
      
body {
        
margin0;
        
padding10px 20px 20px;
        
font-familyArial;
        
font-size16px;
      }

      
#map-container {
        
padding6px;
        
border-width1px;
        
border-stylesolid;
        
border-color#ccc #ccc #999 #ccc;
        
-webkit-box-shadowrgba(6464640.50 2px 5px;
        -
moz-box-shadowrgba(6464640.50 2px 5px;
        
box-shadowrgba(6464640.10 2px 5px;
        
width800px;
      }

      
#map {
        
width800px;
        
height400px;
      }

      
#actions {
        
list-stylenone;
        
padding0;
      }

      
#inline-actions {
        
padding-top10px;
      }

      .
item {
        
margin-left20px;
      }
    </
style>
    
    <
script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <
script src="../src/data.json" type="text/javascript"></script>
    <
script type="text/javascript">
      var 
script '<script type="text/javascript" src="../src/markerclusterer';
      if (
document.location.search.indexOf('compiled') !== -1) {
        
script += '_compiled';
      }
      
script += '.js"><' '/script>';
      
document.write(script);
    </
script>

    <
script type="text/javascript">
      var 
styles = [[{
        
url'../images/people35.png',
        
height35,
        
width35,
        
anchor: [160],
        
textColor'#ff00ff',
        
textSize10
      
}, {
        
url'../images/people45.png',
        
height45,
        
width45,
        
anchor: [240],
        
textColor'#ff0000',
        
textSize11
      
}, {
        
url'../images/people55.png',
        
height55,
        
width55,
        
anchor: [320],
        
textColor'#ffffff',
        
textSize12
      
}], [{
        
url'../images/conv30.png',
        
height27,
        
width30,
        
anchor: [30],
        
textColor'#ff00ff',
        
textSize10
      
}, {
        
url'../images/conv40.png',
        
height36,
        
width40,
        
anchor: [60],
        
textColor'#ff0000',
        
textSize11
      
}, {
        
url'../images/conv50.png',
        
width50,
        
height45,
        
anchor: [80],
        
textSize12
      
}], [{
        
url'../images/heart30.png',
        
height26,
        
width30,
        
anchor: [40],
        
textColor'#ff00ff',
        
textSize10
      
}, {
        
url'../images/heart40.png',
        
height35,
        
width40,
        
anchor: [80],
        
textColor'#ff0000',
        
textSize11
      
}, {
        
url'../images/heart50.png',
        
width50,
        
height44,
        
anchor: [120],
        
textSize12
      
}]];

      var 
markerClusterer null;
      var 
map null;
      var 
imageUrl 'http://chart.apis.google.com/chart?cht=mm&chs=24x32&' +
          
'chco=FFFFFF,008CFF,000000&ext=.png';

      function 
refreshMap() {
        if (
markerClusterer) {
          
markerClusterer.clearMarkers();
        }

        var 
markers = [];
        var 
infowindow = new google.maps.InfoWindow();
        var 
markerImage = new google.maps.MarkerImage(imageUrl,
          new 
google.maps.Size(2432));

        for (var 
01000; ++i) {
        
        var 
content =   '<div class="infowindow"><b><a href="'data.photos[i].photo_file_url +'">'  data.photos[i].photo_title '</a></b>'
        
'<br />'     data.photos[i].owner_name ' ' 
        
'<p><i>'     data.photos[i].upload_date '</i></p></div>';        
          var 
latLng = new google.maps.LatLng(data.photos[i].latitude,
              
data.photos[i].longitude)
          var 
marker = new google.maps.Marker({
           
positionlatLng,
           
draggabletrue,
           
iconmarkerImage
          
});
          
        
google.maps.event.addListener(marker'click', function() {  
            
infowindow.setContent(content);
            
infowindow.open(mapmarker); 
        });
          
markers.push(marker);
          
          
        }

        var 
zoom parseInt(document.getElementById('zoom').value10);
        var 
size parseInt(document.getElementById('size').value10);
        var 
style parseInt(document.getElementById('style').value10);
        
zoom zoom == -null zoom;
        
size size == -null size;
        
style style == -nullstyle;

        
markerClusterer = new MarkerClusterer(mapmarkers, {
          
maxZoomzoom,
          
gridSizesize,
          
stylesstyles[style]
        });
      }

      function 
initialize() {
        
map = new google.maps.Map(document.getElementById('map'), {
          
zoom2,
          
center: new google.maps.LatLng(39.91116.38),
          
mapTypeIdgoogle.maps.MapTypeId.ROADMAP
        
});

        var 
refresh document.getElementById('refresh');
        
google.maps.event.addDomListener(refresh'click'refreshMap);

        var 
clear document.getElementById('clear');
        
google.maps.event.addDomListener(clear'click'clearClusters);

        
refreshMap();
      }

      function 
clearClusters(e) {
        
e.preventDefault();
        
e.stopPropagation();
        
markerClusterer.clearMarkers();
      }
    </
script>
  </
head>
  <
body onload="initialize();">
    <
h3>An example of MarkerClusterer v3</h3>
    <
p>
      <
a href="?compiled">Compiled</a> |
      <
a href="?">Standard</aversion of the script.
    </
p>
    <
div id="map-container">
      <
div id="map"></div>
    </
div>
    <
div id="inline-actions">
      <
span>Max zoom level:
        <
select id="zoom">
          <
option value="-1">Default</option>
          <
option value="7">7</option>
          <
option value="8">8</option>
          <
option value="9">9</option>
          <
option value="10">10</option>
          <
option value="11">11</option>
          <
option value="12">12</option>
          <
option value="13">13</option>
          <
option value="14">14</option>
        </
select>

      </
span>
      <
span class="item">Cluster size:
        <
select id="size">
          <
option value="-1">Default</option>
          <
option value="40">40</option>
          <
option value="50">50</option>
          <
option value="70">70</option>
          <
option value="80">80</option>
        </
select>
      </
span>
      <
span class="item">Cluster style:
        <
select id="style">
          <
option value="-1">Default</option>
          <
option value="0">People</option>
          <
option value="1">Conversation</option>
          <
option value="2">Heart</option>
       </
select>
       <
input id="refresh" type="button" value="Refresh Map" class="item"/>
       <
a href="#" id="clear">Clear</a>
    </
div>
  </
body>
</
html>
?>
Онлайн: 1
Реклама