@@ -139,7 +139,14 @@ function addMarkers(map, df, group, clusterOptions, clusterId, markerFunc) {
139
139
this . layerManager . addLayer ( marker , "marker" , thisId , thisGroup ) ;
140
140
}
141
141
let popup = df . get ( i , "popup" ) ;
142
- if ( popup !== null ) marker . bindPopup ( popup ) ;
142
+ let popupOptions = df . get ( i , 'popupOptions' ) ;
143
+ if ( popup !== null ) {
144
+ if ( popupOptions !== null ) {
145
+ marker . bindPopup ( popup , popupOptions ) ;
146
+ } else {
147
+ marker . bindPopup ( popup ) ;
148
+ }
149
+ }
143
150
let label = df . get ( i , "label" ) ;
144
151
let labelOptions = df . get ( i , "labelOptions" ) ;
145
152
if ( label !== null ) {
@@ -165,7 +172,7 @@ function addMarkers(map, df, group, clusterOptions, clusterId, markerFunc) {
165
172
} ) . call ( map ) ;
166
173
}
167
174
168
- methods . addMarkers = function ( lat , lng , icon , layerId , group , options , popup ,
175
+ methods . addMarkers = function ( lat , lng , icon , layerId , group , options , popup , popupOptions ,
169
176
clusterOptions , clusterId , label , labelOptions ) {
170
177
let icondf ;
171
178
let getIcon ;
@@ -217,6 +224,7 @@ methods.addMarkers = function(lat, lng, icon, layerId, group, options, popup,
217
224
. col ( "layerId" , layerId )
218
225
. col ( "group" , group )
219
226
. col ( "popup" , popup )
227
+ . col ( "popupOptions" , popupOptions )
220
228
. col ( "label" , label )
221
229
. col ( "labelOptions" , labelOptions )
222
230
. cbind ( options ) ;
@@ -230,7 +238,7 @@ methods.addMarkers = function(lat, lng, icon, layerId, group, options, popup,
230
238
} ) ;
231
239
} ;
232
240
233
- methods . addAwesomeMarkers = function ( lat , lng , icon , layerId , group , options , popup ,
241
+ methods . addAwesomeMarkers = function ( lat , lng , icon , layerId , group , options , popup , popupOptions ,
234
242
clusterOptions , clusterId , label , labelOptions ) {
235
243
let icondf ;
236
244
let getIcon ;
@@ -257,6 +265,7 @@ clusterOptions, clusterId, label, labelOptions) {
257
265
. col ( "layerId" , layerId )
258
266
. col ( "group" , group )
259
267
. col ( "popup" , popup )
268
+ . col ( "popupOptions" , popupOptions )
260
269
. col ( "label" , label )
261
270
. col ( "labelOptions" , labelOptions )
262
271
. cbind ( options ) ;
@@ -279,7 +288,14 @@ function addLayers(map, category, df, layerFunc) {
279
288
this . layerManager . addLayer ( layer , category , thisId , thisGroup ) ;
280
289
if ( layer . bindPopup ) {
281
290
let popup = df . get ( i , "popup" ) ;
282
- if ( popup !== null ) layer . bindPopup ( popup ) ;
291
+ let popupOptions = df . get ( i , 'popupOptions' ) ;
292
+ if ( popup !== null ) {
293
+ if ( popupOptions !== null ) {
294
+ layer . bindPopup ( popup , popupOptions ) ;
295
+ } else {
296
+ layer . bindPopup ( popup ) ;
297
+ }
298
+ }
283
299
}
284
300
if ( layer . bindLabel ) {
285
301
let label = df . get ( i , "label" ) ;
@@ -299,14 +315,15 @@ function addLayers(map, category, df, layerFunc) {
299
315
}
300
316
}
301
317
302
- methods . addCircles = function ( lat , lng , radius , layerId , group , options , popup , label , labelOptions ) {
318
+ methods . addCircles = function ( lat , lng , radius , layerId , group , options , popup , popupOptions , label , labelOptions ) {
303
319
let df = new DataFrame ( )
304
320
. col ( "lat" , lat )
305
321
. col ( "lng" , lng )
306
322
. col ( "radius" , radius )
307
323
. col ( "layerId" , layerId )
308
324
. col ( "group" , group )
309
325
. col ( "popup" , popup )
326
+ . col ( "popupOptions" , popupOptions )
310
327
. col ( "label" , label )
311
328
. col ( "labelOptions" , labelOptions )
312
329
. cbind ( options ) ;
@@ -316,14 +333,15 @@ methods.addCircles = function(lat, lng, radius, layerId, group, options, popup,
316
333
} ) ;
317
334
} ;
318
335
319
- methods . addCircleMarkers = function ( lat , lng , radius , layerId , group , options , clusterOptions , clusterId , popup , label , labelOptions ) {
336
+ methods . addCircleMarkers = function ( lat , lng , radius , layerId , group , options , clusterOptions , clusterId , popup , popupOptions , label , labelOptions ) {
320
337
let df = new DataFrame ( )
321
338
. col ( "lat" , lat )
322
339
. col ( "lng" , lng )
323
340
. col ( "radius" , radius )
324
341
. col ( "layerId" , layerId )
325
342
. col ( "group" , group )
326
343
. col ( "popup" , popup )
344
+ . col ( "popupOptions" , popupOptions )
327
345
. col ( "label" , label )
328
346
. col ( "labelOptions" , labelOptions )
329
347
. cbind ( options ) ;
@@ -337,12 +355,13 @@ methods.addCircleMarkers = function(lat, lng, radius, layerId, group, options, c
337
355
* @param lat Array of arrays of latitude coordinates for polylines
338
356
* @param lng Array of arrays of longitude coordinates for polylines
339
357
*/
340
- methods . addPolylines = function ( polygons , layerId , group , options , popup , label , labelOptions ) {
358
+ methods . addPolylines = function ( polygons , layerId , group , options , popup , popupOptions , label , labelOptions ) {
341
359
let df = new DataFrame ( )
342
360
. col ( "shapes" , polygons )
343
361
. col ( "layerId" , layerId )
344
362
. col ( "group" , group )
345
363
. col ( "popup" , popup )
364
+ . col ( "popupOptions" , popupOptions )
346
365
. col ( "label" , label )
347
366
. col ( "labelOptions" , labelOptions )
348
367
. cbind ( options ) ;
@@ -384,7 +403,7 @@ methods.clearShapes = function() {
384
403
this . layerManager . clearLayers ( "shape" ) ;
385
404
} ;
386
405
387
- methods . addRectangles = function ( lat1 , lng1 , lat2 , lng2 , layerId , group , options , popup , label , labelOptions ) {
406
+ methods . addRectangles = function ( lat1 , lng1 , lat2 , lng2 , layerId , group , options , popup , popupOptions , label , labelOptions ) {
388
407
let df = new DataFrame ( )
389
408
. col ( "lat1" , lat1 )
390
409
. col ( "lng1" , lng1 )
@@ -393,6 +412,7 @@ methods.addRectangles = function(lat1, lng1, lat2, lng2, layerId, group, options
393
412
. col ( "layerId" , layerId )
394
413
. col ( "group" , group )
395
414
. col ( "popup" , popup )
415
+ . col ( "popupOptions" , popupOptions )
396
416
. col ( "label" , label )
397
417
. col ( "labelOptions" , labelOptions )
398
418
. cbind ( options ) ;
@@ -411,12 +431,13 @@ methods.addRectangles = function(lat1, lng1, lat2, lng2, layerId, group, options
411
431
* @param lat Array of arrays of latitude coordinates for polygons
412
432
* @param lng Array of arrays of longitude coordinates for polygons
413
433
*/
414
- methods . addPolygons = function ( polygons , layerId , group , options , popup , label , labelOptions ) {
434
+ methods . addPolygons = function ( polygons , layerId , group , options , popup , popupOptions , label , labelOptions ) {
415
435
let df = new DataFrame ( )
416
436
. col ( "shapes" , polygons )
417
437
. col ( "layerId" , layerId )
418
438
. col ( "group" , group )
419
439
. col ( "popup" , popup )
440
+ . col ( "popupOptions" , popupOptions )
420
441
. col ( "label" , label )
421
442
. col ( "labelOptions" , labelOptions )
422
443
. cbind ( options ) ;
0 commit comments