Skip to content

Commit d320011

Browse files
author
Young Hahn
committed
Leaflet connector and TileJSON support for Leaflet interaction control.
1 parent c4dd2d3 commit d320011

File tree

12 files changed

+96
-69
lines changed

12 files changed

+96
-69
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dist/wax.mm.min.js:
1616
$(UGLIFYJS) dist/wax.mm.js > dist/wax.mm.min.js
1717

1818
dist/wax.leaf.min.js:
19-
cat build/header.js ext/reqwest.min.js lib/*.js control/lib/*.js control/leaf/*.js > dist/wax.leaf.js
19+
cat build/header.js ext/reqwest.min.js lib/*.js control/lib/*.js control/leaf/*.js connectors/leaf/*.js > dist/wax.leaf.js
2020
$(UGLIFYJS) dist/wax.leaf.js > dist/wax.leaf.min.js
2121

2222
dist_setup:

connectors/leaf/connector.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
wax = wax || {};
2+
wax.leaf = wax.leaf || {};
3+
4+
wax.leaf.connector = L.TileLayer.extend({
5+
initialize: function(options) {
6+
options = options || {};
7+
options.minZoom = options.minzoom || 0;
8+
options.maxZoom = options.maxzoom || 22;
9+
L.TileLayer.prototype.initialize.call(this, options.tiles[0], options);
10+
}
11+
});

control/leaf/interaction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ wax.leaf.interaction = function(map, options) {
1818
var interaction = {
1919
modifyingEvents: ['move'],
2020

21-
waxGM: new wax.GridManager(),
21+
waxGM: new wax.GridManager(options),
2222

2323
// This requires wax.Tooltip or similar
2424
callbacks: options.callbacks || new wax.tooltip(),

dist/wax.g.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* wax - 2.1.6 - 1.0.4-302-g2796b42 */
1+
/* wax - 2.1.6 - 1.0.4-304-gc4dd2d3 */
22

33

44
/*!

dist/wax.g.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/wax.leaf.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* wax - 2.1.6 - 1.0.4-302-g2796b42 */
1+
/* wax - 2.1.6 - 1.0.4-304-gc4dd2d3 */
22

33

44
/*!
@@ -802,7 +802,7 @@ wax.leaf.interaction = function(map, options) {
802802
var interaction = {
803803
modifyingEvents: ['move'],
804804

805-
waxGM: new wax.GridManager(),
805+
waxGM: new wax.GridManager(options),
806806

807807
// This requires wax.Tooltip or similar
808808
callbacks: options.callbacks || new wax.tooltip(),
@@ -973,3 +973,14 @@ wax.leaf.interaction = function(map, options) {
973973
// Ensure chainability
974974
return interaction.add(map);
975975
};
976+
wax = wax || {};
977+
wax.leaf = wax.leaf || {};
978+
979+
wax.leaf.connector = L.TileLayer.extend({
980+
initialize: function(options) {
981+
options = options || {};
982+
options.minZoom = options.minzoom || 0;
983+
options.maxZoom = options.maxzoom || 22;
984+
L.TileLayer.prototype.initialize.call(this, options.tiles[0], options);
985+
}
986+
});

dist/wax.leaf.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/wax.mm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* wax - 2.1.6 - 1.0.4-302-g2796b42 */
1+
/* wax - 2.1.6 - 1.0.4-304-gc4dd2d3 */
22

33

44
/*!

dist/wax.mm.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/wax.ol.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* wax - 2.1.6 - 1.0.4-302-g2796b42 */
1+
/* wax - 2.1.6 - 1.0.4-304-gc4dd2d3 */
22

33

44
/*!

0 commit comments

Comments
 (0)