Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic UTFGrid question #265

Open
evz opened this issue Nov 8, 2012 · 1 comment
Open

Basic UTFGrid question #265

evz opened this issue Nov 8, 2012 · 1 comment

Comments

@evz
Copy link

evz commented Nov 8, 2012

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
Copy link
Author

evz commented Nov 8, 2012

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant