ember-leaflet
ember-leaflet copied to clipboard
Change to how bounds are set on map between 2.x.x and 3.0.0?
After upgrading to ember-leaflet 3.0.0
, I am noticing a new error that is not present with the previous version I was using 2.2.8-beta.1
.
I am seeing Uncaught Error: Map container is already initialized
when dynamically changing the value for bounds
on the map. Did anything change about how we should be setting bounds
/center
/etc on the leaflet-map
component from 2.x
to 3.x
?
Here is my relevant coffeescript function:
set_bounds_on_component: () ->
geojson = @get('geojson')
if geojson.features.length > 1
bbox = @get('bbox')
@set('bounds', bbox)
Basically, I am observing changes to geojson
and then calling this helper fn, to update the map bounds. When I go to set a new value for bounds
the Map container is already initialized
error is thrown. I am not observing this on ember-leaflet 2.x
Any guidance would be helpful, thanks. 🙏
using "leaflet": "^1.0.0"
and "ember-leaflet": "3.0.0"
Did you try to update to latest 3.x release?
Yes, I see the same behavior on 3.0.5
that I see on 3.0.0
. Downgrading back to 2.2.8-beta.1
fixes the issue with no other changes to my app.
Did anything change about how we should be setting bounds/center/etc on the leaflet-map component from 2.x to 3.x?
Nothing has changed. Do you think you could reproduce this issue somewhere? Or make a failing test? That would help a lot.
Please reopen if this is still an issue.