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

Can not get libraries

Open SemihAkar opened this issue 11 years ago • 5 comments

Im trying to use heatmap layer but even I add 'visualization' to libraries;

.config(['uiGmapGoogleMapApiProvider', function (GoogleMapApi) {
    GoogleMapApi.configure({
//    key: 'your api key',
      v: '3.17',
      libraries: 'weather,geometry,visualization'
    });
  }])

I get error like;

TypeError: Cannot read property 'HeatmapLayer' of undefined

After I looking into network, I figured out that application does not load libraries from google url. The request was like that:

http://maps.googleapis.com/maps/api/js?sensor=false&libraries=drawing

So the problem is that, I cant customize that url from GoogleMapApi.configure. I could not find the reason. So help me :)

SemihAkar avatar Jun 13 '15 15:06 SemihAkar

The whole point of uiGmapGoogleMapApiProvider is that it is fully customizable and overridable. All you need to do is specify the libraries you need to load to get the HeatMapLayer.

nmccready avatar Jun 13 '15 18:06 nmccready

So yeah visualization should be loaded.

https://github.com/angular-ui/angular-google-maps/blob/master/example/assets/scripts/controllers/example.js#L12

Just like you showed above. Your not also loading google maps via your own script tag are you?

nmccready avatar Jun 13 '15 18:06 nmccready

I am loading the api exactly you did, but when I looked at over network the api loads the following script;

http://maps.googleapis.com/maps/api/js?sensor=false&libraries=drawing

What ever I do, it doesnt change.

SemihAkar avatar Jun 15 '15 19:06 SemihAkar

Can you produce an example doing it? Plunkr?

nmccready avatar Jun 15 '15 19:06 nmccready

Okay I solved the problem, somewhere in the code, someone loads the static script. So there is no issue :)

SemihAkar avatar Jun 20 '15 08:06 SemihAkar