Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icon property broken in google-map-marker #405

Closed
dougchestnut opened this issue Oct 21, 2017 · 1 comment
Closed

icon property broken in google-map-marker #405

dougchestnut opened this issue Oct 21, 2017 · 1 comment

Comments

@dougchestnut
Copy link

If I use a google-map-marker with an icon attribute set as a string like so:

<google-map-marker icon="https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png"></google-map-marker>

I get a marker but the icon used is the generic/default icon used. If I inspect the google-map-marker element I see the icon attribute in the dom but the element's icon property is not set (set to undefined).

If I change the type of the icon property in google-map-marker from Object to String then the icon works. I suppose this breaks the other supported types of icons however (google.maps.Icon|google.maps.Symbol).

          /**
           * Image URL for the marker icon.
           *
           * @type string|google.maps.Icon|google.maps.Symbol
           */
          icon: {
            type: String,
            value: null,
            observer: '_iconChanged'
          },
@dougchestnut
Copy link
Author

dougchestnut commented Oct 25, 2017

So I figured out that in 2.0 an attribute typed as an Object must be in JSON format.
This works:

<google-map-marker icon='"https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png"'></google-map-marker>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant