Google Map addDomListener function parameter

前端 未结 2 1822
清酒与你
清酒与你 2020-12-22 05:17

I want to get parameter from function

function initialize(myPin,myCen) {
   var myLatlng = new google.maps.LatLng(myPin);
   var mapOptions = { center: new g         


        
相关标签:
2条回答
  • 2020-12-22 05:44

    The google.maps.event.addDomListener function takes a function pointer as its argument. You can use a pointer to an anonymous function:

    google.maps.event.addDomListener(window, 'load', function() {
      initialize(myPin,MyCen)
    });
    
    0 讨论(0)
  • 2020-12-22 05:50

    you can try like this

    window.onload=function() {
        google.maps.event.initialize(myPin,MyCen);
    }
    
    0 讨论(0)
提交回复
热议问题