Closed ralexrdz closed 6 years ago
for a very strange reason If change your mapbox-gl-marker.html
file
If I set a new property x
in line 173 disconnectedCallback ()
if (this.x) {
this.x.remove();
}
and in line 214 _createMarker ()
let mapboxMarker = new mapboxgl.Marker(ele, {offset: [offsetLeft, offsetTop]})
.setLngLat([this.longitude, this.latitude])
.addTo(map)
this.set('x',mapboxMarker)
return mapboxMarker;
it do binds and remove the Markers
My main problem is that marker property is undefined
. I don't know why, I've tried debbug it and have no clue why this happens. I've even removed the readOnly: true
and nothing
I'll open other issue [#27]
Let me have a look.
@ralexrdz I made a typo mistake. I forgot to return the marker object when creating it. It should work in the next release.
Once I fix the other few bugs, I will release the next version.
I'm binding an array to a
dom-repeat
to show markers in a mapwhen the array changes, specifically remove some elements, the markers stay in the map.
Any ideas? How could I achieve this?