Skip to content

Commit

Permalink
Adding OpenLayers and PolyMaps snippets, Fixes #19, will be better wi…
Browse files Browse the repository at this point in the history
…th mustache
  • Loading branch information
Tom MacWright committed Dec 15, 2010
1 parent e72d0d0 commit a7b619f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
9 changes: 9 additions & 0 deletions client/css/tilemill.css
Original file line number Diff line number Diff line change
Expand Up @@ -846,3 +846,12 @@ a.popup-close { background-color:#222; }
#form-providers div.datasource .url {
display:none;
}

/**
* Code snippets in info popup
*/
textarea.code-snippet {
font-family: monospace;
width: 100%;
height: 150px;
}
24 changes: 24 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,30 @@ <h2><%= title %></h2>
<div><label for='mml-url'>MML URL</label>
<input id='mml-url' class='text' type='text' value='<%= mml_url %>' />
</div>
<div>
<label for='polymaps'>Polymaps</label>
<textarea class='code-snippet'>
var po = org.polymaps;

var map = po.map()
.container(document.getElementById("map").appendChild(po.svg("svg")))
.add(po.interact())
.add(po.hash())
// layer setup
.add(po.image()
.url(po.url(<%= tilelive_url %>
+ "/{Z}/{X}/{Y}.png")
))
// end layer setup
.add(po.compass()
.pan("none"));
</textarea>
</div>
<div> <label for='openlayers'>OpenLayers</label>
<textarea class='code-snippet'>
var layer = new OpenLayers.Layer('layer', <%= tilelive_url %>, { sphericalMercator: true });
</textarea>
</div>
</form>
</div>
</script>
Expand Down

0 comments on commit a7b619f

Please sign in to comment.