Google Maps V3 API Key Invalid - but my personal dev key works

后端 未结 11 980
梦谈多话
梦谈多话 2020-12-31 10:24

I\'ve recently been doing development upgrading our maps to v3 and during development I was using my own personal key. Everything was working fine. When it was time to go to

11条回答
  •  灰色年华
    2020-12-31 11:07

    I have been getting the invalid key message too, and after trawling all round the web, have found what MY problem was. It may affect others too. It had nothing to do with the key.

    I discovered that I had an error in the 'initialize' function (in my case a missing comma at the end of a line in the mapOptions). This arose because I added a new (last) line, and failed to put a comma at the end of the preceding one. A good argument for always having a comma, even on the last line.

    I can now switch the invalid key message ON or OFF my removing/replacing that comma. I conclude that any error in the map related JS may give rise to it.

提交回复
热议问题