cutting-room-floor / wax

DEPRECATED: consult mapbox.js
https://github.com/mapbox/mapbox.js
BSD 3-Clause "New" or "Revised" License
166 stars 42 forks source link

Basic UTFGrid question #265

Open evz opened 11 years ago

evz commented 11 years ago

Hey there. Feeling a bit obtuse for having to ask this but, what the hey. I've got a tilestache setup with a tile layer provider and a UTFGrid provider and I'm attempting to overlay those on a Google Map. I've got it working in a really basic way thusly:

function init(){
     var tiles = {
           tilejson: '1.0.0',
           tiles: ['http://localhost/loc-pop/{z}/{x}/{y}.png'],
           grids: ['http://localhost/loc-grid/{z}/{x}/{y}.json'],
           formatter: function(options,data){return 'Locality Code: ' + data.LOCALITY_C}
     };
     map = new google.maps.Map(
         document.getElementById('map_canvas'), {
             zoom: 8,
             center: new google.maps.LatLng(42, -88),
             disableDefaultUI: true,
             mapTypeId: google.maps.MapTypeId.ROADMAP
         }
      );
      map.overlayMapTypes.insertAt(0, new wax.g.connector(tiles))              
      wax.g.interaction().map(map).tilejson(tiles).on(wax.tooltip().parent(map.getDiv()).events());
}

Problem is, when I zoom the map, I'm losing the interactivity from the UTFGrid layer. I feel like there's something simple that I must be missing but a rather exhaustive Googling of the issue as well as going back over the docs for Wax didn't really turn anything up. Anyone out there that might be able to give me a hand?

Thanks.

evz commented 11 years ago

Point of clarification: It seems that zooming isn't the real culprit. Double clicking to zoom somehow unbinds the hover events from the interaction layer. If I click on the different areas in the grid, the interaction happens but the hover events are gone.