Google map error: a is null

后端 未结 10 1861
予麋鹿
予麋鹿 2021-01-03 17:15

I have a program that I want to use google maps for. The problem is I get an error that says a is null where a is a var used in the google map api. Here is how I call my goo

10条回答
  •  天涯浪人
    2021-01-03 18:02

    I got this error once. Make sure the map script runs only on pages using the map. You can check if the map exists by using an "if". Something like this:

    if ($('mapClass').length>0) { // here you run the google maps functions }
    

    See ya

提交回复
热议问题