danzel / Leaflet.utfgrid

A UTFGrid implementation for leaflet that is super small.
MIT License
131 stars 51 forks source link

setUrl method #17

Closed bmcbride closed 11 years ago

bmcbride commented 11 years ago

Is there any way to update the URL after initialization? L.TileLayer has a handy setUrl method for this. It looks like I can use utfGrid.constructor("http://myurl.{z}/{x}/{y}.grid.json?sql=select * from my_table where x = 'y'"), but I have to pan the map a little for it to update. Any thoughts or workaround solutions to handle this? Thanks!

danzel commented 11 years ago

You are correct, there isn't any way to do this at the moment. You could remove the layer and add a new one with the updated url? Or if you update the code to add it I'll pull it in :-)

bmcbride commented 11 years ago

Thanks!