Issue with child template google map



  • Hi,

    We are displaying google map on parent as well as child template.But sometime child template google map is not showing.We are using

      google.maps.event.addListenerOnce(map, 'idle', function () {
                        window.JSREPORT_READY_TO_START = true;
                    });
    

    on both child and parent template to display google maps.

    Please suggest how can we fix child template google map.

    Thanks in advance.


  • administrators

    maybe waitForJS phantom option is not activated in the child template, have you verified that?



  • Hi

    wait for printing tigger is already checked for parent template where recipe is pdf but how can we achieve same for child template where recipe is html on jsreport studio.

    Thanks in advance.


  • administrators

    ah ok, i see the issue now. hmm since child template with html recipe does not have a way to wait for content to be ready then you won't be able to make it work with javascript events and child templates, maybe an alternative for you can be to use assets instead of child templates, with assets you just embed the content of the assets directly in the parent, so the waitForJS will work normally there but you will need to update your logic to call window.JSREPORT_READY_TO_START = true when all your maps (including maps in parent and assets) are ready, so your logic should be something like this:

     google.maps.event.addListenerOnce(map, 'idle', function () {
                       if (totalMaps === mapsReady) {
                           window.JSREPORT_READY_TO_START = true;
                       } else {
                          mapsReady++;
                       }
    
                    });
    

    you will need set totalMaps according to your data, an initialize the mapsReady variable at the beginning of your parent js



  • Thanks


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.