@@ -1601,11 +1601,17 @@ methods.addPolygons = function (polygons, layerId, group, options, popup, popupO
1601
1601
var df = new _dataframe2 . default ( ) . col ( "shapes" , polygons ) . col ( "layerId" , layerId ) . col ( "group" , group ) . col ( "popup" , popup ) . col ( "popupOptions" , popupOptions ) . col ( "label" , label ) . col ( "labelOptions" , labelOptions ) . col ( "highlightOptions" , highlightOptions ) . cbind ( options ) ;
1602
1602
1603
1603
addLayers ( this , "shape" , df , function ( df , i ) {
1604
- var shapes = df . get ( i , "shapes" ) ;
1605
- shapes = shapes . map ( function ( polygon ) {
1604
+ // This code used to use L.multiPolygon, but that caused
1605
+ // double-click on a multipolygon to fail to zoom in on the
1606
+ // map. Surprisingly, putting all the rings in a single
1607
+ // polygon seems to still work; complicated multipolygons
1608
+ // are still rendered correctly.
1609
+ var shapes = df . get ( i , "shapes" ) . map ( function ( polygon ) {
1606
1610
return polygon . map ( _htmlwidgets2 . default . dataframeToD3 ) ;
1607
- } ) ;
1608
- return _leaflet2 . default . multiPolygon ( shapes , df . get ( i ) ) ;
1611
+ } ) . reduce ( function ( acc , val ) {
1612
+ return acc . concat ( val ) ;
1613
+ } , [ ] ) ;
1614
+ return _leaflet2 . default . polygon ( shapes , df . get ( i ) ) ;
1609
1615
} ) ;
1610
1616
}
1611
1617
} ;
@@ -2290,6 +2296,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
2290
2296
// pixel of the original image has some contribution to the downscaled image)
2291
2297
// as opposed to a single-step downscaling which will discard a lot of data
2292
2298
// (and with sparse images at small scales can give very surprising results).
2299
+
2293
2300
var Mipmapper = function ( ) {
2294
2301
function Mipmapper ( img ) {
2295
2302
_classCallCheck ( this , Mipmapper ) ;
0 commit comments