block by jasondavies 588416

588416

Full Screen

index.html

<!DOCTYPE html>
<html>
  <head>
    <script type="text/javascript" src="//github.com/simplegeo/polymaps/raw/v2.2.0/polymaps.min.js"></script>
    <script type="text/javascript" src="//github.com/mbostock/polymaps/raw/ce7f4734bf01d535108dc5c5127c55b252c43aaa/examples/loupe/loupe.js"></script>
    <style type="text/css">

@import url("//github.com/simplegeo/polymaps/raw/v2.2.0/examples/example.css");

html, body {
  height: 100%;
}

svg {
  display: block;
}

.loupe .back {
  stroke: #000;
  stroke-width: 8px;
}

.loupe .fore {
  stroke: #E5E0D9;
  stroke-width: 6px;
}

    </style>
  </head>
  <body id="map">
    <script type="text/javascript">

var po = org.polymaps;

var map = po.map()
    .container(document.getElementById("map").appendChild(po.svg("svg")))
    .add(po.interact())
    .add(po.hash());

map.add(po.image()
    .url(po.url("//{S}tile.cloudmade.com"
    + "/1a1b06b230af4efdbb989ea99e9841af" // //cloudmade.com/register
    + "/998/256/{Z}/{X}/{Y}.png")
    .hosts(["a.", "b.", "c.", ""])));

map.add(po.loupe()
  .zoomDelta(2)
  .add(po.image()
    .url(po.url("//{S}tile.cloudmade.com"
    + "/1a1b06b230af4efdbb989ea99e9841af" // //cloudmade.com/register
    + "/999/256/{Z}/{X}/{Y}.png")
    .hosts(["a.", "b.", "c.", ""]))));

map.add(po.compass()
    .pan("none"));

    </script>
    <span id="copy">
      &copy; 2010
      <a href="//www.cloudmade.com/">CloudMade</a>,
      <a href="//www.openstreetmap.org/">OpenStreetMap</a> contributors,
      <a href="//creativecommons.org/licenses/by-sa/2.0/">CCBYSA</a>.
    </span>
  </body>
</html>

README.mkd

This example is a simple [loupe](http://en.wikipedia.org/wiki/Loupe) using [Polymaps](http://polymaps.org). Drag the center of the loupe to move it around, or drag the thick border to resize it. Loupes are normally used to magnify, showing focus and context, but in this example we're using it to show two different tilesets. You can enable magnification (or minification) using the `zoomDelta` property.