Skip to content

Instantly share code, notes, and snippets.

Last active February 8, 2016 23:03
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?

This example is a simple loupe using Polymaps. 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.

<!DOCTYPE html>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<style type="text/css">
@import url("");
html, body {
height: 100%;
svg {
display: block;
.loupe .back {
stroke: #000;
stroke-width: 8px;
.loupe .fore {
stroke: #E5E0D9;
stroke-width: 6px;
<body id="map">
<script type="text/javascript">
var po = org.polymaps;
var map =
+ "/1a1b06b230af4efdbb989ea99e9841af" //
+ "/998/256/{Z}/{X}/{Y}.png")
.hosts(["a.", "b.", "c.", ""])));
+ "/1a1b06b230af4efdbb989ea99e9841af" //
+ "/999/256/{Z}/{X}/{Y}.png")
.hosts(["a.", "b.", "c.", ""]))));
<span id="copy">
&copy; 2010
<a href="">CloudMade</a>,
<a href="">OpenStreetMap</a> contributors,
<a href="">CCBYSA</a>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment