angular-google-maps icon indicating copy to clipboard operation
angular-google-maps copied to clipboard

google is not defined! Module 'uiGmapgoogle-maps' is not available!

Open Sepho opened this issue 8 years ago • 13 comments

Hi guys,

I'm using yeoman to build my site (with this generator: https://github.com/Swiip/generator-gulp-angular ). I've been developing my site with 'gulp serve' and everything is working fine, but when I tried to build the final product, with 'gulp build' and after all scripts were injected and minified, if I try to open my index.html I get this error (see screenshot).

I mean, everything works fine on "dev" proccess (gulp serve), but when I try to get the final version (gulp build) I get this error. I've installed angular-google-maps via bower (with --save flag). I even tried to install angular-simple-logger as a separated package.

Any idea? Thanks in advance and sorry for my broken english!

captura de pantalla 2016-05-19 16 09 36

Sepho avatar May 19 '16 14:05 Sepho

We notice that too in our slush-marklogic-node generator. Downgrading to angular-google-maps#2.3.2 solved the issue temporarily. It seems some code was pushed externally, but that is not respecting the async way of loading google?

grtjn avatar May 23 '16 10:05 grtjn

I close this issue because it seems that it's a gulp issue. On 'build' task, it minifies all files and loads controller before google-maps js file. I solved it by adding outside all minified files.

Sepho avatar May 23 '16 10:05 Sepho

I am also facing the same issue. And downgrading to angular-google-maps#2.3.2 fixed it. I guess the problem is with the latest version. Can we again re-open the issue and look into it ?

VaibhavP17 avatar May 31 '16 11:05 VaibhavP17

Sorry, I thought it was a gulp task issue!

Sepho avatar May 31 '16 11:05 Sepho

I have the same issue. Downgrade to the version 2.3.2 solves the issue.

pustun avatar Jun 01 '16 12:06 pustun

I also have this issue - havent tried downgrading though

Rex90 avatar Jun 06 '16 13:06 Rex90

I have the same issue

brianmtully avatar Jun 09 '16 15:06 brianmtully

I couldn't downgrade because 2.3.2 has broken cluster images which my site depends on. I was able to hack it for now by adding the script tag into the index.html without async defer:

    <!-- Hack to fix exceptions caused by latest version of angular-google-maps -->
    <script src="https://maps.googleapis.com/maps/api/js"></script>

This probably isn't a good thing in the long run, especially loading it without an API key, but it got my site back up and running tonight. I tried to look at making a fix to the library itself, but I have no interest in dealing with CoffeeScript.

Note that this issue is a duplicate of #1853.

Splaktar avatar Jun 16 '16 02:06 Splaktar

Hi, even after downgrading to 2.3.2, its not working. Please check this plunker - http://plnkr.co/edit/AJpJxBHF1SpwCtRKEzPF?p=preview

I have changed the angular-google-maps to v2.3.2.

Please let me know if you are able to resolve this. Thanks.

StepEnquero avatar Jul 27 '16 19:07 StepEnquero

Same problem am facing how can I resolve this one I have changed #2.3.2 version but still it is not working...any help

krushnachandra avatar Aug 17 '16 17:08 krushnachandra

Broken for us as well in v2.3.4. We are not using gulp.

noherczeg avatar Aug 26 '16 12:08 noherczeg

Even I faced the same problem and I missed to include these lines in index.html file: <script src='/lib/lodash/dist/lodash.min.js'></script> <script src='lib/angular/angular.min.js'></script> <script src='lib/angular-simple-logger/dist/angular-simple-logger.min.js'></script> <script src='lib/angular-google-maps/dist/angular-google-maps.js'></script>

Note: you need to link them exactly from your libraries, directory structure may vary from project to project.

Also, don't forget to add the this in your css : .angular-google-map-container { height: 400px; }

siddharth8868 avatar Sep 23 '16 03:09 siddharth8868

If you guys are using async defer to load google maps in index.html, remove async and it should work. GoogleMaps are not yet loaded by the time you are accessing it in your component. That was the problem.

shirishpickup avatar Aug 17 '17 20:08 shirishpickup