jessica.sena

AddLayer outside OnCreate NOT working. BUG?

Discussion created by jessica.sena on May 13, 2013
Hi,

I'm experimenting a weird behaviour with map.addLayer() method and I'm not sure if it's a bug or I'm missing something.

The thing is that in some Android devices (i.e. Samsung Galaxy Ace) when I add layers to the map after the OnCreate method these layers are not showing in the map, but if I add the layers during the onCreate method, these layers are showing correctly.

I could guess that you can only use the addLayer method on the OnCreate process, but it has no sense because as I say, this only happens in some Android devices... and that's why I'm not getting which is the exact problem.

These are two examples about 2different ways of how I add the layers:

map.removeAll();
WMSLayer wms = new WMSLayer("http://mapcache.icc.cat/map/bases/service?",SpatialReference.create(23031));
map.addLayer(wms);


or

baseLayer.setVisible(false);//I set to not visible the current layer added to the map
WMSLayer wms = new WMSLayer("http://mapcache.icc.cat/map/bases/service?",SpatialReference.create(23031));
map.addLayer(wms);


Anyone has noticed the same? Anyone from ESRI could try to reproduce the problem?

Thanks in advanced,

Outcomes