[OpenLayers-Dev] Openlayer + Sencha Touch 2.1
Manolo Quijano
manolo.quijano at gmail.com
Mon Dec 10 15:31:06 PST 2012
Hi all!
I'm working to migrate the code of the example Openlayer + Sencha Touch
1.1 (http://openlayers.org/dev/examples/mobile-sencha.html) to Sencha Touch
2.1
After few fights I get to make run a template of the example (only the
map) but the map is not fullfit the whole screen and I don't know what I'm
forgot it.
That's my code of the Main.js:
;**************
Ext.define('Prueba.view.Main', {
extend: 'Ext.Container',
requires: [
'Ext.Toolbar',
'Ext.Button',
'Ext.Component'
],
config: {
fullscreen: true,
items: [{
xtype: 'toolbar',
docked: "bottom",
layout: {
pack: "center"
},
items: [{
iconCls: "home",
iconMask: true,
handler: function(){
}
}]
},
{
xtype: "component",
scroll: false,
monitorResize: true,
id: "map",
height: '100%',
width: '100%',
listeners: {
painted: function(){
init();
},
resize: function(){
if(window.map){
map.updateSize();
}
}
}
}
]
}
});
;****************
and the init function is in the index.hmtl:
<script>
var apiKey =
"AqTGBsziZHIJYYxgivLBf0hVdrAk9mWO5cQcb8Yux8sW5M8c8opEC2lZqKR1ZZXf";
var map;
var renderer = OpenLayers.Util.getParameters(window.location.href).renderer;
renderer = (renderer) ? [renderer] :
OpenLayers.Layer.Vector.prototype.renderers;
function init() {
// create map
var boundswm = new OpenLayers.Bounds(-1146591,4232038,567729,5496445);
//EPSG:900913 Web Mercator
map = new OpenLayers.Map({
div: "map",
theme: null,
//maxExtent: boundswm,
numZoomLevels: 24,
units: 'm',
allOverlays: true,
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
controls: [
new OpenLayers.Control.Attribution(),
new OpenLayers.Control.TouchNavigation({
dragPanOptions: {
enableKinetic: true
}
})
]
});
var mapbing= new OpenLayers.Layer.Bing({
isBaseLayer: true,
key: apiKey,
type: "Aerial",
name: "Bing Aerial",
transitionEffect: 'resize'
});
map.addLayers([mapbing]);
}
</script>
The map is shown but not take the all screen.
Can someone give me a small help in order to know what can be happen?
Thanks in advance,
Manolo Q.
--
--
http://accessprogprotect.no-ip.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20121211/2a7cb376/attachment.html>
More information about the Dev
mailing list