google-map icon indicating copy to clipboard operation
google-map copied to clipboard

_setMarkers not defined

Open cmalagar opened this issue 8 years ago • 2 comments

Hi,

Someone correct if I am overlooking something, but it looks like the "markers" attribute is not getting populated with the current markers added on the page. The markers should be set in _updateMarkers where _setMarkers(newMarkers) is called, but that function is not set anywhere and the markers attribute still returns an empty list of markers when that attribute is referenced.

cmalagar avatar Aug 02 '17 18:08 cmalagar

Hello @cmalagar,

I was having the same problem until I figured you have to declare the google-map-marker as:

<google-map-marker slot="markers" draggable="true" latitude="whatever" longitude="whatever"></google-map-marker>

Notice the slot="markers" property. After that, my markers array is populated. You can see it in commit 361d3896778f224af76e3cb88a141733b9f7f445 This was the issue for me, at least.

Have a good one.

ammopt avatar Aug 25 '17 15:08 ammopt

Thanks for figuring this out! Note this solution appears to need #354 to be merged in to work, otherwise you get this error:

Uncaught TypeError: Cannot set property markers of #<google-map> which has only a getter

JohnRiv avatar Mar 29 '18 21:03 JohnRiv