Skip to content
Browse files

Return tile url when interaction is fired

  • Loading branch information...
1 parent c643588 commit 5a14a60b0e5f15ea4dba2f1840201d37fa42074b @fmassot committed Jun 4, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 control/lib/interaction.js
View
8 control/lib/interaction.js
@@ -61,12 +61,13 @@ wax.interaction = function() {
var pos = wax.u.eventoffset(e);
- interaction.screen_feature(pos, function(feature) {
+ interaction.screen_feature(pos, function(tileSrc, feature) {
if (feature) {
bean.fire(interaction, 'on', {
parent: parent(),
data: feature,
formatter: gm.formatter().format,
+ tileSrc: tileSrc,
e: e
});
} else {
@@ -138,11 +139,12 @@ wax.interaction = function() {
// Handle a click event. Takes a second
interaction.click = function(e, pos) {
- interaction.screen_feature(pos, function(feature) {
+ interaction.screen_feature(pos, function(tileSrc, feature) {
if (feature) bean.fire(interaction, 'on', {
parent: parent(),
data: feature,
formatter: gm.formatter().format,
+ tileSrc: tileSrc,
e: e
});
});
@@ -154,7 +156,7 @@ wax.interaction = function() {
gm.getGrid(tile.src, function(err, g) {
if (err || !g) return callback(null);
var feature = g.tileFeature(pos.x, pos.y, tile);
- callback(feature);
+ callback(tile.src, feature);
});
};

0 comments on commit 5a14a60

Please sign in to comment.
Something went wrong with that request. Please try again.