Reputation: 1196
I have an OpenLayers 2.12/Sencha 2.4 app. On selecting a feature I wish to change to another view - a FormPanel. This works fine using Ext.View.setActiveItem(viewname).
However, there is an issue with Google Chrome on Android, when I change the view from the FormPanel back to the map view, and only after both the virtual keyboard and an Ext.Msg.alert() call have been invoked in the FormPanel.
I've analysed this with Chrome's debugger. When the I click on one of the form fields in the FormPanel, most of the OpenLayers tiles are removed from the DOM. When I set the active item back to the map view, no new tiles are added to the map div so the app ceases to be useful. The svg that is the vector layer also ceases to function usefully.
One version of the app is here: https://treemapp.se/fiddles/sencha/ol-sencha-4.html - all the code is in the html file.
Can anyone help?
Thanks Mini
Upvotes: 0
Views: 174
Reputation: 1196
I added map.updateSize() to the 'painted' listener, which has mostly solved the problem:
Ext.application({
launch: function() {
container1 = new Ext.Container({
scroll: false,
monitorResize: true,
items: [{
xtype: 'component', //xtype: 'panel' - shows nothing
id: 'map',
width: '100%',
height: '100%',
listeners: {
painted: function(){
console.log( "painted" );
if( !map ) {
init( this.id );
} else {
map.updateSize();
}
}
}
}]
});
});
});
Looks like I might need to add a layer.redraw() or layer.refresh() loop for all the layers, as one or two tiles don't get redrawn after the call to map.updateSize() - they do however get drawn after zooming or moving.
Mini
Upvotes: 0