Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 06553edab7
Fetching contributors…

Cannot retrieve contributors at this time

file 62 lines (59 sloc) 1.663 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>GMaps.js &mdash; Static map with polyline</title>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  <script src="http://maps.google.com/maps/api/js?sensor=true"></script>
  <script src="../gmaps.js"></script>
  <link href="http://twitter.github.com/bootstrap/1.3.0/bootstrap.min.css" />
  <link rel="stylesheet" type="text/css" href="examples.css" />
  <script>
    $(document).ready(function(){
      var path = [
        [-12.040397656836609,-77.03373871559225],
        [-12.040248585302038,-77.03993927003302],
        [-12.050047116528843,-77.02448169303511],
        [-12.044804866577001,-77.02154422636042],
        [-12.040397656836609,-77.03373871559225]
      ];

      var url = GMaps.staticMapURL({
        size: [610, 350],
        lat: -12.043333,
        lng: -77.028333,
        polyline: {
          path: path,
          strokeColor: '#131540',
          strokeOpacity: 0.6,
          strokeWeight: 6
        }
      });
      $('<img/>').attr('src', url).appendTo('#map');
    });
  </script>
</head>
<body>
<h1>GMaps.js &mdash; Static map with polyline</h1>
  <div class="row">
    <div class="span11">
      <div id="map"></div>
    </div>
    <div class="span6">
      <p>A single polyline can be also drawed in a static map:</p>
      <pre>url = GMaps.staticMapURL({
  size: [610, 350],
  lat: -12.043333,
  lng: -77.028333,

  polyline: {
    path: path,
    strokeColor: '#131540',
    strokeOpacity: 0.6,
    strokeWeight: 6
  }
});

$('&lt;img/&gt;').attr('src', url)
  .appendTo('#map');</pre>
    </div>
  </div>
</body>
</html>
Something went wrong with that request. Please try again.