elm-google-maps
elm-google-maps copied to clipboard
Google Map Markers
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?
I've run into the same problem. Did you find any way around it @andrewMacmurray ?
@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.
putting slot="markers" into the google-map-marker element helped ...