Yep. That insures the Maps API is loaded before you start using it.
On Sat, Nov 14, 2015, 5:38 AM Hans Dulimarta <[email protected]>
wrote:
> I think I found the answer to my own question. I have to wait for the '
> google-map-ready' event:
>
> <template>
> <google-map ..... on-google-map-ready="_apisloaded"></google-map>
> <script>
> ....
> _apisloaded:function() {
> ____ = new.google.LatLng (...., ....); /* this works */
> }
> </script>
> </template>
>
> On Saturday, November 14, 2015 at 8:04:03 AM UTC-5, Hans Dulimarta wrote:
>>
>> I am trying to use google.maps.visualization.HeatmapLayer in a polymer
>> element that includes <google-map> by every I tried to create a new map
>> object
>>
>> <link rel="import" href="../../bower_components/polymer/polymer.html>
>> <link rel="import"
>> href="../../bower_components/google-map/google-map.html>
>> <dom-module is="heat-map">
>> <template>
>> <google-map longitude="...." latitude="..."></google-map>
>> </tempalate>
>> <script>
>> Polymer({is:"heat-map",
>> ready: function() {
>> var cpos = new google.maps.LatLng (....., .....);
>> var hmap = new google.maps.visualization.HeatmapLayer(.....);
>> }
>> );
>> </script>
>> </dom-module>
>>
>> I always get the error "google" (in undefined) at the lines
>> new.google.maps......
>>
>> What I'd like to do is actually to extend my heat-map from google-map:
>>
>> <dom-module is="heat-map" extends="google-map">
>> </dom-module>
>>
>> but the online documentation
>> <https://www.polymer-project.org/1.0/docs/devguide/registering-elements.html>
>> states that (currently) we can extend only native HTML elements.
>>
> Follow Polymer on Google+: plus.google.com/107187849809354688692
> ---
> You received this message because you are subscribed to the Google Groups
> "Polymer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/0f560224-5f72-4259-a0d5-e1e5bf6ae3bf%40googlegroups.com
> <https://groups.google.com/d/msgid/polymer-dev/0f560224-5f72-4259-a0d5-e1e5bf6ae3bf%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/polymer-dev/CACGqRCDwAQFC7dGZ%2BREYo%2BMK2ZZKY_SLWUdMPC-8v0UFF-LutQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.