@@ -149,7 +149,14 @@ function addMarkers(map, df, group, clusterOptions, clusterId, markerFunc) {
149
149
this . layerManager . addLayer ( marker , "marker" , thisId , thisGroup ) ;
150
150
}
151
151
let popup = df . get ( i , "popup" ) ;
152
- if ( popup !== null ) marker . bindPopup ( popup ) ;
152
+ let popupOptions = df . get ( i , 'popupOptions' ) ;
153
+ if ( popup !== null ) {
154
+ if ( popupOptions !== null ) {
155
+ marker . bindPopup ( popup , popupOptions ) ;
156
+ } else {
157
+ marker . bindPopup ( popup ) ;
158
+ }
159
+ }
153
160
let label = df . get ( i , "label" ) ;
154
161
let labelOptions = df . get ( i , "labelOptions" ) ;
155
162
if ( label !== null ) {
@@ -175,7 +182,7 @@ function addMarkers(map, df, group, clusterOptions, clusterId, markerFunc) {
175
182
} ) . call ( map ) ;
176
183
}
177
184
178
- methods . addMarkers = function ( lat , lng , icon , layerId , group , options , popup ,
185
+ methods . addMarkers = function ( lat , lng , icon , layerId , group , options , popup , popupOptions ,
179
186
clusterOptions , clusterId , label , labelOptions ) {
180
187
let icondf ;
181
188
let getIcon ;
@@ -227,6 +234,7 @@ methods.addMarkers = function(lat, lng, icon, layerId, group, options, popup,
227
234
. col ( "layerId" , layerId )
228
235
. col ( "group" , group )
229
236
. col ( "popup" , popup )
237
+ . col ( "popupOptions" , popupOptions )
230
238
. col ( "label" , label )
231
239
. col ( "labelOptions" , labelOptions )
232
240
. cbind ( options ) ;
@@ -240,7 +248,7 @@ methods.addMarkers = function(lat, lng, icon, layerId, group, options, popup,
240
248
} ) ;
241
249
} ;
242
250
243
- methods . addAwesomeMarkers = function ( lat , lng , icon , layerId , group , options , popup ,
251
+ methods . addAwesomeMarkers = function ( lat , lng , icon , layerId , group , options , popup , popupOptions ,
244
252
clusterOptions , clusterId , label , labelOptions ) {
245
253
let icondf ;
246
254
let getIcon ;
@@ -267,6 +275,7 @@ clusterOptions, clusterId, label, labelOptions) {
267
275
. col ( "layerId" , layerId )
268
276
. col ( "group" , group )
269
277
. col ( "popup" , popup )
278
+ . col ( "popupOptions" , popupOptions )
270
279
. col ( "label" , label )
271
280
. col ( "labelOptions" , labelOptions )
272
281
. cbind ( options ) ;
@@ -289,7 +298,14 @@ function addLayers(map, category, df, layerFunc) {
289
298
this . layerManager . addLayer ( layer , category , thisId , thisGroup ) ;
290
299
if ( layer . bindPopup ) {
291
300
let popup = df . get ( i , "popup" ) ;
292
- if ( popup !== null ) layer . bindPopup ( popup ) ;
301
+ let popupOptions = df . get ( i , 'popupOptions' ) ;
302
+ if ( popup !== null ) {
303
+ if ( popupOptions !== null ) {
304
+ layer . bindPopup ( popup , popupOptions ) ;
305
+ } else {
306
+ layer . bindPopup ( popup ) ;
307
+ }
308
+ }
293
309
}
294
310
if ( layer . bindLabel ) {
295
311
let label = df . get ( i , "label" ) ;
@@ -309,14 +325,15 @@ function addLayers(map, category, df, layerFunc) {
309
325
}
310
326
}
311
327
312
- methods . addCircles = function ( lat , lng , radius , layerId , group , options , popup , label , labelOptions ) {
328
+ methods . addCircles = function ( lat , lng , radius , layerId , group , options , popup , popupOptions , label , labelOptions ) {
313
329
let df = new DataFrame ( )
314
330
. col ( "lat" , lat )
315
331
. col ( "lng" , lng )
316
332
. col ( "radius" , radius )
317
333
. col ( "layerId" , layerId )
318
334
. col ( "group" , group )
319
335
. col ( "popup" , popup )
336
+ . col ( "popupOptions" , popupOptions )
320
337
. col ( "label" , label )
321
338
. col ( "labelOptions" , labelOptions )
322
339
. cbind ( options ) ;
@@ -326,14 +343,15 @@ methods.addCircles = function(lat, lng, radius, layerId, group, options, popup,
326
343
} ) ;
327
344
} ;
328
345
329
- methods . addCircleMarkers = function ( lat , lng , radius , layerId , group , options , clusterOptions , clusterId , popup , label , labelOptions ) {
346
+ methods . addCircleMarkers = function ( lat , lng , radius , layerId , group , options , clusterOptions , clusterId , popup , popupOptions , label , labelOptions ) {
330
347
let df = new DataFrame ( )
331
348
. col ( "lat" , lat )
332
349
. col ( "lng" , lng )
333
350
. col ( "radius" , radius )
334
351
. col ( "layerId" , layerId )
335
352
. col ( "group" , group )
336
353
. col ( "popup" , popup )
354
+ . col ( "popupOptions" , popupOptions )
337
355
. col ( "label" , label )
338
356
. col ( "labelOptions" , labelOptions )
339
357
. cbind ( options ) ;
@@ -347,12 +365,13 @@ methods.addCircleMarkers = function(lat, lng, radius, layerId, group, options, c
347
365
* @param lat Array of arrays of latitude coordinates for polylines
348
366
* @param lng Array of arrays of longitude coordinates for polylines
349
367
*/
350
- methods . addPolylines = function ( polygons , layerId , group , options , popup , label , labelOptions ) {
368
+ methods . addPolylines = function ( polygons , layerId , group , options , popup , popupOptions , label , labelOptions ) {
351
369
let df = new DataFrame ( )
352
370
. col ( "shapes" , polygons )
353
371
. col ( "layerId" , layerId )
354
372
. col ( "group" , group )
355
373
. col ( "popup" , popup )
374
+ . col ( "popupOptions" , popupOptions )
356
375
. col ( "label" , label )
357
376
. col ( "labelOptions" , labelOptions )
358
377
. cbind ( options ) ;
@@ -394,7 +413,7 @@ methods.clearShapes = function() {
394
413
this . layerManager . clearLayers ( "shape" ) ;
395
414
} ;
396
415
397
- methods . addRectangles = function ( lat1 , lng1 , lat2 , lng2 , layerId , group , options , popup , label , labelOptions ) {
416
+ methods . addRectangles = function ( lat1 , lng1 , lat2 , lng2 , layerId , group , options , popup , popupOptions , label , labelOptions ) {
398
417
let df = new DataFrame ( )
399
418
. col ( "lat1" , lat1 )
400
419
. col ( "lng1" , lng1 )
@@ -403,6 +422,7 @@ methods.addRectangles = function(lat1, lng1, lat2, lng2, layerId, group, options
403
422
. col ( "layerId" , layerId )
404
423
. col ( "group" , group )
405
424
. col ( "popup" , popup )
425
+ . col ( "popupOptions" , popupOptions )
406
426
. col ( "label" , label )
407
427
. col ( "labelOptions" , labelOptions )
408
428
. cbind ( options ) ;
@@ -421,12 +441,13 @@ methods.addRectangles = function(lat1, lng1, lat2, lng2, layerId, group, options
421
441
* @param lat Array of arrays of latitude coordinates for polygons
422
442
* @param lng Array of arrays of longitude coordinates for polygons
423
443
*/
424
- methods . addPolygons = function ( polygons , layerId , group , options , popup , label , labelOptions ) {
444
+ methods . addPolygons = function ( polygons , layerId , group , options , popup , popupOptions , label , labelOptions ) {
425
445
let df = new DataFrame ( )
426
446
. col ( "shapes" , polygons )
427
447
. col ( "layerId" , layerId )
428
448
. col ( "group" , group )
429
449
. col ( "popup" , popup )
450
+ . col ( "popupOptions" , popupOptions )
430
451
. col ( "label" , label )
431
452
. col ( "labelOptions" , labelOptions )
432
453
. cbind ( options ) ;
0 commit comments