Вход Регистрация
Файл: module-assets/admin/gmaps/examples/polygons.html
Строк: 36
<?php
<!DOCTYPE html>
<
html>
<
head>
  <
meta charset="utf-8">
  <
title>GMaps.js &mdashPolygons</title>
  <
script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
  <
script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
  <
script type="text/javascript" src="../gmaps.js"></script>
  <
link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.3.0/bootstrap.min.css" />
  <
link rel="stylesheet" type="text/css" href="examples.css" />
  <
script type="text/javascript">
    var 
mappathpaths;
    $(
document).ready(function(){
      
map = new GMaps({
        
el'#map',
        
lat: -12.040397656836609,
        
lng: -77.03373871559225,
        
click: function(e){
          
console.log(e);
        }
      });

      
paths = [
                [
                  [
                    [-
105.0043201446533239.74732195489861],
                    [-
105.0071525573730539.74620006835170],
                    [-
105.0092124938964739.74468219277038],
                    [-
105.0106716156005939.74362625960105],
                    [-
105.0119590759277339.74290029616054],
                    [-
105.0098991394043139.74078835902781],
                    [-
105.0075817108154339.74059036160317],
                    [-
105.0034618377685539.74059036160317],
                    [-
105.0009727478027239.74059036160317],
                    [-
105.0006294250488139.74072235994946],
                    [-
105.0002002716064539.74191033368865],
                    [-
105.0007152557373139.74276830198601],
                    [-
105.0009727478027239.74369225589818],
                    [-
105.0009727478027239.74461619742136],
                    [-
105.0012302398681639.74534214278395],
                    [-
105.0018310546875139.74613407445653],
                    [-
105.0043201446533239.74732195489861]
                  ],[
                    [-
105.0036120414733739.74354376414072],
                    [-
105.0030112266540539.74278480127163],
                    [-
105.0022172927856439.74316428375108],
                    [-
105.0028395652771139.74390674342741],
                    [-
105.0036120414733739.74354376414072]
                  ]
                ],[
                  [
                    [-
105.0094270706176839.73989736613708],
                    [-
105.0094270706176839.73910536278566],
                    [-
105.0068521499633839.73923736397631],
                    [-
105.0038480758667139.73910536278566],
                    [-
105.0017452239990239.73903936209552],
                    [-
105.0004148483276439.73910536278566],
                    [-
105.0004148483276439.73979836621592],
                    [-
105.0053501129150439.73986436617916],
                    [-
105.0094270706176839.73989736613708]
                  ]
                ]
              ];

      
path = [[-12.040397656836609,-77.03373871559225], [-12.040248585302038,-77.03993927003302], [-12.050047116528843,-77.02448169303511], [-12.044804866577001,-77.02154422636042]];

      
map.drawPolygon({
        
pathspaths,
        
useGeoJSONtrue,
        
strokeColor'#131540',
        
strokeOpacity0.6,
        
strokeWeight6
      
});

      
map.drawPolygon({
        
pathspath,
        
strokeColor'#131540',
        
strokeOpacity0.6,
        
strokeWeight6
      
});
    });
  </
script>
</
head>
<
body>
  <
h1>GMaps.js &mdashPolygons</h1>
  <
div class="row">
    <
div class="span11">
      <
div id="map"></div>
    </
div>
    <
div class="span6">
      <
p>You can add polygons in GMaps.js this way:</p>
      <
pre>path = [[-12.040397656836609,-77.03373871559225], [-12.040248585302038,-77.03993927003302], [-12.050047116528843,-77.02448169303511], [-12.044804866577001,-77.02154422636042]];

map.drawPolygon({
  
pathspath,
  
strokeColor'#131540',
  
strokeOpacity0.6,
  
strokeWeight6
});</pre>
      <
p>The path of the polygon is defined by an array of array of two (latitude and longitude).</p>
      <
p><span class="label notice">NOTE:</spanAlsoyou can add a GeoJSON Polygon or MultiPolygon path using <code>useGeoJSONtrue</code>.</p>
    </
div>
  </
div>
</
body>
</
html>
?>
Онлайн: 2
Реклама