ember-leaflet icon indicating copy to clipboard operation
ember-leaflet copied to clipboard

Change to how bounds are set on map between 2.x.x and 3.0.0?

Open radcliff opened this issue 8 years ago • 3 comments

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"

radcliff avatar Nov 20 '16 20:11 radcliff

Did you try to update to latest 3.x release?

miguelcobain avatar Nov 21 '16 19:11 miguelcobain

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.

radcliff avatar Nov 22 '16 08:11 radcliff

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.

miguelcobain avatar Nov 22 '16 10:11 miguelcobain

Please reopen if this is still an issue.

miguelcobain avatar Apr 25 '23 12:04 miguelcobain