Stack Exchange
Custom Google Maps Marker with Polymer Project
I want to handle the click event of a marker on the map so I wanted to extend the google-map-marker. this is my-map-marker.html:
    <link rel="import" href="../bower_components/google-map/google-map.html">

    <polymer-element name="my-map-marker" extends="google-map-marker">
    <script>
        Polymer({
          click: function() {
            console.log("latitude:", this.latitude);
          },
        });
      </script>
    </polymer-element>

and I use it in another element as:

<paper-input value={{query}} label="Where?" floatingLabel></paper-input>

            <google-map-search map="{{map}}" query="{{query}}" results="{{results}}"></google-map-search>

            <google-map map="{{map}}" fitToMarkers>
                <template repeat="{{results}}">
                    <my-map-marker latitude="{{latitude}}" longitude="{{longitude}}" clickEvents="true">
                        <h2>{{name}}</h2> {{formatted_address}}
                    </my-map-marker>
                </template>
            </google-map>

my code shows matching markers on map as i type location name if i use . but it gives this error code in developer console when I want to use :
Uncaught TypeError: Cannot read property 'setMap' of nullgoogle-map.html:197 Polymer.detachedpolymer.js:9961 base.detachedCallbackpolymer.js:7348 TemplateIterator.extractInstanceAtpolymer.js:7393 TemplateIterator.handleSplicespolymer.js:7301 TemplateIterator.valueChangedpolymer.js:7284 TemplateIterator.updateValuepolymer.js:7275 TemplateIterator.updateIteratedValuepolymer.js:4913 Observer.report_polymer.js:5180 createObject.check_polymer.js:4811 callback
How can I extend google-map-marker?

Based on Polymer documentation: "If you used extends to create a Polymer element that derives from an existing DOM element (something other than HTMLElement)", this syntax worked:
<google-map-marker is="my-map-marker" map="{{map}}" latitude="{{latitude}}" longitude="{{longitude}}">
    <h2>{{name}}</h2> {{formatted_address}}
</google-map-marker>

