I am working on an application that renders land parcels from PostGIS as polygons in Leaflet. I have an event handler set for 'viewreset' on the map:
this.leaflet_map.on('viewreset', this.viewport.regenerate, this.viewport);
this in this case is an object I've created, called
viewport is an object I've created to wrap the methods for regenerating the view based on the current map bounds. My code works on initial load, as well as on panning the map. However, when I zoom in or out, I get the following error in line 4842 of leaflet-src.js:
Uncaught TypeError: Cannot call method 'latLngToLayerPoint' of null
Any ideas? My full code is available at https://github.com/CoherentLogic/ptarmigan/blob/experimental/web/ptarmigan/parcels/layers.js
Thanks much in advance! John W.