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

tiles flickering using google maps connector with google maps 3.10 #274

Open
javisantana opened this issue Jan 18, 2013 · 1 comment
Open

Comments

@javisantana
Copy link

the connector must be a MapType because the new google maps version wraps getTile method

@tokumine
Copy link

For any wandering souls out there, here is a workaround to get interactivity and non-flickering tiles in google maps when using wax:

 wax.tilejson('url_to_tilejson.json', function(tilejson) {

    var b = new wax.g.connector(tilejson);
    var c = new google.maps.ImageMapType(b);
    c.cache=b.cache;
    c.interactive=true;

    var old_getTile = c.getTile;
    c.getTile=function(p,zoom,doc) {
      var div=old_getTile.call(c,p,zoom,doc)
      var key=zoom + '/' + p.x + '/' + p.y;
      c.cache[key] = div;
      c.cache[key].src = b.getTileUrl(p, zoom);
      return div;
    }

    map.overlayMapTypes.insertAt(0, c);
    wax.g.interaction().map(map).tilejson(tilejson).on(wax.tooltip().parent(map.getDiv()).events());
    wax.g.interaction().map(map).tilejson(tilejson).on('on',function(o){console.log(o);});
  });

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

2 participants