1

There is an external map on : https://gis.apcrda.org/lps/index.html

i have iframed it using this code in my html page :-

      <iframe
        id="crdamap"
        width="500"
        height="400"
        frameborder="0"
        scrolling="no"
        marginheight="0"
        marginwidth="0"
        onLoad="load_plots_for_sale();"
        title="Avenue Plots for Sale" src="https://gis.apcrda.org/lps/index.html">
      </iframe>

the function to be executed on load of iframe should go like this:

function load_plots_for_sale(){
    $(map).on("load", function(){
       console.log('xxxxxxxxxxxxxxxxxxxzzzzzzzzzzz');
    });
}

but i am not able to pick the map, is there any other event which i should listen to? like:

layer.loadend

if so how can i load another layer to the map after all original layers have finished loading.

1

Are you on the same domain? I think what you want to do is only available on the same domain. Remove your onLoad call in your iframe tag, then try this JS:

// OPEN UP CONSOLE AND SEE THE LOGS:
$("#crdamap").on('load', function() {
  var iframe= $('#crdamap')[0];
  var iframewindow= iframe.contentWindow? iframe.contentWindow : iframe.contentDocument.defaultView;
  console.log('iframe window object', iframewindow);
  console.log('iframe map object', iframewindow._widgetManager.map);
});

Link to demo.

  • 1
    Sorry for the late reply i will check it and reply. – Sandeep Kumar Feb 2 '18 at 17:30
  • @SandeepKumar did this help your issue? – GavinR Mar 12 '18 at 15:17
  • No Sir it did not – Sandeep Kumar Mar 23 '18 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.