PDA

View Full Version : Ext.Map Zoom trouble



xiii29
2 Nov 2012, 4:58 AM
Hi,
I'm trying to set up a map in some Panel and i've difficulties to set up the default zoom ...

Example :


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 :


// 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 ?

xiii29
2 Nov 2012, 8:11 AM
I've tryied to set my kml on this web site :
http://display-kml.appspot.com/


R (http://display-kml.appspot.com/)esults seems ok.