Hi,
I'm trying to set up a map in some Panel and i've difficulties to set up the default zoom ...
Example :
Code:
Ext.define("MyApp.view.Map.MapPanel", {
extend: 'Ext.Panel',
xtype: 'mapcard',
config: {
iconCls: 'globe1', title: 'Carte',
items: [
{
xtype:'toolbar',
title:'Carte',
items: [
{ xtype:'spacer', },
{ xtype:'button', text:'Refresh', iconCls:'refresh', iconMask:'true', id:'refreshMapButton' }
], //toolbar items
docked: 'top',
},
{
xtype:'map',
id:'globalmap',
mapOptions: {
zoom: 10,
}, // mapOptions
},
],
layout:'fit',
}, // config
}); // fin
In the controller, I only center the map :
Code:
// Activation de la carte
onMapRender: function(source, map, eOpts) {
this.getMap().setMapCenter( { latitude: 47.217316595885734, longitude: -1.5465397033691520 } );
// Another way of Zooming ?
var map = this.getMap().getMap();
map.setZoom(10);
var klTronconBF = new google.maps.KmlLayer(
'http://mykml.kml',
);
klTronconBF.setMap(map);
},
Any ideas ?