elm-google-maps icon indicating copy to clipboard operation
elm-google-maps copied to clipboard

Google Map Markers

Open andrewMacmurray opened this issue 8 years ago • 3 comments

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?

andrewMacmurray avatar Feb 17 '17 12:02 andrewMacmurray

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

mlovic avatar May 04 '17 20:05 mlovic

@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.

andrewMacmurray avatar May 05 '17 22:05 andrewMacmurray

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

zmijunkie avatar Feb 19 '18 16:02 zmijunkie