Coder Social home page Coder Social logo

Comments (6)

ebidel avatar ebidel commented on April 28, 2024

I don't think the issue title matches what the PR is doing, but I'm not sure we want to add all these listeners to every instance of a marker element. Most people will never listen to them so it's wasteful.

It's fairly easy to add manually:

google.maps.event.addListener(googleMarkerEl.marker, 'click', function(e) { })

from google-map.

positlabs avatar positlabs commented on April 28, 2024

What if we add the event listeners when the attribute is changed (e.g. "on-clickChanged": function(){add listener}) as opposed to adding them all during initialization?

from google-map.

ebidel avatar ebidel commented on April 28, 2024

Polymer treats on-* attributes special for the declarative event handlers. Perhaps this is a opt-in boolean attribute someone can use on the element? <google-map-marker events> would mean setup the listeners on init.

from google-map.

positlabs avatar positlabs commented on April 28, 2024

Ohh yes I like that approach. @DracoNoir, do you want to add this as part of your PR?

from google-map.

DracoNoir avatar DracoNoir commented on April 28, 2024

Yes, although I'm going to go a step farther and separate it into two sets of events: clickEvents and mouseEvents. This will allow a developer to have finer-grained control over which listeners are registered (I suspect that the former will be used more than the latter).

from google-map.

ebidel avatar ebidel commented on April 28, 2024

Should be fixed in https://github.com/GoogleWebComponents/google-map/pull/102/files

from google-map.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.