Permalink
Browse files

Add leaflet support

  • Loading branch information...
1 parent 4c6a7fe commit b6bb974d384fae4e388b3fac56b4ee9b32e4b7fa @tmcw tmcw committed Jun 13, 2012
Showing with 79 additions and 13 deletions.
  1. +33 −0 control/leaf/legend.js
  2. +1 −1 dist/wax.esri.js
  3. +1 −1 dist/wax.esri.min.js
  4. +1 −1 dist/wax.g.js
  5. +1 −1 dist/wax.g.min.js
  6. +34 −1 dist/wax.leaf.js
  7. +2 −2 dist/wax.leaf.min.js
  8. +1 −1 dist/wax.mm.js
  9. +1 −1 dist/wax.mm.min.js
  10. +1 −1 dist/wax.ol.js
  11. +1 −1 dist/wax.ol.min.js
  12. +1 −1 dist/wax.p.js
  13. +1 −1 dist/wax.p.min.js
View
@@ -0,0 +1,33 @@
+wax = wax || {};
+wax.leaf = wax.leaf || {};
+
+// Legend Control
+// --------------
+// The Leaflet version of this control is a very, very
+// light wrapper around the `/lib` code for legends.
+wax.leaf.legend = function(map, tilejson) {
+ tilejson = tilejson || {};
+ var l, // parent legend
+ legend = {};
+
+ legend.add = function() {
+ l = wax.legend()
+ .content(tilejson.legend || '');
+ return this;
+ };
+
+ legend.content = function(x) {
+ if (x) l.content(x.legend || '');
+ };
+
+ legend.element = function() {
+ return l.element();
+ };
+
+ legend.appendTo = function(elem) {
+ wax.u.$(elem).appendChild(l.element());
+ return this;
+ };
+
+ return legend.add();
+};
View
@@ -1,4 +1,4 @@
-/* wax - 6.0.6 - 1.0.4-582-g4fa7f9b */
+/* wax - 6.0.6 - 1.0.4-585-g4c6a7fe */
!function (name, context, definition) {
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,4 +1,4 @@
-/* wax - 6.0.6 - 1.0.4-582-g4fa7f9b */
+/* wax - 6.0.6 - 1.0.4-585-g4c6a7fe */
!function (name, context, definition) {
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,4 +1,4 @@
-/* wax - 6.0.6 - 1.0.4-582-g4fa7f9b */
+/* wax - 6.0.6 - 1.0.4-585-g4c6a7fe */
!function (name, context, definition) {
@@ -3091,6 +3091,39 @@ wax.leaf.interaction = function() {
wax = wax || {};
wax.leaf = wax.leaf || {};
+// Legend Control
+// --------------
+// The Leaflet version of this control is a very, very
+// light wrapper around the `/lib` code for legends.
+wax.leaf.legend = function(map, tilejson) {
+ tilejson = tilejson || {};
+ var l, // parent legend
+ legend = {};
+
+ legend.add = function() {
+ l = wax.legend()
+ .content(tilejson.legend || '');
+ return this;
+ };
+
+ legend.content = function(x) {
+ if (x) l.content(x.legend || '');
+ };
+
+ legend.element = function() {
+ return l.element();
+ };
+
+ legend.appendTo = function(elem) {
+ wax.u.$(elem).appendChild(l.element());
+ return this;
+ };
+
+ return legend.add();
+};
+wax = wax || {};
+wax.leaf = wax.leaf || {};
+
wax.leaf.connector = L.TileLayer.extend({
initialize: function(options) {
options = options || {};
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,4 +1,4 @@
-/* wax - 6.0.6 - 1.0.4-582-g4fa7f9b */
+/* wax - 6.0.6 - 1.0.4-585-g4c6a7fe */
!function (name, context, definition) {
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,4 +1,4 @@
-/* wax - 6.0.6 - 1.0.4-582-g4fa7f9b */
+/* wax - 6.0.6 - 1.0.4-585-g4c6a7fe */
!function (name, context, definition) {
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,4 +1,4 @@
-/* wax - 6.0.6 - 1.0.4-582-g4fa7f9b */
+/* wax - 6.0.6 - 1.0.4-585-g4c6a7fe */
!function (name, context, definition) {
View

Large diffs are not rendered by default.

Oops, something went wrong.

0 comments on commit b6bb974

Please sign in to comment.