Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding modest-maps legend control

  • Loading branch information...
commit f22a88e573731bbdad09c81b15f39253e5efb634 1 parent 46b8a1d
Tom MacWright authored
Showing with 29 additions and 0 deletions.
  1. +29 −0 control/mm/legend.js
View
29 control/mm/legend.js
@@ -0,0 +1,29 @@
+// Wax: Legend Control
+// -------------------
+// Requires:
+//
+// * modestmaps
+// * wax.Legend
+
+// namespacing!
+if (!com) {
+ var com = { };
+ if (!com.modestmaps) {
+ com.modestmaps = { };
+ }
+}
+
+// A chaining-style control that adds
+// interaction to a modestmaps.Map object.
+com.modestmaps.Map.prototype.legend = function(options) {
+ options = options || {};
+ this.legend = new wax.Legend(this.parent, options.container);
+ this.legend.render([
+ this.provider.getTileUrl({
+ zoom: 0,
+ column: 0,
+ row: 0
+ })
+ ]);
+ return this;
+};
Please sign in to comment.
Something went wrong with that request. Please try again.