TransWikia.com

Interaction of leaflet.browser.print and esri.geosearch

Geographic Information Systems Asked by bagration on February 18, 2021

I am using leaflet.browser.print:

 L.control.browserPrint({
     documentTitle:'Verify Me!',
     closePopupsOnPrint:false
 }).addTo(map);

with an esri geocode search:

var searchControl = L.esri.Geocoding.geosearch({
providers: [
  L.esri.Geocoding.featureLayerProvider({
    url: 'https://maps.spartanburgcounty.org/server/rest/services/address_points/MapServer/0',
    zoomToResult: false,
    useMapBounds: false,
    searchFields: ['FullName'],
    label: 'Search a Spaco Address',
    formatSuggestion: function (feature) {
      return feature.properties.FullName + ' <br> ' + feature.properties.MSAGComm;
    }
  })

Then I call the result of the search and successfully generate a popup:

 searchControl.on('results', function(data) {
    var popup = L.popup({closeOnClick:false}).setLatLng(data.results[0].latlng).setContent(data.results[0].text).openOn(map);

But even with closePopupsOnPrint set to false, the popup closes when I go to print. I need to it stay visible during the print. I figure there must be some issue between the two leaflet plugins, but I cannot as of yet figure out why. Hoping someone else does.

Here is my pen:
https://codepen.io/pen/?template=jOWmaQb

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP