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

Google Map Markers #2

Open
andrewMacmurray opened this issue Feb 17, 2017 · 3 comments
Open

Google Map Markers #2

andrewMacmurray opened this issue Feb 17, 2017 · 3 comments

Comments

@andrewMacmurray
Copy link

I love this example, so promising!

I've been having trouble however rendering map markers using this approach.

the <google-map> web component suggests you can render map markers by nesting <google-map-marker> as children. eg:

<google-map latitude="37.77493" longitude="-122.41942" fit-to-markers>
  <google-map-marker latitude="37.779" longitude="-122.3892"></google-map-marker>
  <google-map-marker latitude="37.777" longitude="-122.38911"></google-map-marker>
</google-map>

if you add the above as just plain html, the markers then get rendered within an <iron-selector> tag.

<iron-selector id="selector" selected-attribute="open" activate-event="google-map-marker-open" class="style-scope google-map">
   <google-map-marker latitude="37.779" longitude="-122.3892"></google-map-marker>   
   <google-map-marker latitude="37.777" longitude="-122.38911"></google-map-marker>
</iron-selector>

However, if you add the equivalent in elm the web component doesn't pick the markers up (they get added below the iron-selector).

I'm wondering if this is a similar issue to #1 except there's the added step of updating which markers are attached based on data from an elm app.

Any thoughts or suggestions?

@mlovic
Copy link

mlovic commented May 4, 2017

I've run into the same problem. Did you find any way around it @andrewMacmurray ?

@andrewMacmurray
Copy link
Author

@mlovic unfortunately not, ended up using ports to communicate with google maps (this was the app had to implement this on: https://github.com/TechforgoodCAST/tech-for-good-near-you).

I thought it would be more buggy but it seems to work fairly well, although would be much nicer to use the above solution.

@zmijunkie
Copy link

putting slot="markers" into the google-map-marker element helped ...

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

3 participants