google.maps.geometry.spherical error

后端 未结 2 795
执念已碎
执念已碎 2021-02-18 20:34

I am having some troubles using the geometry at google maps. I am getting the following error: \"Unable to get property \'spherical\' of undefined or null reference.\"

T

相关标签:
2条回答
  • 2021-02-18 21:29

    Are you loading the correct library with the libraries= parameter?

    <script src="https://maps.googleapis.com/maps/api/js?v=3&sensor=false&libraries=geometry"></script>
    
    0 讨论(0)
  • 2021-02-18 21:36

    First you need to import libraries modules and then auth key module. I think here the problem is at the time of executing library functions importing library modules is not completed. If you import auth key module first what happened is immediately it calls the initialize() method by the time library modules loading is not completed. So you need to import library modules first and then auth module.

    0 讨论(0)
提交回复
热议问题